(Cloudwatch): Metrics with labels can't be used in alarms for API Gateway metrics
See original GitHub issueJust getting this with v1.92 (worked fine <=1.91)
updating Cloudwatch alarm yields: Invalid metrics list (Service: AmazonCloudWatch; Status Code: 400; Error Code: ValidationError
Reproduction Steps
alarm = metric.create_alarm(
self,
id=id_alarm,
alarm_description=kwargs['alarm_description'],
threshold=kwargs['threshold'],
period=core.Duration.minutes(kwargs['period_in_minutes']),
comparison_operator=cw.ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD,
evaluation_periods=kwargs['evaluation_periods'],
statistic=kwargs['statistic']
)
these are the parameters I’m passing to it:
{
"metric_name": "5XXError",
"label": "HTTP 5XX",
"statistic": "sum",
"color": "#d62728",
"period_in_minutes": 1,
"alarm": {
"alarm_description": "5XX at 1 threshold",
"threshold": 1,
"period_in_minutes": 5,
"evaluation_periods": 1,
"statistic": "sum"
}
}
What did you expect to happen?
a Cloudwatch alarm resource created/updated
What actually happened?
UPDATE_FAILED | AWS::CloudWatch::Alarm |
Invalid metrics list (Service: AmazonCloudWatch; Status Code: 400; Error Code: ValidationError;
Environment
- CDK CLI Version : 1.92
- Framework Version: 1.92
- Node.js Version: 10
- OS : amazonlinux2-x86_64-standard:1.0
- Language (Version): Python (3.7)
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Using Amazon CloudWatch alarms - AWS Documentation
A metric alarm watches a single CloudWatch metric or the result of a math expression based on CloudWatch metrics. The alarm performs one...
Read more >Introduction to the Amazon CloudWatch Metric Streams ...
AWS CloudWatch Metric Streams integration is the recommended solution to monitor all CloudWatch metrics from all AWS services, including custom namespaces.
Read more >Using AWS CloudWatch | Crosswalk - Pulumi
Pulumi Crosswalk for AWS CloudWatch help you operationally understand and manage your AWS CloudWatch metrics, resources and applications.
Read more >Setup CloudWatch Alarm
Visit the CloudWatch console and choose ALARM under Alarms. · Choose Create alarm. · Choose Select metric and then ApiGateway from the AWS...
Read more >AWS CloudWatch data source | Grafana documentation
To read CloudWatch metrics and EC2 tags, instances, regions, and alarms, you must grant Grafana permissions via IAM. You can attach these permissions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, go ahead…
It’s just all about the CloudFormation specification and how the cdk creates underlying resources.
ID property: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-id
Metrics property on alarm: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarm-metrics