# How to avoid collecting metrics from some pods/containers in k8s

**URL:** <https://community.netdata.cloud/t/how-to-avoid-collecting-metrics-from-some-pods-containers-in-k8s/7834>\
**Category:** Help\
**Tags:** cloud, configuration, agent\
**Created:** [November 13, 2025, 8:35am UTC](https://community.netdata.cloud/t/how-to-avoid-collecting-metrics-from-some-pods-containers-in-k8s/7834 "2025-11-13T08:35:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_Diatlov](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/sergey_diatlov/32/4749_2.png) [@Sergey\_Diatlov](https://community.netdata.cloud/u/Sergey_Diatlov)\
**Post date:** [November 13, 2025, 8:35am UTC](https://community.netdata.cloud/t/how-to-avoid-collecting-metrics-from-some-pods-containers-in-k8s/7834/1 "2025-11-13T08:35:15Z")

</div>

We run over 4,000 cronjobs per day in AWS EKS, and the total number of metrics in the Netdata database is growing at a rate of 300,000 per day.  
How can I avoid collecting metrics from cronjob pods or filter them by pod name?

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [November 13, 2025, 9:32am UTC](https://community.netdata.cloud/t/how-to-avoid-collecting-metrics-from-some-pods-containers-in-k8s/7834/2 "2025-11-13T09:32:47Z")

</div>

Hi, @Sergey_Diatlov. Try adding to [Child netdata.conf](https://github.com/netdata/helmchart/blob/1a9a205757726556f93996d2f189a007b07145e1/charts/netdata/values.yaml#L310-L318) the following:

```auto
        [plugin:cgroups]
        enable by default cgroups names matching = !*cronjob* *

```

Note: You may need to replace `!*cronjob*` with a different pattern. Check your instance names and choose something unique to reliably exclude cron jobs.

 ![Screenshot 2025-11-13 at 11.31.11](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/2X/3/3e14b7c99fee8e5d0a033bd946a6e6dcf05e7b5b.png)

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [November 13, 2025, 9:34am UTC](https://community.netdata.cloud/t/how-to-avoid-collecting-metrics-from-some-pods-containers-in-k8s/7834/3 "2025-11-13T09:34:01Z")

</div>

I think we should disable collecting cronjobs by default. Thanks for raising this issue.

---

<div class="post-metadata">

**Author:** ![Sergey\_Diatlov](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/sergey_diatlov/32/4749_2.png) [@Sergey\_Diatlov](https://community.netdata.cloud/u/Sergey_Diatlov)\
**Post date:** [November 14, 2025, 8:51am UTC](https://community.netdata.cloud/t/how-to-avoid-collecting-metrics-from-some-pods-containers-in-k8s/7834/4 "2025-11-14T08:51:53Z")

</div>

Hi, @ilyam8. Thank you! It works
