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

Views can not control boundaries in histograms #629

Open
RoadRunnr opened this issue Sep 22, 2023 · 4 comments
Open

Views can not control boundaries in histograms #629

RoadRunnr opened this issue Sep 22, 2023 · 4 comments

Comments

@RoadRunnr
Copy link
Contributor

According to https://opentelemetry.io/docs/specs/otel/metrics/sdk/#aggregation is should be possible to add a View to an Instrument and define how that View translates that Instrument to an Histogram. In particular, the defined Boundaries in the View should be used instead of the default histogram boundaries.

That does not seem to work at all.

If I understand the code correctly, then instrument created with kind histogram will not honor the view settings at all.

This has also been discussed to other languages, e.g.:

If I do this:

otel_meter_server:add_view(#{instrument_kind => ?KIND_HISTOGRAM},
                           #{aggregation_options =>
                                 #{boundaries => [0.0, 1.1, 2.2, 4.4, 8.8]}}),
?create_histogram('meter1', #{description => <<"Meter 1">>, unit => us}),

then the the created histogram should have the boundaries defined by the view, but instead it will have the ?DEFAULT_BOUNDARIES.

@albertored
Copy link
Contributor

HI @RoadRunnr, I think I have (involuntarily) fixed this on this PR: #628, could you try with that branch?

@albertored
Copy link
Contributor

@RoadRunnr just added a specific test on that PR (34e8271) and I confirm it will fix your bug

@tsloughter
Copy link
Member

great! will get that merged in

@RoadRunnr
Copy link
Contributor Author

@albertored confirmed, works as expected with that change 👍

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

No branches or pull requests

3 participants