[processor/deltatorate] Correctly transform unit of rates#46841
Open
mx-psi wants to merge 1 commit intoopen-telemetry:mainfrom
Open
[processor/deltatorate] Correctly transform unit of rates#46841mx-psi wants to merge 1 commit intoopen-telemetry:mainfrom
mx-psi wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
b1d6ce8 to
500ec2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since we are calculating a rate per second, we want the unit to be transformed to "original units" per second.
This PR appends
/sto the unit of generated rates if the unit is set.I argue this is compliant with UCUM (the unit spec used by OpenTelemetry) no matter what the original unit is, because (quoting the UCUM spec):
and
Therefore units like
m/s/sorms/sare valid UCUM units.Since the unit may be missing, to avoid assuming the unit is "1" we don't add
/sin that case.