Conversation
Applications can now pass `MetricsConfig.views` to override the default aggregation of any instrument (e.g. the histogram bucket boundaries of `http.server.duration`) without racing `init_telemetry` for the global MeterProvider. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
adubovik
marked this pull request as draft
August 3, 2026 15:16
1 task
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.
MetricsConfigaccepts a new optionalmeter_provider_viewsfield — a list ofopentelemetry.sdk.metrics.view.View— passed straight to theMeterProvider. Previously the only way to customize aggregation was to set the globalMeterProviderbeforeinit_telemetryran, which made the SDK's own provider silently lose (Overriding of current MeterProvider is not allowed).Example — keep the default buckets of
http.server.durationbut extend them past 10s, up to 5 minutes:Scraping
:9464/metricsthen reportshttp_server_duration_milliseconds_bucket{...,le="300000"}and friends.meter_provider_viewsdefaults toNone, so existing applications are unaffected.