question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(Cloudwatch): Metrics with labels can't be used in alarms for API Gateway metrics

See original GitHub issue

Just 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:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
robo-skcommented, Mar 10, 2021

@robo-sk great catch! Since the ID doesn’t matter too much here (at least, I don’t think… hope I’m not wrong), we could just prefix the id with something like a lowercase m. Feel like submitting a PR for this? 😃

Can I work on this?

Sure, go ahead…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found