Don't interleave histogram metrics in multi-process collector by cjwatson · Pull Request #1148 · prometheus/client_python

@cjwatson

The OpenMetrics exposition format requires that samples for a given
Metric (i.e. metric name and label set) are not interleaved, but the way
that the multi-process collector handled accumulating histogram metrics
could end up interleaving them.  Restructure it slightly to guarantee
that all the samples for a given Metric are kept together.

Fixes: prometheus#1147

Signed-off-by: Colin Watson <cjwatson@debian.org>

csmarchbanks

approved these changes Nov 26, 2025

@cjwatson cjwatson deleted the interleaved-multiprocess-histogram-metrics branch

January 15, 2026 11:11