# Filebeat - High CPU usage with kubernetes autodiscovery

**URL:** <https://discuss.elastic.co/t/filebeat-high-cpu-usage-with-kubernetes-autodiscovery/379605>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 30, 2025, 6:47am UTC](https://discuss.elastic.co/t/filebeat-high-cpu-usage-with-kubernetes-autodiscovery/379605 "2025-06-30T06:47:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [July 1, 2025, 3:46am UTC](https://discuss.elastic.co/t/filebeat-high-cpu-usage-with-kubernetes-autodiscovery/379605/2 "2025-07-01T03:46:45Z")

</div>

Hello @lorenzo_milicia

Welcome to the community.

I am not sure if below blog can be helpful & are related to the issue you are facing :

> [@Filebeat: "memory leak" via filebeat.autodiscover and \>\>200.000 goroutines](https://discuss.elastic.co/t/filebeat-memory-leak-via-filebeat-autodiscover-and-200-000-goroutines/322082/4):
>
> Thanks! The memory heaps look familiar indeed. Can you also remove the processor? The kubernetes provider is adding the metadata by default so you don't need the extra processor for this. C.

> <https://github.com/elastic/elastic-agent-autodiscover/issues/31>
>
> As reported at https://github.com/elastic/beats/issues/33307, the kubernetes aut…odiscovery provider can lead to OOM kills for Beats Pods in clusters with specific type of workloads, ie Cronjobs.
> 
> The purpose of this issue is the following:
> 
> 1. Consider making \`add\_resource\_metadata.cronjob: false\` the default since we know it's an "expensive" feature.
> 2. Document the nature of this setting and its implications
> 3. Consider improving the way we retrieve the objects or get the "owner" name by trimming the suffix of the Object's name ie: \`hello\` (the name of the cronjob) out of \`hello-1234\` (the name of the job).
> 
> For full context and previous analysis see the summary at https://github.com/elastic/beats/issues/33307#issuecomment-1290251145. 
> 
> cc: @eedugon @gizas @jsoriano

Thanks!!

---

_[View the full topic](https://discuss.elastic.co/t/filebeat-high-cpu-usage-with-kubernetes-autodiscovery/379605)._
