Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prometheus/client_java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: prometheus/client_java
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: scrape-time-suffix-handling
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 32 files changed
  • 1 contributor

Commits on Mar 17, 2026

  1. feat: Add OpenMetrics2 enabled flag for explicit OM2 writer activation

    The OM2 writer selection previously activated when any feature flag was
    set, but there was no way to just enable OM2 without opting into a
    specific feature. This adds an explicit `enabled` gate
    (io.prometheus.openmetrics2.enabled) as the single control for OM2
    writer selection. Feature flags alone no longer activate OM2.
    
    The programmatic `enableOpenMetrics2()` configurator sets enabled=true
    implicitly, matching its name.
    Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
    zeitlinger committed Mar 17, 2026
    Configuration menu
    Copy the full SHA
    0517886 View commit details
    Browse the repository at this point in the history
  2. feat: move suffix handling to scrape time with OTel preserve_names

    Move metric name suffix handling (_total, _info, unit suffixes) from
    creation time to scrape time. Each format writer now owns its suffix
    conventions:
    
    - OM1: smart-appends suffixes (skip if already present)
    - OTel: legacy path strips _total + unit; preserve_names=true passes
      names through exactly as the user wrote them
    - Registry detects cross-format name collisions at registration time
    
    Key changes:
    - Remove all reserved metric name suffixes from PrometheusNaming
    - Store original user-provided name separately from exposition base
      name in MetricMetadata (originalName vs expositionBaseName)
    - Add preserve_names config to ExporterOpenTelemetryProperties
    - Smart-append logic in OM1/protobuf writers for _total and _info
    - Two-layer collision detection in PrometheusRegistry
    
    Closes #1941
    Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
    zeitlinger committed Mar 17, 2026
    Configuration menu
    Copy the full SHA
    e95d408 View commit details
    Browse the repository at this point in the history
  3. feat: OM2 writer outputs names as provided, no suffix appending

    The OM2 writer now uses expositionBaseName instead of appending
    _total (counters) or unit suffixes. The _info suffix is enforced
    per the OM2 spec (MUST). Tests updated to verify OM2-specific
    output rather than asserting identity with OM1.
    Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
    zeitlinger committed Mar 17, 2026
    Configuration menu
    Copy the full SHA
    9ebf25a View commit details
    Browse the repository at this point in the history
Loading