# How to Visualize Prometheus Histogram Percentiles in Kibana (Metricbeat to Elasticsearch)

**URL:** <https://discuss.elastic.co/t/how-to-visualize-prometheus-histogram-percentiles-in-kibana-metricbeat-to-elasticsearch/378890>\
**Category:** Kibana\
**Created:** [June 5, 2025, 5:41am UTC](https://discuss.elastic.co/t/how-to-visualize-prometheus-histogram-percentiles-in-kibana-metricbeat-to-elasticsearch/378890 "2025-06-05T05:41:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kanchan\_Karjee](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Kanchan\_Karjee](https://discuss.elastic.co/u/Kanchan_Karjee)\
**Post date:** [June 5, 2025, 5:41am UTC](https://discuss.elastic.co/t/how-to-visualize-prometheus-histogram-percentiles-in-kibana-metricbeat-to-elasticsearch/378890/1 "2025-06-05T05:41:54Z")

</div>

I'm using the Prometheus Metricbeat module to scrape `/metrics` endpoints from a Go service running in EKS, and ship the metrics to Elasticsearch. Everything works fine and the data is available in Kibana.

I'm particularly interested in visualizing response time percentiles based on **histogram** data emitted by the application. The histogram metrics are stored in Elasticsearch as multiple documents, one per bucket, with a `le` (less than or equal to) label. For example:

json

CopyEdit

```auto
{
  "_id": "dOcFZocBqL_gAwhbb8g5",
  "prometheus": {
    "labels": {
      "job": "prometheus",
      "api_latency_status": "Success",
      "api_latency_orgID": "1670749265",
      "le": "500",
      "instance": "<masked>:15020"
    },
    "metrics": {
      "api_latency_response_time_histogram_bucket": 14
    }
  }
}

```

json

CopyEdit

```auto
{
  "_id": "eecFZocBqL_gAwhbb8g6",
  "prometheus": {
    "labels": {
      "job": "prometheus",
      "api_latency_status": "Success",
      "api_latency_orgID": "1670749265",
      "le": "1000",
      "instance": "<masked>:15020"
    },
    "metrics": {
      "api_latency_response_time_histogram_bucket": 34
    }
  }
}

```

This means 14 events had response times ≤ 500ms, and 34 events had response times ≤ 1000ms—so 20 events fell between 500ms and 1000ms.

I want to know how to visualize percentiles like p50, p90, and p99 from this histogram data in Kibana (Lens or TSVB). Since the histogram is already bucketed by `le`, is there a way to compute percentiles using this format directly in Elasticsearch.

Any help or guidance would be appreciated.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 5, 2025, 5:45am UTC](https://discuss.elastic.co/t/how-to-visualize-prometheus-histogram-percentiles-in-kibana-metricbeat-to-elasticsearch/378890/2 "2025-06-05T05:45:18Z")

</div>

Hi @Kanchan_Karjee Welcome to the community.

Please share  
You Elasticsearch, Kibana and Metricbeat versions  
Please share the Metricbeat Prometheus module configuration

Also did you read this?

> **[Prometheus collector metricset | Elastic Documentation](https://www.elastic.co/docs/reference/beats/metricbeat/metricbeat-metricset-prometheus-collector#_histograms_and_types)**
>
> The Prometheus collector metricset scrapes data from prometheus exporters. To scrape metrics from a Prometheus exporter, configure the hosts field to...
