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

Workaround otel histogram options #170

Merged
merged 5 commits into from Feb 8, 2022

Conversation

voidlock
Copy link
Member

@voidlock voidlock commented Jan 31, 2022

The commit works around the disconnect between the OTEL metrics Meter interface for creating histograms and the actual Aggregator used to collect and report on the data. Presently, there is no way to pass bucket definitions to the aggregator except globally for all histograms.

This commit resolves that by allowing for the use of a custom AggregatorSelector that caches any options and looks them up when a new Aggregator is requested by the OTEL controller.

At this point in time, I am leaving everything but the OTEL provider implementation alone. If you use use the ExplicitHistogram it will simply create an older style Histogram with a bucket count set to the length of the boundaries array.

The commit works around the disconnect between the OTEL metrics Meter
interface for creating histograms and the actual Aggregator used to
collect and report on the data. Presently, there is no way to pass
bucket definitions to the aggregator except globally for all histograms.

This commit resolves that by allowing for the use of a custome
AggregatorSelector that caches any options and looks them up when a new
Aggregator is requested by the OTEL controller.
Copy link
Contributor

@slizco slizco left a comment

Choose a reason for hiding this comment

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

I think this makes sense. I wonder if we may also want to provider an exported DefaultBoundaries and/or use those boundaries for NewHistogram. As you mentioned, most histograms are measuring a distribution of request latencies, so they're likely to be in the range of 0-30s, with most data points falling under 1s. We can add that later though if we find ourselves repeating boundary definitions.

Is there anything preventing us from merging this soon? I believe it does not conflict with existing histogram functionality.

@voidlock voidlock force-pushed the workaround-otel-histogram-options branch from 0d9b9d2 to c4173e6 Compare February 4, 2022 22:12
@voidlock voidlock marked this pull request as ready for review February 4, 2022 23:25
@voidlock voidlock requested a review from slizco February 5, 2022 05:34
@voidlock voidlock force-pushed the workaround-otel-histogram-options branch from 8ff1e5b to 8389709 Compare February 8, 2022 18:00
Copy link
Contributor

@wchrisjohnson wchrisjohnson left a comment

Choose a reason for hiding this comment

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

LGTM on my initial pass - would be good to get this into the wild and see how well it works.

@voidlock voidlock merged commit d3a5c66 into master Feb 8, 2022
@voidlock voidlock deleted the workaround-otel-histogram-options branch February 8, 2022 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants