Skip to content

Allow multiple exemplars on counters and histograms#2838

Merged
bwplotka merged 3 commits into
prometheus:mainfrom
dashpole:multiple_exemplars
Feb 24, 2026
Merged

Allow multiple exemplars on counters and histograms#2838
bwplotka merged 3 commits into
prometheus:mainfrom
dashpole:multiple_exemplars

Conversation

@dashpole

Copy link
Copy Markdown
Contributor

Fixes prometheus/OpenMetrics#311

Remove the restriction on having a single exemplar on counters. This matches PRW 2.0, OpenTelemetry, and makes exemplars more consistent between types.

While reading through exemplar language, I noticed the MUST requirement for histogram-bucket-aligned exemplars on fixed-bucket histograms. This relaxes (to SHOULD) the alignment of exemplars with histogram buckets. This is done because:

  • Consistency between types (counters, histograms, and native histograms support multiple exemplars without restrictions.
  • Reduces the amount of validation required by clients.
  • Allows native histograms and classic histograms to share exemplar sampling in Prometheus clients (when storing both types internally), without confining exemplars to the classic buckets.

Comment thread docs/specs/om/open_metrics_spec_2_0.md Outdated

@krajorama krajorama left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the ABNF (I can help)

Comment thread docs/specs/om/open_metrics_spec_2_0.md Outdated
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Comment thread docs/specs/om/open_metrics_spec_2_0.md

@krajorama krajorama left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread docs/specs/om/open_metrics_spec_2_0.md
@bwplotka bwplotka merged commit 081abf7 into prometheus:main Feb 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OM 2.0: All types MUST support multiple exemplars

3 participants