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?
- AUpdate 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.
- 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
- CCreate an Amazon EventBridge rule that triggers an AWS Systems Manager Automation document every 14 days to purge the performance log group.
- DEnable 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
Key Concept
Configuring log group retention settings to manage CloudWatch Logs storage costs for Container Insights performance logs.