aws-samples / amazon-cloudwatch-container-insights

CloudWatch Agent Dockerfile and K8s YAML templates for CloudWatch Container Insights.
MIT No Attribution
163 stars 107 forks source link

Code does not support CW logs retention #89

Closed hd-sharma closed 2 years ago

hd-sharma commented 2 years ago

I have installed CloudWatch Container Insights per the cwagent-fluentd-quickstart

But this code does not support CloudWatch logs retention policy.

Is there any repo or code which supports retention code for CW logs?

SaxyPandaBear commented 2 years ago

Note that support for FluentD is deprecated as per public documentation: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs.html

Container Insights Support for FluentD is now in maintenance mode, which means that AWS will not provide any further updates for FluentD and that we are planning to deprecate it in near future. Additionally, the current FluentD configuration for Container Insights is using an old version of the FluentD Image fluent/fluentd-kubernetes-daemonset:v1.7.3-debian-cloudwatch-1.0 which does not have the latest improvement and security patches. For the latest FluentD image supported by the open source community, see fluentd-kubernetes-daemonset.

We strongly recommend that you migrate to use FluentBit with Container Insights whenever possible. Using FluentBit as the log forwarder for Container Insights provides significant performance gains.

For more information, see Set up Fluent Bit as a DaemonSet to send logs to CloudWatch Logs and Differences if you're already using Fluentd.

I would suggest using Fluent Bit instead. Here is another example YAML in this repo that sets up Fluent Bit. You can look at the CloudWatch plugin documentation for how to modify the configurations in the YAML to supply log retention