Skip to content
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

Clarify how metric metadata and type suffixes are handled #2440

Merged
merged 4 commits into from
Mar 29, 2022

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Mar 24, 2022

Fixes #2437

Changes

Explicitly call out how to handle prometheus metric metadata and OTLP metric metadata. Most of this was implicit, but this makes it more explicit. This PR also clarifies that _total suffixes are trimmed from metrics, which is already the case in the collector.

It proposes the following changes from the current state:

Unit suffixes are required by the OpenMetrics spec

cc @aabmass @legendecas @jmacd @Aneurysm9

@dashpole dashpole requested review from a team March 24, 2022 18:58
specification/metrics/datamodel.md Outdated Show resolved Hide resolved
Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM, there might be some corner cases such as https://github.com/open-telemetry/opentelemetry-specification/pull/2440/files#r834957165 but I guess it's probably a rare case.

specification/metrics/datamodel.md Outdated Show resolved Hide resolved
Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

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

Does this need to specify how to handle metrics with the '_created' suffix?

@dashpole
Copy link
Contributor Author

Does this need to specify how to handle metrics with the '_created' suffix?

I noticed that when I looked through the spec as well. IIUC, that would give us the start timestamp of the metric, which would be helpful. I still need to think through how to use it (e.g. will we generate an additional metric with a _count suffix in exporters even if the scraped metric didn't have one?).

@reyang reyang added spec:metrics Related to the specification/metrics directory area:data-model For issues related to data model labels Mar 29, 2022
@reyang
Copy link
Member

reyang commented Mar 29, 2022

Does this need to specify how to handle metrics with the '_created' suffix?

I noticed that when I looked through the spec as well. IIUC, that would give us the start timestamp of the metric, which would be helpful. I still need to think through how to use it (e.g. will we generate an additional metric with a _count suffix in exporters even if the scraped metric didn't have one?).

This can be followed up in a separate PR if it turns out to be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:data-model For issues related to data model spec:metrics Related to the specification/metrics directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define OTLP -> Prometheus metric name conversion rule
8 participants