cdk-monitoring-constructs
cdk-monitoring-constructs copied to clipboard
[fargate] Support FargateService in MonitoringFacade.monitorFargateService
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.
+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.
Doesn't facade.monitorSimpleFargateService({ fargateService }) work?
https://github.com/cdklabs/cdk-monitoring-constructs/blob/edfc4e4bcb68f7f71df18fc2acab84f130ce3988/lib/facade/MonitoringFacade.ts#L456-L463
facade.monitorSimpleFargateService({ fargateService }) should indeed fulfill this need, but let me know if I'm missing something.