An application deployed on AWS Lambda writes execution logs to an Amazon CloudWatch Logs group. A SysOps Administrator needs to configure a metric filter and a CloudWatch alarm to track occurrences where a specific third-party integration named `StripePay` fails with a response time greater than .
A sample JSON log event from the application is:
{
"integrationName": "StripePay",
"status": "FAILED",
"responseTimeMs": 1250,
"errorCode": "GATEWAY_TIMEOUT"
}
Which of the following configuration options should the SysOps Administrator select to meet these requirements? (Select TWO.)
- Define a metric filter with the pattern `{ (.integrationName = "StripePay") && (.status = "FAILED") && ($.responseTimeMs > 1000) }`.Cevap
- Set the metric value in the metric transformation configuration to `1` to increment the metric count for each log event that matches the filter pattern.Cevap
- CConfigure the log group retention period to Never Expire to allow the metric filter to scan historical log data and backfill the custom metric.
- DEnable detailed monitoring on the Lambda function to increase the log ingestion frequency to CloudWatch Logs to 1-minute intervals.
- ECreate an Amazon EventBridge rule that monitors the custom metric namespace directly to trigger an AWS Systems Manager Automation runbook.
Cevap
To monitor the third-party failures, the administrator must define a metric filter with the JSON pattern checking for StripePay, FAILED status, and responseTimeMs greater than 1000, and set the metric transformation value to 1 to count the occurrences of matching events.
The correct options are defining the metric filter with the JSON pattern selecting StripePay, FAILED status, and response time greater than 1000, and setting the metric transformation value to 1. This ensures that every matching log event increments the count of the custom metric by 1 in real-time.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Logs Metric Filters analyze incoming log streams in real-time using pattern matching rules to publish custom CloudWatch metrics.