opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

Provide API to customize bucket boundaries for individual value recorders

Open fabian-braun opened this issue 4 years ago • 6 comments

Hi,

Currently it's only possible to customize histogram boundaries globally through ExporterBuilder::with_default_histogram_boundaries.

It would be great if customizing the boundaries for each specific value recorder was supported.

Something along the following lines

let recorder = global::meter("my_meter")
    .f64_value_recorder("my_recorder")
    .with_boundaries(vec![10.0, 50.0, 200.0]) // <-- not possible right now
    .init();

Would a contribution be welcome? Is there a workaround to obtain the same behavior (maybe through multiple exporters?)

fabian-braun avatar Nov 23 '21 16:11 fabian-braun

It looks like this will be supported in the future via the AggregatorSelector, maybe you can clarify here @TommyCpp?

jan-xyz avatar Nov 24 '21 10:11 jan-xyz

Since the metrics spec has been stabilized. We are looking to migrate the existing implementation onto the stable spec. In the stable metric spec. This can be achieved via Histogram instrument and Histogram aggregation where you can configure your boundaries.

TommyCpp avatar Nov 25 '21 15:11 TommyCpp

@TommyCpp Is there a tracking issue for migration onto the stable spec? I'm trying to figure out how to set custom buckets for a specific histogram in current (0.16) version and it's not entirely clear, I might be missing something though

alexgavrisco avatar Dec 08 '21 14:12 alexgavrisco

@Alexx-G I am working on creating some issue to lay out our road map on metrics. It will take some time to implement it. So if many users need those we may explore and see if we can provide some kind of API based on current version.

TommyCpp avatar Dec 10 '21 16:12 TommyCpp

Per the spec this should be customized in the SDK based upon the Views

hdost avatar Feb 09 '22 19:02 hdost

So if many users need those we may explore and see if we can provide some kind of API based on current version.

Is this simply not possible currently with opentelemetry-rust?

rikonor avatar May 02 '22 14:05 rikonor

#897 has been released in #1156

jtescher avatar Jul 30 '23 17:07 jtescher