-
Notifications
You must be signed in to change notification settings - Fork 780
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
Provide capability to define histogram bounds when constructing histogram itself #2755
Comments
The current API for creating histograms matches the current specification. See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#histogram-creation. The idea is that it is up to the application developer to define the boundaries that make sense in the context of their application using the metric SDK's view API. However, there is a proposed "hint" API which would enable library authors to provide default histogram bounds for the instruments their library creates. This hint API would be slated for .NET 7 if the specification for it is ready by then. See: dotnet/runtime#62027. Specifically:
|
Thanks for sharing, that would be helpful indeed. As of today, as far as I know you can only add views as following: var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("Sample.*")
.AddOtlpExporter(options=>
{
options.Endpoint = new Uri(collectorUri);
})
.AddView("<name>", new ExplicitBucketHistogramConfiguration { Boundaries = histogramBoundaries })
.Build(); Is there a way to add more view once it has been constructed like this or is this the only supported method for now? |
No way to add a view once you've built your meter provider. This is the only way. |
I'd love to re-open this as this is pretty important imo |
Unfortunately, .NET can't add this feature, as the spec is pending and need to wait for it to stabilize |
This issue was closed, but for visibility a new issue was opened to track this #5166. The underlying support from .NET is being considered for the .NET 9 timeframe dotnet/runtime#63650. |
Feature Request
Is your feature request related to a problem?
We want to assign different histogram buckets when creating the histogram itself, not when building the metric provider.
Describe the solution you'd like:
Provide the capability to define histogram bounds when constructing histogram itself, instead of using views on the metric provider definition.
Describe alternatives you've considered.
Change an existing view, but that doesn't seem to be possible as well.
Additional Context
N/A
The text was updated successfully, but these errors were encountered: