A SysOps Administrator is configuring a monitoring solution for a dynamic fleet of Amazon EC2 instances. The instances run a custom application that reports a custom metric named to Amazon CloudWatch. To monitor the overall session load, the administrator attempts to create a CloudWatch alarm based on a metric math expression that uses the function to dynamically locate and sum the metric across all instances in the Auto Scaling group. However, the administrator is unable to save the alarm due to a validation error.
Which of the following explains why this configuration failed?
- AThe alarm must be routed through an Amazon EventBridge rule to aggregate the search results before CloudWatch can evaluate the metric threshold.
- BDetailed monitoring must be enabled on the EC2 instances before custom metrics can be used in metric math expressions.
- Amazon CloudWatch alarms do not support metric math expressions that contain a function.Cevap
- DThe metric math expression must specify a standard -minute evaluation period rather than a -minute period to match the default EC2 metric collection interval.
Cevap
Amazon CloudWatch alarms do not support metric math expressions that contain a SEARCH function because the search query returns a dynamic number of time series that cannot be mapped to a static alarm configuration.
The correct answer states that Amazon CloudWatch alarms do not support metric math expressions containing a SEARCH function. While CloudWatch supports metric math for alarms (e.g., SUM, AVG), any expression containing a SEARCH function cannot be used to create an alarm. This is because search expressions return a dynamic number of time series (which can change as EC2 instances launch or terminate), whereas a CloudWatch alarm requires a stable number of time series to evaluate against a threshold.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Alarm limitations with Metric Math and SEARCH expressions