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

Support for a histogram buckets api #108

Open
0xForerunner opened this issue Feb 27, 2024 · 1 comment
Open

Support for a histogram buckets api #108

0xForerunner opened this issue Feb 27, 2024 · 1 comment

Comments

@0xForerunner
Copy link

Feature Request

Motivation

One thing my team is looking for is the ability to specify histogram buckets when registering a histogram. This can currently be done at the meter provider level, but there are a few reasons why this would be useful at the actual metric call site. One reason being ease of configuration. A library should be able to suggest an appropriate bucket distribution that a consumer can then accept by default or override.

Proposal

I haven't fully evaluated how this could work yet, but I think It should be possible with using the view method for otel meters. Not sure exactly what the api should look like, perhaps:

info!(histogram.my_hist = my_var, buckets = ExpBuckets { .. });
@alfiejfs
Copy link

alfiejfs commented Aug 2, 2024

This should be more possible when the OpenTelemtry Rust client implement advisory parameters for explicit buckets. This is actually planned to happen today - here is the issue open-telemetry/opentelemetry-rust#1241.

Prior to this release I don't think this is possible (as to my knowledge buckets can currentlly only be defined in aggregations, which is SDK implementation detail), but assuming the release of beta is not delayed again this should be unblocked.

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

2 participants