Skip to content

fix: restore OM1/protobuf micrometer suffix compatibility#2093

Closed
zeitlinger wants to merge 8 commits intoprometheus:mainfrom
zeitlinger:feat/micrometer-compat-task
Closed

fix: restore OM1/protobuf micrometer suffix compatibility#2093
zeitlinger wants to merge 8 commits intoprometheus:mainfrom
zeitlinger:feat/micrometer-compat-task

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented May 4, 2026

Fixes #2095

Summary

Restores OM1/protobuf compatibility for dotted gauge names after
feat: move suffix handling to scrape time (#1955).

The bug was that non-OpenMetrics exposition changed visible output for gauge
names that merely ended in suffix-like dotted strings such as .created and
.total.

Examples:

  • Gauge("test3.created") regressed from test3 to test3_created
  • Gauge("test6.total") regressed from test6 to test6_total

This PR restores the legacy OM1/protobuf behavior while keeping OpenMetrics on
literal-name handling.

What changed

  • Fix OM1 text exposition for dotted gauge names ending in .created and
    .total
  • Fix protobuf exposition for the same compatibility cases
  • Add regression tests that cover the restored OM1/protobuf behavior and the
    preserved OpenMetrics behavior
  • Add downstream Micrometer compatibility tasks and workflow so this class of
    regression is exercised automatically against Micrometer
  • Pin the downstream Micrometer target to an immutable commit SHA so PR CI is
    deterministic

Related Micrometer work

While debugging this, we also found a separate Micrometer adapter bug:
registration-time collision detection needed snapshot-derived
MultiCollector metadata.

That fix lives on the downstream Micrometer branch used by the compatibility
job. The Micrometer coverage added here is regression protection; the prom-side
bug fix in this PR is the OM1/protobuf suffix compatibility restoration.

Related

Test plan

  • mise run build
  • mise run lint
  • ./mvnw test -pl prometheus-metrics-exposition-textformats,prometheus-metrics-exposition-formats -Dtest=ExpositionFormatsTest,ProtobufExpositionFormatsTest -Dcoverage.skip=true -Dcheckstyle.skip=true
  • GRADLE_USER_HOME=/tmp/gradle-micro ./gradlew --no-daemon -I /tmp/micrometer-prom-local.init.gradle :micrometer-registry-prometheus:test --tests io.micrometer.prometheusmetrics.PrometheusMeterRegistryTest
  • GRADLE_USER_HOME=/tmp/gradle-micro ./gradlew --no-daemon -I /tmp/micrometer-prom-local.init.gradle :micrometer-registry-prometheus:test

@zeitlinger zeitlinger force-pushed the feat/micrometer-compat-task branch from 6af46e5 to ffaa66f Compare May 4, 2026 11:33
@zeitlinger zeitlinger changed the title feat: add micrometer downstream compatibility tasks fix: restore OM1/protobuf micrometer suffix compatibility May 5, 2026
Comment thread mise.toml

[env]
FLINT_CONFIG_DIR = ".github/config"
MICROMETER_REPOSITORY = "zeitlinger/micrometer"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

don't merge that!

zeitlinger added 8 commits May 5, 2026 15:03
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger
Copy link
Copy Markdown
Member Author

Superseded by a split PR stack so the prom-side fix can merge independently:

Closing this combined PR in favor of those two replacements.

@zeitlinger
Copy link
Copy Markdown
Member Author

Closing in favor of #2100 plus the stacked Micrometer follow-up at zeitlinger#1.

@zeitlinger zeitlinger closed this May 5, 2026
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.

bug: restore OM1/protobuf suffix compatibility after #1955

1 participant