# Visualize Prometheus Metrics From Metricbeats

**URL:** https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893
**Category:** Kibana
**Created:** [August 30, 2020, 8:05pm UTC](https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893 "2020-08-30T20:05:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Karl\_Falconer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_falconer/32/74795_2.png) [@Karl\_Falconer](https://discuss.elastic.co/u/Karl_Falconer)
#### Post date: [August 30, 2020, 8:05pm UTC](https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893/1 "2020-08-30T20:05:46Z")

</div>

Hi,

We are evaluating migrating from Grafana to Kibana, we have metricbeats sending prometheus data to be Elastic to be indexed. I am having trouble creating a visualization on a pre-aggregated count field. Below is a data example:

```
timestamp count state
15:47:38.503	### A
15:47:38.503	### B
15:47:38.503	### C
15:47:28.503	### A
15:47:28.503	### B
15:47:28.503	### C

```

So the count field is the number of records in that state. Data is reported every 10 seconds. So I am trying to create a Line graph for each state over time. I am not able to create buckets such that the Y axis is using the field value instead of the number of documents over the 30 seconds Timestamp histogram.

---

<div class="post-metadata">

### Author: ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)
#### Post date: [August 31, 2020, 11:08am UTC](https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893/2 "2020-08-31T11:08:47Z")

</div>

You can use a `sum` aggregation that in your use case will just use count value if you use a date histogram with a 10 seconds interval, or it will sum up all the counts correctly (supposing that the count isn't an incremental counter)

---

<div class="post-metadata">

### Author: ![Karl\_Falconer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_falconer/32/74795_2.png) [@Karl\_Falconer](https://discuss.elastic.co/u/Karl_Falconer)
#### Post date: [August 31, 2020, 1:07pm UTC](https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893/3 "2020-08-31T13:07:10Z")

</div>

Marco,

Thanks for response, but I guess I am still doing something wrong. See the chart generated:

 ![Elastic](https://us1.discourse-cdn.com/elastic/original/3X/d/8/d8ab5d9665159c2a0bbdd760e8cb18928c941e72.png)

For reference, I am expecting 1.5K delayed, and looking for one instance of each state

---

<div class="post-metadata">

### Author: ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)
#### Post date: [August 31, 2020, 1:16pm UTC](https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893/4 "2020-08-31T13:16:29Z")

</div>

You probably don't need to split your series again on the `prometheus.metrics.task_count`, just remove that bucket from the `Buckets` list and you should be fine.  
`Metrics` are your Y axis values, where `Buckets` are your X axis values, here you just need to split your series by the `state` value and by time you are done.

---

<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: [September 28, 2020, 1:16pm UTC](https://discuss.elastic.co/t/visualize-prometheus-metrics-from-metricbeats/246893/5 "2020-09-28T13:16:46Z")

</div>

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