amazon-web-servicesamazon-cloudwatchalarmcloudwatch-alarms

Cloudwatch alarm about accountwide concurrency limit


I would like to create a cloudwatch alarm to alert before reaching the concurrency limit of the account. I have over 10 lambda functions, thus I can't use the ConcurrentExecutions metric provided by AWS due to the limitation about the number of metrics that can be used for a single alarm.

Reference to the limitation: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_limits.html "Alarms based on metric math expressions can have up to 10 metrics."

I have looked at composite alarms, but that would not solve my problem. I want to monitor all of my lambdas at once and alert when the sum of the concurrentExecutions metrics is greater than 900.

Any idea how to overcome this limitation? I would like to get notified before throttling my lambda functions.

Thank you!


Solution

  • There is a metric called Across All Functions in CloudWatch metrics.

    The documentation says:

    Across All Functions (none) – View aggregate metrics for all functions in the current AWS Region. https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html#monitoring-metrics-console

    To create an Alarm for this, go to CloudWatch > Metrics > All > AWS Namespace > Lambda > Across All Functions

    Select ConcurrentExecutions then click on Create alarm. enter image description here

    If you are creating the Alarm via code, sdk or cli, you can leave the Dimension empty since you don't need to specify the Function name.