# Kubernetes.deployment.name missing after metricbeat upgrade

**URL:** <https://discuss.elastic.co/t/kubernetes-deployment-name-missing-after-metricbeat-upgrade/379565>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [June 27, 2025, 1:43pm UTC](https://discuss.elastic.co/t/kubernetes-deployment-name-missing-after-metricbeat-upgrade/379565 "2025-06-27T13:43:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_Finnman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erik_finnman/32/143886_2.png) [@Erik\_Finnman](https://discuss.elastic.co/u/Erik_Finnman)\
**Post date:** [June 27, 2025, 1:43pm UTC](https://discuss.elastic.co/t/kubernetes-deployment-name-missing-after-metricbeat-upgrade/379565/1 "2025-06-27T13:43:02Z")

</div>

Hi,  
we recently updated our Kubernetes version to 1.30.10 (running in AKS) and noticed that metricbeat was starting to get authentication issues after 1 hour.

I found this issue [metricbeat runs happily for a while and then starts getting 401 errors when fetching metrics · Issue #42307 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/42307) and after upgrading metricbeat to 8.15.4 the issue went away.

After this update, however, we noticed that the field `kubernetes.deployment.name` was no longer being populated in most of our metrics.

I found this issue [Fix Metricbeat k8s metadata sometimes not being present at startup by swiatekm · Pull Request #41216 · elastic/beats · GitHub](https://github.com/elastic/beats/pull/41216) which was included in the release notes for 8.15.4, so I naturally thought this was the issue.

But this did not help - further digging showed that `kubernetes.deployment.name` was indeed being set for the `state_*` metrics (like `state_deployment`), but not in e.g. `container` or `pod` metrics.

I have read up on the `add_kubernetes_metadata` processor, but even with this enabled the field does not get set. And the more I read about this metadata, the less I understand how this could work in the 8.5.1 version we were using before, since we did not use that processor at all.

I have compared the fields in the metricset for 8.5.1 [Kubernetes pod metricset | Metricbeat Reference [8.5] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/8.5/metricbeat-metricset-kubernetes-pod.html) with the version we upgraded to and `kubernetes.deployment.name` is not a part of that set. So I'm also really curious were this field get set?

Are there any permission changes that could have caused this? Seems a bit unlikely since we do get the field on all the `state_*` metrics.

Any input/suggestions would be most welcome.

---

<div class="post-metadata">

**Author:** ![Erik\_Finnman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erik_finnman/32/143886_2.png) [@Erik\_Finnman](https://discuss.elastic.co/u/Erik_Finnman)\
**Post date:** [July 2, 2025, 12:00pm UTC](https://discuss.elastic.co/t/kubernetes-deployment-name-missing-after-metricbeat-upgrade/379565/2 "2025-07-02T12:00:29Z")

</div>

So after some more digging I discovered that the `kubernetes.deployment.name` had been intentionally removed in Beats version 8.11.0 to fix this issue: [[8.11] Updating elastic-autodiscovery version to 0.6.4 by gizas · Pull Request #36879 · elastic/beats · GitHub](https://github.com/elastic/beats/pull/36879)

But I cannot for the life of me understand how to configure metricbeat to get these fields back. Like I wrote above, I've tried using the `add_kubernetes_metadata` processor, but using debug logging in metricbeat I can see that it doesn't seem to be taken into account:  
`Skipping add_kubernetes_metadata processor as kubernetes metadata already exist`

How should metricbeat be configured to get these fields back?
