问题
Need to generate CloudWatch Alarm for API Gateway and Lambda functions.
For API Gateway CloudWatch Alarm should be generated if 5XX Error count is 10% of total request count at given period (e.g. 5 minutes).
Similarly, We need to add a metric if Maximum Latency 6% of total request count > 4 seconds.
For such type of metric looks like we need a combination of metric like Sum of total requests and than need to calculate percentage of errors.
We have Math Expressions/Metric math which might be used. Is there any other way to achieve this?
Any help is appreciated!
回答1:
EDIT: Its now possible to create alarms on Metric expressions from the CloudWatch Console.
Original Answer below:
Unfortunately its not possible to create alarms based on Metric expressions in CloudWatch. Your best bet may be the M of N thresholds in alarms, for example: If num_of_errors > 5 for 3 datapoints in 5 minutes. Its not exactly what your asking for, but may be a good start. Best of luck!
来源:https://stackoverflow.com/questions/50233343/how-to-generate-aws-cloudwatch-alarm-which-involves-multiple-metrics