An organization deploys an application across four microservices hosted on Amazon ECS. Each microservice writes logs to its own dedicated CloudWatch Logs log group: `/aws/ecs/frontend`, `/aws/ecs/auth-service`, `/aws/ecs/catalog`, and `/aws/ecs/payment`. To maintain service-level agreements, a SysOps administrator must establish a mechanism to alert the team when the aggregate number of `HTTP 504` gateway timeout errors across all four microservices exceeds in any -minute period.
Which configuration should the administrator implement to meet this requirement?
- AEnable detailed monitoring on the ECS cluster. Create a single metric filter on a new log group named `/aws/ecs/aggregated` to capture all cluster-wide events, and configure a CloudWatch alarm to trigger if the metric exceeds within a -minute period.
- BCreate an Amazon EventBridge rule that matches `PutLogEvents` API calls containing `HTTP 504` error codes. Target an AWS Systems Manager Automation runbook that aggregates the event count in a custom Amazon DynamoDB table, and set up a CloudWatch alarm on the table's write capacity metrics.
- Define an identical metric filter on each of the four log groups using the same filter pattern, custom namespace, and metric name. Configure a single CloudWatch alarm on the aggregated metric using the Sum statistic over a -minute period with a threshold of .Cevap
- DSet the CloudWatch Logs retention period to 10 days for all log groups. Configure a metric filter at the log group prefix level of `/aws/ecs/` to automatically aggregate the error count, and define an alarm threshold of for the retention duration.
Cevap
Define an identical metric filter on each of the four log groups using the same filter pattern, custom namespace, and metric name. Configure a single CloudWatch alarm on the aggregated metric using the Sum statistic over a -minute period with a threshold of .
To aggregate metrics across multiple log groups in CloudWatch Logs, you must create a metric filter on each individual log group. By directing each filter's metric transformation to publish to the same custom namespace and metric name, CloudWatch automatically aggregates the metrics. Setting a CloudWatch alarm on the aggregated metric using the Sum statistic evaluates the cumulative value from all log groups over the specified duration.
Adım Adım Çözüm
Anahtar Kavram
Aggregating logs across multiple log groups using identical metric filter names/namespaces, and using the Sum statistic in a CloudWatch alarm.
Tahmini Süre:2m 30s