Open btd opened 10 months ago
Currently there are 3 ways to import Fargate Service:
// from FargateService fromFargateServiceArn(scope: Construct, id: string, fargateServiceArn: string): IFargateService; fromFargateServiceAttributes(scope: Construct, id: string, attrs: FargateServiceAttributes): IBaseService; // from BaseService fromServiceArnWithCluster(scope: Construct, id: string, serviceArn: string): IBaseService;
You can see that output it is either IBaseService or IFargateService
IBaseService
IFargateService
To get metrics as they currently defined i need to get BaseService:
BaseService
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric; metricMemoryUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric; metricCpuUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
For example INetworkLoadBalancer contains separate metrics property and i can easily use imported instance.
INetworkLoadBalancer
metrics
Access to metrics provided via IBaseService or IFargateService
No access and no clear workaround.
See description please
Similar to INetworkLoadBalancer we can expose metrics property with defined metrics
No response
2.115.0 (build 58027ee)
18.x
AL2
TypeScript
~5.3
Sounds good and this seems a feature request to me. Please help us prioritize with 👍 . Thank you.
Describe the bug
Currently there are 3 ways to import Fargate Service:
You can see that output it is either
IBaseService
orIFargateService
To get metrics as they currently defined i need to get
BaseService
:For example
INetworkLoadBalancer
contains separatemetrics
property and i can easily use imported instance.Expected Behavior
Access to metrics provided via IBaseService or IFargateService
Current Behavior
No access and no clear workaround.
Reproduction Steps
See description please
Possible Solution
Similar to
INetworkLoadBalancer
we can expose metrics property with defined metricsAdditional Information/Context
No response
CDK CLI Version
2.115.0 (build 58027ee)
Framework Version
No response
Node.js Version
18.x
OS
AL2
Language
TypeScript
Language Version
~5.3
Other information
No response