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.
While 1can 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.
Context
Found as part of https://github.com/open-telemetry/opentelemetry-python/pull/3924.
The semantic conventions for instrument unit recommend using annotations, rather than the unity:
The linked UCUM section says that annotations (e.g.
{RBC}
) and1
are equivalent:The current Prometheus Compatibility specification converts
1
toratio
: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 of1
as a count of something, but that still doesn't make it correct to automatically convert1
toratio
for Prometheus conversion.Proposal
Remove the special case for changing
1
toratio
in prometheus conversion.@bertysentry @open-telemetry/wg-prometheus @aabmass