Fix logarithm mapping max scale comment and align with Go implementation#4981
Open
chimchim89 wants to merge 1 commit intoopen-telemetry:mainfrom
Open
Fix logarithm mapping max scale comment and align with Go implementation#4981chimchim89 wants to merge 1 commit intoopen-telemetry:mainfrom
chimchim89 wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
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
Fixes the FIXME in
LogarithmMapping._get_max_scale()by documenting the rationale for_max_scale = 20.The original FIXME asked whether 20 is the correct value for this implementation. After reviewing the Go reference implementation and the otel-launcher-go README, 20 is confirmed correct for Python as well. The OTLP exponential histogram data point uses a signed 32-bit integer for bucket indices. At scale 20, the maximum bucket index is
((MAX_NORMAL_EXPONENT + 1) << 20) - 1, which fits within this range. At scale 21, the maximum bucket index reaches the upper limit of a signed 32-bit integer, making it difficult to test correctness.No logic, no value, and no behaviour was changed. Only the FIXME comment was replaced with an accurate explanation.
Type of change
How Has This Been Tested?
tox -e lint✅tox -e py✅Does This PR Require a Contrib Repo Change?
Checklist