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

Define arbitrary metric units singularly #3295

Closed
MrAlias opened this issue Mar 6, 2023 · 4 comments · Fixed by #3298
Closed

Define arbitrary metric units singularly #3295

MrAlias opened this issue Mar 6, 2023 · 4 comments · Fixed by #3298
Assignees
Labels
area:semantic-conventions Related to semantic conventions spec:metrics Related to the specification/metrics directory

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Mar 6, 2023

Arbitrary units needs to be defined as the singular value they measure. Given a unit is a quantity chosen as a standard in terms of which other quantities may be expressed, defining these as plurals introduces a ambiguity of how many of the quantity constitutes the unit.

Defining a unit as {request} clearly implies that a request is represented as 1. Defining the same as {requests} could mean that a value of 1 equals a batch of requests.

Originally posted by @MrAlias in #3294 (comment)

@trask
Copy link
Member

trask commented Mar 6, 2023

Added this to HTTP semconv blockers since HTTP semconv currently uses plural {requests}

@jmacd
Copy link
Contributor

jmacd commented Mar 7, 2023

I feel mixed about this. The UCUM specification uses the example or “{RBC}” (for “red blood cells”) as pseudo-units which, while not a specification, has always led me to think pseudo-units should be plural forms. The other example I found is "Parts-Per" notation which uses "parts", again a plural, as the pseudo-unit.

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 7, 2023

This example “{RBC}” (for “red blood cells”) is inconsistent in the UCUM FWIW:

20230307_105536

It means "red blood cell" in the non-unit code table.

As for "parts per N" units, they included to support SI but are provided to be used only where absolutely necessary. They are not endorsed by the UCUM.

More generally, all the other UCUM units are defined singularly (meter, second, gram, ...). Defining a unit plurally would mean that the quantity reported uses as a base non-unity quantities as the standard measurement. Meaning if we defined {20 requests} as a unit and reported 2 the value can be interpreted as 40 requests. I think this is completely appropriate if we find the need, and using a plural there makes sense. However, if we just define {requests} it is an under-defined gauge being used for the measurement. This ambiguity is removed by clearly specifying in the grammar that we consider the unit to be one request, as in {request}, and from there any reported value has a clear gauge it is measuring against.

@jmacd
Copy link
Contributor

jmacd commented Mar 8, 2023

Thank you @MrAlias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions spec:metrics Related to the specification/metrics directory
Development

Successfully merging a pull request may close this issue.

4 participants