Open
Conversation
This was referenced Mar 17, 2026
This was referenced Mar 17, 2026
Collaborator
|
i accidentally commented on this one because it has a lot of the same changes as #1956 , is this separate? edit: just noticed the "blocked by" on the other PR, so I guess i did them out of order |
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) - 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) - 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>
e63ef43 to
0787661
Compare
Member
Author
no worries - I'll apply the feedback to the correct pr |
- Fix race condition: use putIfAbsent for atomic exposition name claiming with proper rollback on failure - Extract claimExpositionNames/releaseExpositionNames for single rollback path - Rename Info test methods to reflect that _info suffix is now allowed Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Member
Author
did that now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves metric name suffix handling (
_total,_info, unit suffixes)from creation time to scrape time. Closes #1941, part of #1942.
time
Key changes
PrometheusNamingname in
MetricMetadata(originalNamevsexpositionBaseName)_totaland_infoPrometheusRegistry(base name + exposition names)
Key table
Counter("events")events_totalCounter("events_total")events_totalCounter("req").unit(BYTES)req_bytes_totalCounter("req_bytes").unit(BYTES)req_bytes_totalGauge("events_total")events_totalPR stack
preserve_names(stacked on this)Test plan
mise run compilepassesMetricMetadata5-arg constructor andfield accessors
PrometheusRegistryTestcovers collision detectionPart of #1912.