Soru

Zorluk: ZorCloudWatch Metrics and Alarms

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 ActiveSessionsActiveSessions 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 SEARCHSEARCH function to dynamically locate and sum the ActiveSessionsActiveSessions 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?

  1. A
    The alarm must be routed through an Amazon EventBridge rule to aggregate the search results before CloudWatch can evaluate the metric threshold.
  2. B
    Detailed monitoring must be enabled on the EC2 instances before custom metrics can be used in metric math expressions.
  3. Amazon CloudWatch alarms do not support metric math expressions that contain a SEARCHSEARCH function.Cevap
  4. D
    The metric math expression must specify a standard 55-minute evaluation period rather than a 11-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

1
Identify the configuration details of the CloudWatch alarm.
The alarm uses a metric math expression containing a SEARCHSEARCH function to aggregate a custom metric (ActiveSessionsActiveSessions) dynamically.
To understand the context of the validation failure when saving the alarm.
2
Analyze the limitations of CloudWatch alarms with respect to metric math and search functions.
Amazon CloudWatch allows metric math for alarms but explicitly prohibits using the SEARCHSEARCH function in an alarm's expression because the query's output can vary dynamically as instances scale in or out.
To pinpoint the exact reason for the validation error.
3
Evaluate alternative solutions to achieve the desired monitoring setup.
To aggregate custom metrics across a dynamic fleet, the administrator should publish pre-aggregated metrics at the application level or use CloudWatch Metric Streams / Contributor Insights rather than a dynamic search alarm.
To resolve the monitoring requirement within CloudWatch limits.

Anahtar Kavram

CloudWatch Alarm limitations with Metric Math and SEARCH expressions
Bu soruyu puanla