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 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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig-issue 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
Projects
Status: Spec - In Progress
Development

No branches or pull requests

4 participants