Question

Difficulty: MediumCloudWatch Dashboards and Container Insights

A company uses Amazon EKS on Amazon EC2 worker nodes to run its microservices. A SysOps Administrator enables Amazon CloudWatch Container Insights on the cluster to monitor performance. After a month, the Administrator notices a significant increase in the AWS bill due to CloudWatch Logs storage costs. The logs are stored in the /aws/containerinsights/{cluster-name}/performance log group with the default retention setting. The Administrator needs to ensure that these logs are retained for only 14 days to reduce ongoing costs. What is the most administratively efficient way to implement this change?

  1. A
    Update the CloudWatch agent DaemonSet configuration map (configmap) in the Amazon EKS cluster to set the log retention parameter to 14 days, and restart the DaemonSet.
  2. Modify the retention setting of the /aws/containerinsights/{cluster-name}/performance log group directly in the CloudWatch Logs console or via the AWS CLI to 14 days.Answer
  3. C
    Create an Amazon EventBridge rule that triggers an AWS Systems Manager Automation document every 14 days to purge the performance log group.
  4. D
    Enable CloudWatch detailed monitoring on the cluster's EC2 worker nodes, and set the metric retention period to 14 days in the CloudWatch dashboard settings.

Answer

Modify the retention setting of the /aws/containerinsights/{cluster-name}/performance log group directly in the CloudWatch Logs console or via the AWS CLI to 14 days.
Performance logs for Container Insights on Amazon EKS are stored in CloudWatch Logs in a log group named /aws/containerinsights/{cluster-name}/performance. Modifying the retention period of the log group itself is the most direct and efficient method to automatically expire older logs.

Step-by-Step Solution

1
Locate the performance log group generated by Container Insights in the Amazon CloudWatch console.
The log group is identified as /aws/containerinsights/{cluster-name}/performance.
Container Insights stores EKS performance telemetry in this specific log group.
2
Modify the retention setting of the identified log group.
The retention period is changed from the default 'Never expire' to '14 days'.
This updates the log group metadata in CloudWatch Logs to automatically prune log events older than 14 days, minimizing storage costs.

Key Concept

Configuring log group retention settings to manage CloudWatch Logs storage costs for Container Insights performance logs.
Rate this question