Skip to content

Conversation

krajorama
Copy link
Member

@krajorama krajorama commented Oct 2, 2025

This proposal only relaxes the rules on what is acceptable by ingestors. This allows non Prometheus systems to expose names without suffixes and still get processed.

The reason is that Prometheus strongly recommends using the _total and unit suffixes for usability and to avoid conflicting metric names.

Generally, to be transparent, this is a future compatibility ingestor breaking change guarded by the content negotiation that we decided (OM 2.0 WG) to proceed with this, because many implementations already do this (and some cases require for OM to be useful).

bwplotka
bwplotka previously approved these changes Oct 2, 2025
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.

Look good, added some suggestions.

Generally, to be transparent, this is a future compatibility ingestor breaking change guarded by the content negotiation that we decided (OM 2.0 WG) to proceed with this, because many implementations already do this (and some cases require for OM to be useful).

@krajorama can we add following statement to the commit/PR for clarity (if you agree with the content)


The name of a MetricFamily MUST NOT result in a potential clash for sample metric names as per the ABNF with another MetricFamily in the Text Format within a MetricSet. An example would be a gauge called "foo_created" as a counter called "foo" could create a "foo_created" in the text format.

Ingestors MAY accept conflicting MetricFamily names, provided that there is a mechanism to distinguish the resulting MetricPoints. It follows that ingestors MAY accept MetricFamily name without the type specific suffix.
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
Ingestors MAY accept conflicting MetricFamily names, provided that there is a mechanism to distinguish the resulting MetricPoints. It follows that ingestors MAY accept MetricFamily name without the type specific suffix.
Ingestors MAY accept conflicting MetricFamily names, especially resulting from the MetricFamily names without the type or unit specific suffix (see [MetricFamily metadata](#MetricFamily-metadata)).


MetricFamily names are a string and MUST be unique within a MetricSet. Names SHOULD be in snake_case. Metric names MUST follow the restrictions in the ABNF section.

Ingestors MAY accept duplicate MetricFamily names, provided that either of HELP, TYPE, or UNIT is unique within the duplicated MetricFamily names. Notably Exposers MAY duplicate MetricFamilies when aggregating external metrics that have the same MetricFamily name, but come from different sources and have either different HELP, or TYPE, or UNIT. Be aware that exposing such metrics directly to end-users reduces usability due to confusion about which Metric belongs to which MetricFamily.
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we can still require metric family names to be unique within the text exposition format while being more tolerant of other naming. It properly places the burden of ensuring unique metric family names on the exposers that choose to deviate from naming recommendations (e.g. OTel SDKs), and doesn't impose an additional burden on Ingestors.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would you say that's the OpenTelemetry use case? To put the burden on exposer? Would that be enough for OM 1.1?

Tolerating non-unique metric family names comes from the federation, push-gateway and similar use cases. We could discard these use cases in OM 1.1 and only discuss for OM 2.0. I'm not opposed to that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that would meet the OpenTelemetry use-case. IMO non-unique metric family names seems more disruptive than other changes we've been discussing, so I would prefer punting that to OM 2.0. But I don't have a good sense of how important the federation, push-gateway use-cases are, so i'm open to other opinions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not allowing federation/push-gateway isn't a regression, it has always been the case. I'll remove these additions from the PR.

This proposal only relaxes the rules on what is acceptable by ingestors.
This allows non Prometheus systems to expose names without suffixes and
still get processed.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama force-pushed the krajo/om1.1-relax-suffix-alt1 branch from 315b71d to 5e762e6 Compare October 3, 2025 07:17
@krajorama
Copy link
Member Author

On further reflection, making the relaxed rule only apply to the ingestor is a bad idea as that would mean that different ingestors would treat the same text differently . Meaning that for example if a developer exposed a metric without the _total suffix and tested it with a lenient ingestor , they would not notice that it will fail for others.

Superseded by #2750

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.

4 participants