# Metricbeat unhappy with K8s kube-state-metrics labels

**URL:** <https://discuss.elastic.co/t/metricbeat-unhappy-with-k8s-kube-state-metrics-labels/222756>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [March 9, 2020, 3:46pm UTC](https://discuss.elastic.co/t/metricbeat-unhappy-with-k8s-kube-state-metrics-labels/222756 "2020-03-09T15:46:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jweite](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jweite](https://discuss.elastic.co/u/jweite)\
**Post date:** [March 9, 2020, 3:46pm UTC](https://discuss.elastic.co/t/metricbeat-unhappy-with-k8s-kube-state-metrics-labels/222756/1 "2020-03-09T15:46:24Z")

</div>

Hi all, I deployed metricbeat under Kubernetes and am getting warnings that I interpret to mean that Elasticsearch is unhappy with pod label attributes being sent for kube-state-metrics. More specifically, the "standard" deployment of kube-state-metrics labels its pods with [app.kubernetes.io/name:](http://app.kubernetes.io/name:) kube-state-metrics and [app.kubernetes.io/version:](http://app.kubernetes.io/version:) 1.9.5. But the dynamic\_templates that metricbeats create declare that kubernetes.labels.\* are keywords, and (AFAIK) can only accept string values for app, not the deeper structure being sent.

Here are some excerpts from the warning to clarify:

> 2020-03-06T22:17:24.947Z WARN elasticsearch/client.go:517 Cannot index event publisher.Event{  
> ...  
> "kubernetes":{"labels":{"app":{"kubernetes":{"io/name":"kube-state-metrics","io/version":"1.9.5"}}  
> ...  
> (status=400): {"type":"mapper\_parsing\_exception","reason":"failed to parse field [kubernetes.labels.app] of type [keyword] in document with id '6vLssXABJgDINP2ltFLH'","caused\_by":{"type":"illegal\_state\_exception","reason":"Can't get text on a START\_OBJECT at 1:570"}}

Anybody know if there are ways to cope with this in the metricbeat config? (Or do I have to change the standard labeling of this pod)?

Thanks,  
-Joe

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 6, 2020, 3:46pm UTC](https://discuss.elastic.co/t/metricbeat-unhappy-with-k8s-kube-state-metrics-labels/222756/2 "2020-04-06T15:46:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
