[aws-cloudwatch] Missing ThresholdMetricId
See original GitHub issueWhen creating Cloudwatch Alarm that makes use of anomaly detection the following error is raised at deploy time:
ComparisonOperators for ranges require ThresholdMetricId to be set (Service: AmazonCloudWatch; Status Code: 400; Error Code: ValidationError; Request ID: xxx; Proxy: null)
Reproduction Steps
aws_cloudwatch.Alarm(
self,
"my_alarm",
evaluation_periods=1,
metric=sqs_queue.metric_number_of_messages_sent(),
threshold=2,
statistic="Average",
comparison_operator=aws_cloudwatch.ComparisonOperator.LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD,
)
The Alarm construct works great for any of the other ComparisonOperators that do not rely on anomaly detection i.e. GreaterThanThreshold
.
Environment
- CLI Version : 1.62.0
- Framework Version: 1.64.0
- Node.js Version: v12.14.1
- OS : MacOS Catalina
- Language (Version): Python 3.7
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:10 (5 by maintainers)
Top Results From Across the Web
MetricAlarm - Amazon CloudWatch - AWS Documentation
Sets how this alarm is to handle missing data points. The valid values are breaching , notBreaching , ignore , and missing ....
Read more >class CfnAlarm (construct) · AWS CDK
Sets how this alarm is to handle missing data points. Valid values are breaching , notBreaching , ignore , and missing . For...
Read more >Using Amazon CloudWatch alarms - AWS Documentation
When an AWS/DynamoDB metric has missing data, alarms that evaluate that metric remain in their current state. How alarm state is evaluated when...
Read more >PutMetricAlarm - Amazon CloudWatch - AWS Documentation
Alarms that evaluate metrics in the AWS/DynamoDB namespace always ignore missing data even if you choose a different option for TreatMissingData . When...
Read more >AWS::CloudWatch::Alarm - AWS CloudFormation
The AWS::CloudWatch::Alarm type specifies an alarm and associates it with the ... Double ThresholdMetricId: String TreatMissingData: String Unit: String ...
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
In the meantime, If you really need this feature you can configure it using escape hatch:
👋 A status update on this would be highly appreciated!