Setting alarms on metrics created with the embedded metric format - Amazon CloudWatch

Setting alarms on metrics created with the embedded metric format

In general, creating alarms on metrics generated by embedded metric format follows the same pattern as creating alarms on any other metrics. For more information, see Using Amazon CloudWatch alarms.

Embedded metric format metric generation depends on your log publishing flow, because the logs have to be processed by CloudWatch Logs to be transformed into metrics. So it’s important for you to publish logs in a timely manner so that your metric datapoints are created within the period of time in which alarms are evaluated.

If you plan use embedded metric format to send high-resolution metrics and create alarms on these metrics, we recommended that you flush logs to CloudWatch Logs at an interval of 5 seconds or less to avoid introducing additional delay that can cause alarming on partial or missing data. If you are using the CloudWatch agent, you can adjust the flush interval by setting the force_flush_interval parameter in the CloudWatch agent configuration file. This value defaults to 5 seconds.

If you are using Lambda on other platforms where you can’t control the log flush interval, consider using “M out of N” alarms to control the number of datapoints used to alarm. For more information, see Evaluating an alarm.