.NET 6 Metrics - How to configure buckets for histograms? #3245
-
Hi, I'm currently experimenting with collecting metrics using the .NET 6 Metric APIs and exporting them via OTLP to an OpenTelemetry Collector. I can't seem to find any documentation on how to configure bucket sizes for histograms. Is anyone able to share their understanding here on how they work? Side Note: I've notice that in the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You can add a view and define the bucket size, for example: var configuredMetricProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("Sample.*")
.AddOtlpExporter(options => options.Endpoint = new Uri(collectorUri))
.AddView("*", new ExplicitBucketHistogramConfiguration { Boundaries = histogramBuckets })
.Build(); You cannot do this per bucket, unfortunately. See #2755 |
Beta Was this translation helpful? Give feedback.
-
The default is coming from the OTel spec. The bounds are fully configurable with Views API. |
Beta Was this translation helpful? Give feedback.
You can add a view and define the bucket size, for example:
You cannot do this per bucket, unfortunately. See #2755