Skip to content

feat: Add OpenMetrics2 configuration support#1939

Open
jaydeluca wants to merge 1 commit intomainfrom
openmetrics2-part1
Open

feat: Add OpenMetrics2 configuration support#1939
jaydeluca wants to merge 1 commit intomainfrom
openmetrics2-part1

Conversation

@jaydeluca
Copy link
Collaborator

Part of #1912

Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds experimental OpenMetrics 2.0 configuration plumbing to the prometheus-metrics-config module so OM2 feature flags can be set via builder APIs and loaded from properties/env vars (as part of #1912).

Changes:

  • Introduce OpenMetrics2Properties with OM2 feature-flag fields, builder, and property loading.
  • Wire OM2 properties into PrometheusProperties and PrometheusPropertiesLoader.
  • Add/extend unit tests covering defaults, builder usage, enable-all, and property loading/error handling.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusPropertiesLoader.java Loads OpenMetrics2Properties and includes it in the assembled PrometheusProperties.
prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/PrometheusProperties.java Adds openMetrics2Properties field + getter and builder APIs (enableOpenMetrics2, direct assignment).
prometheus-metrics-config/src/main/java/io/prometheus/metrics/config/OpenMetrics2Properties.java New OM2 flag container with property parsing and builder (including enableAll()).
prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/PrometheusPropertiesTest.java Adds tests for OM2 builder patterns, defaults, and loading via PrometheusPropertiesLoader.
prometheus-metrics-config/src/test/java/io/prometheus/metrics/config/OpenMetrics2PropertiesTest.java New tests for OM2 property loading, invalid values, builder behavior, and defaults.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jaydeluca jaydeluca marked this pull request as ready for review March 6, 2026 20:48
@jaydeluca jaydeluca requested a review from zeitlinger March 6, 2026 20:48
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.

2 participants