An administrator wants to count database connection timeout errors in an application's logs using Amazon CloudWatch. The administrator sets up a metric filter on the log group to scan for the term 'Timeout' and configures a metric transformation to publish a value of for each occurrence.
Which additional action is necessary to trigger a notification when the frequency of timeout errors exceeds a specific threshold?
- AConfigure an Amazon EventBridge rule that monitors the status of the metric filter directly to send the notification.
- BEnable detailed monitoring on the application log group to aggregate the log metrics at a -minute interval.
- Create a CloudWatch alarm based on the new custom metric, and configure an Amazon SNS action to send the notification.Answer
- DSet the retention policy of the log group to a custom threshold to force metric delivery to SNS.
Answer
Create a CloudWatch alarm based on the new custom metric, and configure an Amazon SNS action to send the notification.
The correct answer is to create a CloudWatch alarm based on the new custom metric, and configure an Amazon SNS action. Metric filters parse logs and output metrics, but do not possess alerting capabilities. A CloudWatch alarm must monitor the metric and trigger an SNS topic to notify administrators when thresholds are exceeded.
Step-by-Step Solution
Key Concept
CloudWatch metric filters define how log data is converted into metrics, while CloudWatch alarms monitor those metrics and initiate notifications or scaling actions.