cdk-monitoring-constructs icon indicating copy to clipboard operation
cdk-monitoring-constructs copied to clipboard

[fargate] Support FargateService in MonitoringFacade.monitorFargateService

Open bjoc1 opened this issue 3 years ago • 1 comments

Feature scope

MonitoringFacade.monitorFargateService

Describe your suggested feature

Currently monitoring using MonitoringFacade.monitorFargateService API only supported on the following Fargate constructs: NetworkLoadBalancedFargateService, ApplicationLoadBalancedFargateService. Can you please add support to FargateService type as well.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.FargateService.html

Thank you.

bjoc1 avatar Aug 22 '22 16:08 bjoc1

+1 on request. One work-around available today seems to be:

import * as monitoring from "cdk-monitoring-constructs";

// monitor = new monitoring.MonitoringFacade(...);
// fargateService = cdk.FargateService instance

monitor.addSegment(
  new monitoring.FargateServiceMonitoring(monitor, { fargateService })
);

In other words, FargateServiceMonitoring supports a raw FargateService instance while the method on MonitoringFacade does not. Thus, I think the fix here is to swap FargateServiceMonitoringProps for CustomFargateServiceMonitoringProps.

openwebsolns avatar Sep 22 '22 11:09 openwebsolns

Doesn't facade.monitorSimpleFargateService({ fargateService }) work?

https://github.com/cdklabs/cdk-monitoring-constructs/blob/edfc4e4bcb68f7f71df18fc2acab84f130ce3988/lib/facade/MonitoringFacade.ts#L456-L463

r0b0ji avatar Oct 22 '22 18:10 r0b0ji

facade.monitorSimpleFargateService({ fargateService }) should indeed fulfill this need, but let me know if I'm missing something.

echeung-amzn avatar Aug 10 '23 16:08 echeung-amzn