aws-cloudwatch: Metrics must support 6 new advanced statistics #21666
Labels
@aws-cdk/aws-cloudwatch
Related to Amazon CloudWatch
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
As listed on https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html, CloudWatch metrics now support 12 statistics which can be used at graphing or alarming time. Statistics include trimmed mean, percentile rank, etc. - which come with a syntax similar to that of percentiles.
Use Case
Need to create alarms and graphs using trimmed mean or percentile rank
Proposed Solution
aws-cloudwatch/lib/metric.ts - review comment lines 24-35, replace "percentile" with a more generic "advanced stat" line 392
Implement advanced stat logic in aws-cloudwatch/lib/private/statistic.ts - function parseStatistic
Instead of returning just the percentile value, return the actual syntax p99, and add tm, pr, tc, ts… to the list of supported advanced statistics.
I understand lines 24-35 of metric.ts should update https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.MetricOptions.html
Other Information
No response
Acknowledgements
CDK version used
2.38
Environment details (OS name and version, etc.)
N/A
The text was updated successfully, but these errors were encountered: