You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue:
I have been trying to display otel histogram data in prometheus.
I don't know the best way of displaying the information so it is clear when there is a problem.
I thought one way would be to display the percentage of figures in each bucket
I tried sum(rate(traces_span_metrics_duration_milliseconds_bucket[1m])) by (le)
/
sum(rate(traces_span_metrics_duration_milliseconds_count[1m])) * 100
but that produces no data
I tried sum(rate(traces_span_metrics_duration_milliseconds_bucket[1m])) by (le)
/
sum(rate(traces_span_metrics_duration_milliseconds_bucket{le="+Inf"[1m])) * 100
but this also produces no data.
It would be great if you could give some examples of promql queries to plot histogram data, in histogram, or heatmap pictures.
My data is from OTEL so I have records from about 20 spans .... each with a LE histogram. I'd like to know the best way to display this data as well.
Hi @colinpaicemq, both queries return nothing because of vector matching: the left side keeps an le label and the right side has none, so the division finds no matching series. Ignoring le fixes it:
sum by (le) (rate(traces_span_metrics_duration_milliseconds_bucket[5m]))
/ ignoring(le) group_left
sum(rate(traces_span_metrics_duration_milliseconds_count[5m])) * 100
(The second query is also missing a } after le="+Inf".) Buckets are cumulative, so this is "% of spans ≤ le". For percentiles use histogram_quantile(0.95, sum by (le) (rate(..._bucket[5m]))), and for heatmaps see the "Visualizing histograms" section of this page, which links Grafana/Perses.
This looks more like a usage question than a docs bug, so https://prometheus.io/community/ is a good place for follow-ups, and I think this can be closed.
Activity
machugram commentedon Oct 20, 2026
Hi @colinpaicemq, both queries return nothing because of vector matching: the left side keeps an
lelabel and the right side has none, so the division finds no matching series. Ignoringlefixes it:(The second query is also missing a
}afterle="+Inf".) Buckets are cumulative, so this is "% of spans ≤ le". For percentiles usehistogram_quantile(0.95, sum by (le) (rate(..._bucket[5m]))), and for heatmaps see the "Visualizing histograms" section of this page, which links Grafana/Perses.This looks more like a usage question than a docs bug, so https://prometheus.io/community/ is a good place for follow-ups, and I think this can be closed.
colinpaicemq commentedon Oct 22, 2026