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

How to set histogram metric bucket size after meter registration #660

Open
JustasL opened this issue Dec 19, 2024 · 0 comments
Open

How to set histogram metric bucket size after meter registration #660

JustasL opened this issue Dec 19, 2024 · 0 comments

Comments

@JustasL
Copy link

JustasL commented Dec 19, 2024

Hello, is there a way to set histogram bucket after the metes has been registered?
From looking at source code and examples it does not seem like it's possible on iOS

My Android colleague is using this method, like this:

override fun trackHistogram(event: HistogramEvent) {
    with(event) {
        val otelAttributes = attributes.toOtelAttributes()
        val builder = GlobalOpenTelemetry.getMeter("")
            .histogramBuilder(eventName)

        if (buckets != null) {
            builder.setExplicitBucketBoundariesAdvice(buckets)
        }

        builder
            .build()
            .record(value, otelAttributes)

    }
}

Where as iOS histogram builder does not have such option

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

1 participant