Skip to content

feat(om2): relax the rules around unit and total suffixes #2677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

krajorama
Copy link
Member

@krajorama krajorama commented Jun 13, 2025

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama marked this pull request as ready for review June 13, 2025 12:25
@krajorama krajorama marked this pull request as draft June 16, 2025 06:35
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama
Copy link
Member Author

I agree with this comment from @beorn7 that the metric family name should be the same in the metadata and what we write in the metric(point)s.

# TYPE foo_total counter
# HELP foo_total A help string.
foo_total 42

or

# TYPE foo counter
# HELP foo A help string.
foo 42

but to be able to make a generic statement, we need these to be fixed:
prometheus/OpenMetrics#285 Created timestamp not exposed as "foo_create" anymore.
prometheus/OpenMetrics#283 Complex types for classic histograms and summaries.

Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

FWIW, prometheus/OpenMetrics#286 and prometheus/OpenMetrics#282 only ask for it to be allowed to not use suffixes. IMO the primary use-case for allowing the same name, but different unit and type is for federation-like endpoints (e.g. the prometheusexporter in the collector) where metric data from multiple applications is combined. We could require OTel SDK users to resolve naming collisions using views. I'm still OK with this change, but want to make sure we are clear on what the requirements from OTel are.

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.
MetricFamily names are a string and combined with the TYPE and UNIT MUST be unique within a MetricSet.

MetricFamily names SHOULD be uniq within a MetricSet. This rule relaxes the requirement in previous versions of OpenMetrics and is intended to facilitate exposing OpenTelemetry data model. For other use cases it is highly recommended to continue to adhere to this rule.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
MetricFamily names SHOULD be uniq within a MetricSet. This rule relaxes the requirement in previous versions of OpenMetrics and is intended to facilitate exposing OpenTelemetry data model. For other use cases it is highly recommended to continue to adhere to this rule.
MetricFamily names SHOULD be unique within a MetricSet. This rule relaxes the requirement in previous versions of OpenMetrics and is intended to facilitate exposing OpenTelemetry data model. For other use cases it is highly recommended to continue to adhere to this rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants