# \`kubernetes.volume.fs.used.pct\` has incorrect type in index template

**URL:** <https://discuss.elastic.co/t/kubernetes-volume-fs-used-pct-has-incorrect-type-in-index-template/290440>\
**Category:** Beats\
**Tags:** fleet, metricbeat\
**Created:** [November 29, 2021, 1:39pm UTC](https://discuss.elastic.co/t/kubernetes-volume-fs-used-pct-has-incorrect-type-in-index-template/290440 "2021-11-29T13:39:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lepouletsuisse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lepouletsuisse/32/97762_2.png) [@lepouletsuisse](https://discuss.elastic.co/u/lepouletsuisse)\
**Post date:** [November 29, 2021, 1:39pm UTC](https://discuss.elastic.co/t/kubernetes-volume-fs-used-pct-has-incorrect-type-in-index-template/290440/1 "2021-11-29T13:39:09Z")

</div>

It seems that field `kubernetes.volume.fs.used.pct` has an incorrect type in the index template `metrics-kubernetes.volume` (automatically generated by metricbeat or fleet).

The type specified by the template's mapping is `long`, while it is explicitly specified in the [Metricbeat exported field specification](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-kubernetes.html) that the field should be `scaled_float`.

The mapping specified in the metrics-kubernetes.volume index template:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5f6724a8b92aba37e3a1324b068eb46ed98af975.png)

The [Metricbeat specification about this exported field](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-kubernetes.html):  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/1/71ffe85eaef2c6ec970ecd0604c0a18d3c598050.png)

It doesn't make sense to use a Long as the values sent by Metricbeats are 0-1 range percentage, which leads Kibana to round all percentages to `0%`.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/5/f5c27981dac96dd2241b79119dde2fe7dd3144d6.png)

I'm using managed Elastic Fleet 7.15 and I retrieve Kubernetes metrics using the [Kubernetes integration (1.1.0)](https://docs.elastic.co/en/integrations/kubernetes) from Elastic Fleet.

Did I dramatically misunderstand the situation or is there a bug here? If this is a bug, do you see any solution for me to build charts based on volume percentage alternatively?

Kind regards

---

<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:** [November 30, 2021, 11:28am UTC](https://discuss.elastic.co/t/kubernetes-volume-fs-used-pct-has-incorrect-type-in-index-template/290440/2 "2021-11-30T11:28:10Z")

</div>

Hi lepouletsuisse! Thanks for pointing this out.  
This is indeed a bug and will be fixed in Kubernetes Integration 1.5.1 .  
`kubernetes.volume.fs.used.pct` is the result of `kubernetes.volume.fs.used.bytes` divided by `kubernetes.volume.fs.capacity.bytes`.

So meanwhile you can create a custom chart where you can represent the percentage with a Formula like

```auto
median(kubernetes.volume.fs.used.bytes)/median(kubernetes.volume.fs.capacity.bytes)

```

---

<div class="post-metadata">

**Author:** ![lepouletsuisse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lepouletsuisse/32/97762_2.png) [@lepouletsuisse](https://discuss.elastic.co/u/lepouletsuisse)\
**Post date:** [December 1, 2021, 9:26am UTC](https://discuss.elastic.co/t/kubernetes-volume-fs-used-pct-has-incorrect-type-in-index-template/290440/3 "2021-12-01T09:26:28Z")

</div>

Thank you very much!  
I'll try your solution to do my chart.

---

<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:** [December 29, 2021, 11:27am UTC](https://discuss.elastic.co/t/kubernetes-volume-fs-used-pct-has-incorrect-type-in-index-template/290440/4 "2021-12-29T11:27:26Z")

</div>

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