Skip to content

feat: Add OM2 native histogram text output#2042

Open
zeitlinger wants to merge 2 commits intoprometheus:mainfrom
zeitlinger:codex/om2-native-histograms
Open

feat: Add OM2 native histogram text output#2042
zeitlinger wants to merge 2 commits intoprometheus:mainfrom
zeitlinger:codex/om2-native-histograms

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

Summary

Adds OpenMetrics 2.0 text output for native histograms behind the nativeHistograms flag.

  • serializes native histogram fields (schema, zero_threshold, zero_count, native spans/buckets)
  • supports native gauge histograms with gcount/gsum
  • supports mixed native + classic histograms with classic bucket output last
  • emits all histogram exemplars on composite/native histogram samples
  • adds unit/integration coverage for native histogram content negotiation and edge cases

Validation

  • ./mvnw test -pl prometheus-metrics-exposition-textformats -Dtest=OpenMetrics2TextFormatWriterTest,ExpositionFormatsTest -Dcoverage.skip=true -Dcheckstyle.skip=true
  • mise run build

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger changed the title [codex] Add OM2 native histogram text output feant: Add OM2 native histogram text output Apr 23, 2026
@zeitlinger zeitlinger changed the title feant: Add OM2 native histogram text output feat: Add OM2 native histogram text output Apr 23, 2026
@zeitlinger zeitlinger marked this pull request as ready for review April 23, 2026 09:11
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.

1 participant