# Visualizing Prometheus Histogram

**URL:** https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668
**Category:** Kibana
**Created:** [March 29, 2021, 2:32pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668 "2021-03-29T14:32:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![waczi](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@waczi](https://discuss.elastic.co/u/waczi)
#### Post date: [March 29, 2021, 2:32pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/1 "2021-03-29T14:32:53Z")

</div>

Hi,

which type of aggregation should I use for the Prometheus Histogram Metrics generated like shown below.

 ![Kibana](https://us1.discourse-cdn.com/elastic/original/3X/3/9/39683d7fa1fca2d8194e0a952c62fc5f596f6b99.jpeg)

I would like to sum count and values arrays, for given time period, and then based on that create histogram visualization, is it possible?

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [March 29, 2021, 3:29pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/2 "2021-03-29T15:29:20Z")

</div>

Hi, welcome to the forums! Yes, this is possible in newer versions of the stack. Every visualization supports this in the latest version, 7.12

The earliest support was added in 7.7 to aggregation-based visualizations. TSVB got support in 7.9, and Lens got support in 7.12

---

<div class="post-metadata">

### Author: ![waczi](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@waczi](https://discuss.elastic.co/u/waczi)
#### Post date: [March 29, 2021, 9:17pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/3 "2021-03-29T21:17:15Z")

</div>

For the version 7.7 which type od visualization supports it? Can you provide some example that covers metrics that I posted?

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [March 29, 2021, 10:29pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/4 "2021-03-29T22:29:39Z")

</div>

Like I said, it's the aggregation-based visualizations- it's easier to describe it as anything without a specific name, so all the visualizations _except_ Lens, TSVB, Vega, Timelion. For example the "bar chart" aggregated visualization can use this.

---

<div class="post-metadata">

### Author: ![waczi](https://avatars.discourse-cdn.com/v4/letter/w/e47c2d/32.png) [@waczi](https://discuss.elastic.co/u/waczi)
#### Post date: [March 30, 2021, 9:04am UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/5 "2021-03-30T09:04:44Z")

</div>

Ok, so based on the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html#search-aggregations-metrics-sum-aggregation-histogram-fields), when I would like to create for example Sum aggregation on histogram data field I should be able to choose "histogram" object as an field, but when I'm trying to do that, I can only choose "values" or "count", like shown on the screenshot below.

 ![Elastic_issue](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a9456ff364c8b50c5974733ac560ab001330b34b.png)

I've also made sure about the Kibana version and it looks like I'm using 7.7.0.

 ![Elastic_issue_2](https://us1.discourse-cdn.com/elastic/original/3X/6/5/65b67250c983db3132e72aadaeb964c01d52cab9.jpeg)

Any thoughts on that?

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [March 30, 2021, 2:40pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/6 "2021-03-30T14:40:19Z")

</div>

Your screenshot shows that you have not mapped this as a `Histogram` using Elasticsearch's histogram type. This will limit your ability to perform some functions that require it to be mapped as a `Histogram`, but for Sum you can sum up the values. For count you can take the sum of counts.

Here are the instructions to [change a mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#updating-field-mappings) by creating a new index.

Here is the docs on the [histogram mapping type](https://www.elastic.co/guide/en/elasticsearch/reference/current/histogram.html)

---

<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 27, 2021, 2:40pm UTC](https://discuss.elastic.co/t/visualizing-prometheus-histogram/268668/7 "2021-04-27T14:40:33Z")

</div>

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