Skip to content

Support for a histogram buckets api #108

Open
@0xForerunner

Description

@0xForerunner

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 { .. });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions