Skip to content

Allow using double-underscores for federation#2839

Open
dashpole wants to merge 1 commit intoprometheus:mainfrom
dashpole:reserved_doubleunder
Open

Allow using double-underscores for federation#2839
dashpole wants to merge 1 commit intoprometheus:mainfrom
dashpole:reserved_doubleunder

Conversation

@dashpole
Copy link
Contributor

Fixes prometheus/OpenMetrics#280

The language is modeled after the language for colons in metric names (which also have a particular use-case):

Colons in MetricFamily names are RESERVED to signal that the MetricFamily is the result of a calculation or aggregation of a general purpose monitoring system.

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.

Signed-off-by: David Ashpole <dashpole@google.com>
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.
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Good enough for rc.0 mod suggestion

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.

OM 2.0: Handle different type and unit for the same metric family (related to __type__ and __unit__ labels)

2 participants