| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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>
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>
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>
| Back | FazBrowse Home | New Git URL |
Summary
Moves metric name suffix handling (_total, _info, unit suffixes) from creation time to scrape time. Closes #1941, part of #1942.
Key changes
Key table
Test plan