# Metricbeat only sending some kube-state-metrics to elastic

**URL:** https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142
**Category:** Beats
**Tags:** metricbeat
**Created:** [December 16, 2021, 11:22am UTC](https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142 "2021-12-16T11:22:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bagdus](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bagdus](https://discuss.elastic.co/u/bagdus)
#### Post date: [December 16, 2021, 11:22am UTC](https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142/1 "2021-12-16T11:22:35Z")

</div>

Hello

I've been struggling with an issue i have with metricbeats kubernetes module. Specifically the processing of kube-state-metrics.

Versions:  
kube-state-metrics 2.2.4  
Metricbeat/ELK 7.15

**The issue:**  
Scraping of kube-state-metrics endpoint should produce _more metrics_ than it currently is. Elasticsearch dashboards expect stats on memory capacity and usage, but these aren't parsed from the kube-state-metrics endpoint. Only a small subset of data are parsed.

**Expected behavior**  
Lines from kube-state-metrics looking like this

```auto
kube_node_status_capacity{node="raspberrypi-3",resource="memory",unit="byte"} 8.19253248e+09
kube_node_status_allocatable{node="raspberrypi-3",resource="memory",unit="byte"} 8.19253248e+09

```

Should be parsed into a metric looking like this

```auto
			"memory": {
				"allocatable": {
					"bytes": 29448855552
				},
				"capacity": {
					"bytes": 29448855552
				}
			},

```

**Actual behavior**  
Only a few annotations/labels are sent to Elasticsearch, no memory or cpu metrics are sent. An example of what is sent is here:

```auto

    "node": {
      "status": {
        "unschedulable": false,
        "memory_pressure": "false",
        "disk_pressure": "false",
        "pid_pressure": "false",
        "ready": "true"
      },
      "name": "raspberrypi-3"
    },

```

**Steps taken so far:**

1. Pre-installed kube-state-metrics using prometheus community helm chart (since i run arm64 and need supported version for the platform which isn't included in the metricbeat helm chart).
2. Verified the endpoint exposes memory/cpu metrics.
3. Specify the endpoint in the following fashion in the metricbeat helm chart

```auto
 - module: kubernetes
        metricsets:
          - state_node
        period: 10s
        hosts: ["kube-state-metrics.kube-system:8080"]`

```

1. Verified the data flows as expected to elastic.
2. Debugged metricbeats deployment to see it does indeed not send memory capacity/usage data for a node to Elasticsearch. And no error is present in the log.

---

<div class="post-metadata">

### Author: ![Michalis\_Katsoulis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michalis_katsoulis/32/93500_2.png) [@Michalis\_Katsoulis](https://discuss.elastic.co/u/Michalis_Katsoulis)
#### Post date: [December 16, 2021, 12:05pm UTC](https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142/2 "2021-12-16T12:05:45Z")

</div>

Hi @bagdus.

Which exact version of Metricbeat are you using? Support for `kube-state-metrics` v2 was added in 7.15.1 and all newer versions.

> **[Beats version 7.15.1 | Beats Platform Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/beats/libbeat/7.15/release-notes-7.15.1.html)**

---

<div class="post-metadata">

### Author: ![bagdus](https://avatars.discourse-cdn.com/v4/letter/b/dfb087/32.png) [@bagdus](https://discuss.elastic.co/u/bagdus)
#### Post date: [December 16, 2021, 3:42pm UTC](https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142/3 "2021-12-16T15:42:03Z")

</div>

You're right @Michalis_Katsoulis ! I was using 7.15.0. I has completely overlooked this information.  
Since i needed to patch Shell4j i needed to update anyway to 7.16.1 and now it works.  
Wasted a lot of time here but still glad it was easily solved.

Thanks!

---

<div class="post-metadata">

### Author: ![Michalis\_Katsoulis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michalis_katsoulis/32/93500_2.png) [@Michalis\_Katsoulis](https://discuss.elastic.co/u/Michalis_Katsoulis)
#### Post date: [December 17, 2021, 12:50pm UTC](https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142/4 "2021-12-17T12:50:40Z")

</div>

You are welcome @bagdus . I am glad your problem is solved!

---

<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: [January 14, 2022, 2:51pm UTC](https://discuss.elastic.co/t/metricbeat-only-sending-some-kube-state-metrics-to-elastic/292142/5 "2022-01-14T14:51:15Z")

</div>

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