opentelemetry-sdk: fix explicit histogram aggregation to handle multiple explicit bucket advisories#4521
Conversation
…xplicit buckets advisory
a1d97b1 to
6f42342
Compare
|
@lseguy any reason this is in draft? |
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/aggregation.py
Outdated
Show resolved
Hide resolved
emdneto
left a comment
There was a problem hiding this comment.
Right. Thank you for the fix.
That change fixes the bug while keeping the _DEFAULT_EXPLICIT_BUCKET_HISTOGRAM_AGGREGATION_BOUNDARIES in case boundaries are not set. I know we have this test, but can you write one as part of the integration test? Like: asserting if we don't set the explicit buckets advisory it will keep the default ones?
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
…egation.py Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Added a new test case checking for default boundaries, let me know if that's not what you had in mind. |
All good. Thank you. |
Description
#4434 merged a fix that allowed the
ExplicitBucketHistogramAggregationcreated by the OTLP exporter to take into account histogram buckets advice.However, unlike the
DefaultAggregation, it does not allow setting independent bucket boundaries for multiple histograms. The first histogram will set the explicit boundaries based on the advice, but the explicit bucket boundaries of further histograms are ignored.This keeps the behavior of the View's explicit settings taking precedence over the advisory, except when
ExplicitBucketHistogramAggregationuses the default bucket boundaries.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: