Skip to content

docs: Issue with "Histograms and summaries" #3068

Open

Description

@colinpaicemq

Page: https://prometheus.io/docs/practices/histograms/

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.

Activity

  1. machugram commented on Oct 20, 2026

    @machugram

    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.

  2. colinpaicemq commented on Oct 22, 2026

    @colinpaicemq
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions