Allow using double-underscores for federation#2839
Open
dashpole wants to merge 1 commit intoprometheus:mainfrom
Open
Allow using double-underscores for federation#2839dashpole wants to merge 1 commit intoprometheus:mainfrom
dashpole wants to merge 1 commit intoprometheus:mainfrom
Conversation
Signed-off-by: David Ashpole <dashpole@google.com>
bwplotka
reviewed
Feb 11, 2026
| Labels are key-value pairs consisting of strings. | ||
|
|
||
| Label names beginning with two underscores are RESERVED and MUST NOT be used unless specified by this standard. Label names SHOULD follow the restrictions in the ABNF section under the `label-name` section. Label names MAY be any quoted escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics is still experimental and may reduce usability. | ||
| Label names beginning with two underscores are RESERVED for use for metric metadata. Label names beginning with two underscores MAY be used in cases where metrics could have conflicting metadata, such as federation, but MUST NOT be used otherwise. Label names SHOULD follow the restrictions in the ABNF section under the `label-name` section. Label names MAY be any quoted escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics is still experimental and may reduce usability. |
Member
There was a problem hiding this comment.
Suggested change
| Label names beginning with two underscores are RESERVED for use for metric metadata. Label names beginning with two underscores MAY be used in cases where metrics could have conflicting metadata, such as federation, but MUST NOT be used otherwise. Label names SHOULD follow the restrictions in the ABNF section under the `label-name` section. Label names MAY be any quoted escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics is still experimental and may reduce usability. | |
| Label names beginning with two underscores are RESERVED and MUST NOT be used unless specified by this standard. Such Label names MAY be used in cases where MetricFamilies' metadata might otherwise be conflicting, such as a federation cases. | |
| Label names SHOULD follow the restrictions in the ABNF section under the `label-name` section. Label names MAY be any quoted escaped UTF-8 string as described in the ABNF section. Be aware that exposing UTF-8 metrics may reduce usability. |
- We intent to be able to unblock federation cases as follows:
# HELP metric1 some help
metric1{__type...=a}
metric1{__type...=b}
We don't know the exact solution, but we want to experiment.
bwplotka
reviewed
Feb 11, 2026
Member
bwplotka
left a comment
There was a problem hiding this comment.
Good enough for rc.0 mod suggestion
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.
Fixes prometheus/OpenMetrics#280
The language is modeled after the language for colons in metric names (which also have a particular use-case):
I would prefer not having too many details (e.g. which metadata, or what the exact label names are) to give us flexibility around which metadata can be added as labels with double-underscore. I don't want to standardize the labels, but I do want to carve out that double-underscore can be used for metadata in limited scenarios.