aws / amazon-cloudwatch-agent

CloudWatch Agent enables you to collect and export host-level metrics and logs on instances running Linux or Windows server.
MIT License
445 stars 204 forks source link

[k8s / EKS] Support for Filtering Metrics by Namespace/Pod Name in CloudWatch Agent #1170

Open Jasonnor opened 6 months ago

Jasonnor commented 6 months ago

Is your feature request related to a problem? Please describe.

I'm currently using CloudWatch Container Insights to monitor my k8s clusters. However, I've noticed that the cloudwatch-agent collects metrics from all pods, which increases my CloudWatch Observation Usage costs. In my use case, I want to focus on monitoring specific critical services rather than every pod in the cluster.

For example, I need to monitor pods in certain namespaces or specific pods (like those from a particular deployment) and exclude metrics from less critical ones, such as daemonsets or system pods.

Describe the solution you'd like

I would like the cloudwatch-agent to support filtering metrics based on the Kubernetes namespace and/or pod names. This feature would allow users to specify which namespaces or pods should be monitored, significantly reducing unnecessary metrics and, consequently, CloudWatch costs.

Describe alternatives you've considered

I can't think of an alternative currently.

Additional context

If anyone have any better ideas to reduce Observation costs, please let me know, thanks!

github-actions[bot] commented 3 months ago

This issue was marked stale due to lack of activity.

Jasonnor commented 3 months ago

I'm still interested in this issue.

dariodor commented 2 months ago

So am I