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 Compatibility] Reconsider 1 to ratio unit conversion #4058

Open
dashpole opened this issue May 23, 2024 · 0 comments
Open

[Prometheus Compatibility] Reconsider 1 to ratio unit conversion #4058

dashpole opened this issue May 23, 2024 · 0 comments
Assignees
Labels
sig-issue A specific SIG should look into this before discussing at the spec spec:metrics Related to the specification/metrics directory spec:miscellaneous For issues that don't match any other spec label triage:accepted:ready-with-sponsor Ready to be implemented and has a specification sponsor assigned

Comments

@dashpole
Copy link
Contributor

Context

Found as part of open-telemetry/opentelemetry-python#3924.

The semantic conventions for instrument unit recommend using annotations, rather than the unity:

Instruments that measure an integer count of something SHOULD only use annotations with curly braces to give additional meaning without the leading default unit (1). For example, use {packet}, {error}, {fault}, etc.

The linked UCUM section says that annotations (e.g. {RBC}) and 1 are equivalent:

For example one can write “%{vol}”, “ kg{total}”, or “{RBC}” (for “red blood cells”) as pseudo-units. However, these annotations do not have any effect on the semantics, which is why these example expressions are equivalent to “ %”, “kg”, and “ 1” respectively.

The current Prometheus Compatibility specification converts 1 to ratio:

Special case: Converting "1" to "ratio".

Problem

While 1 can be a ratio, it can also be a count of something, since it is equivalent to {RBC}. Our spec discourages the use of 1 as a count of something, but that still doesn't make it correct to automatically convert 1 to ratio for Prometheus conversion.

Proposal

Remove the special case for changing 1 to ratio in prometheus conversion.

@bertysentry @open-telemetry/wg-prometheus @aabmass

@dashpole dashpole added the spec:miscellaneous For issues that don't match any other spec label label May 23, 2024
@danielgblanco danielgblanco added the triage:deciding:tc-inbox Needs attention from the TC in order to move forward label Jun 3, 2024
@tigrannajaryan tigrannajaryan added triage:accepted:ready-with-sponsor Ready to be implemented and has a specification sponsor assigned sig-issue A specific SIG should look into this before discussing at the spec spec:metrics Related to the specification/metrics directory labels Jun 5, 2024
@tigrannajaryan tigrannajaryan removed the triage:deciding:tc-inbox Needs attention from the TC in order to move forward label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig-issue A specific SIG should look into this before discussing at the spec spec:metrics Related to the specification/metrics directory spec:miscellaneous For issues that don't match any other spec label triage:accepted:ready-with-sponsor Ready to be implemented and has a specification sponsor assigned
Projects
Status: Spec - In Progress
Development

No branches or pull requests

4 participants