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 conversion mapping from OTel Exponential Histograms to Prometheus Native Histograms. #3079

Merged
merged 6 commits into from
Feb 7, 2023
Merged

Conversation

kovrus
Copy link
Member

@kovrus kovrus commented Jan 5, 2023

@kovrus kovrus changed the title Exponential to Prometheus Native Histogram convertion. Define conversion mapping from OTel Exponential Histograms to Prometheus Native Histograms. Jan 5, 2023
@kovrus kovrus marked this pull request as ready for review January 5, 2023 13:34
@kovrus kovrus requested review from a team January 5, 2023 13:34
@kovrus
Copy link
Member Author

kovrus commented Jan 5, 2023

@dashpole @Aneurysm9 @gouthamve please take a look.

@kovrus kovrus requested a review from Aneurysm9 January 5, 2023 19:48
@kovrus kovrus requested a review from jmacd January 10, 2023 11:33
Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I approve of the conversion, however I would like to see us attempt to rescale histograms as best we can to fit prometheus's current boundaries/limitations.

One of the goals of these histograms is to easily/efficiently rescale so we can balance performance + resolution. In that vein, I'd be a fan of something like:

If `Scale` is > 8 then  exponential histogram data points SHOULD be downscaled to a scale accepted by prometheus (in range [-4,8]).  Any data point unable to be rescaled to an acceptable range MUST be dropped.

This is a non-blocking request though.

@jack-berg
Copy link
Member

however I would like to see us attempt to rescale histograms as best we can to fit prometheus's current boundaries/limitations.

We can reduce the scale if its greater than 8, but how would we change the scale if its less than -4? One option would be to introduce a MinScale config parameter such that the prometheus exporter can request that the SDK never rescale below -4. But what does it do if at scale -4 the measurements don't fit into the max number of allowed buckets? We could introduce a reset. When scale is at -4 and its still not enough to fit the measurements in the allowed buckets, trigger a reset. This isn't without problems though- what the measurements don't fit in the allowed buckets at scale -4 within a single collection interval? Resetting would cause data loss. We could introduce an infinity_bucket (similar to the zero_bucket), and increment infinity_bucket and zero_bucket when measurements don't fit within the allowed buckets at the allowed scale. Would have to populate zero_threshold and infinity_threshold with the smallest and largest respective values that are representable given the scale and allowed buckets.

@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 31, 2023
@reyang reyang removed the Stale label Feb 6, 2023
@reyang reyang added the spec:metrics Related to the specification/metrics directory label Feb 6, 2023
@reyang reyang merged commit dd47c00 into open-telemetry:main Feb 7, 2023
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:metrics Related to the specification/metrics directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants