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

prometheus: Ignore unknown instrument units #1348

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented Nov 7, 2023

Motivation

The metric unit semantic conventions suggest that integer counts should use annotations (e.g. {packet}), which breaks the current unit appending logic as they are not properly escaped.

Solution

Ignore unknown units (including annotations) as other language implementations currently do. This change also removes the $ mapping as it is not UCUM.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@jtescher jtescher requested a review from a team November 7, 2023 17:08
## Motivation

The [metric unit semantic conventions] suggest that integer counts
should use annotations (e.g. `{packet}`), which breaks the current unit
appending logic as they are not properly escaped.

[metric unit semantic conventions]: https:/open-telemetry/semantic-conventions/blob/v1.23.0/docs/general/metrics.md#instrument-units

## Solution

Ignore unknown units (including annotations) as other language
implementations currently do. This change also removes the `$` mapping
as it is not UCUM.
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
opentelemetry-prometheus/src/utils.rs 100.0% <100.0%> (ø)

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

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

hmm IIUC by doing so users can only use UCUM as instrument?

@jtescher
Copy link
Member Author

jtescher commented Nov 7, 2023

@TommyCpp yeah this seems to be the common choice currently (e.g. go, java, etc)

@jtescher jtescher merged commit 74d294c into open-telemetry:main Nov 8, 2023
15 checks passed
@jtescher jtescher deleted the ignore-unknown-units branch November 8, 2023 16:18
jtescher added a commit to jtescher/opentelemetry-rust-1 that referenced this pull request Nov 13, 2023
## Motivation

The [metric unit semantic conventions] suggest that integer counts
should use annotations (e.g. `{packet}`), which breaks the current unit
appending logic as they are not properly escaped.

[metric unit semantic conventions]: https:/open-telemetry/semantic-conventions/blob/v1.23.0/docs/general/metrics.md#instrument-units

## Solution

Ignore unknown units (including annotations) as other language
implementations currently do. This change also removes the `$` mapping
as it is not UCUM.
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.

2 participants