-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Buckets should be defined at instrument level #689
Comments
There are several questions and answers here. OpenTelemetry Metrics is explicitly moving away from instruments named for the action they perform, and moving toward instruments named for how they are used. There is no I'm not sure I understand what you mean about About defining bucket boundaries, our intention is to support a Views API for configuring specific outputs based on the metric name and exporter, such as specific label dimensions, histogram boundaries or other aggregation options. See here: open-telemetry/oteps#89. I'm personally expecting to prototype a Views API in the Go SDK in May, after OpenTelemetry releases the 0.4 specification. To get us to OpenMetrics compatibility, we should have support for linear, log-linear, and arbitrary bucket configurations for histogram aggregators. We've discussed this in the past in the context of the Prometheus exporter: #534 That being said, OpenTelemetry is also pushing away from the use of fixed histogram boundaries. We have better options available today--DDSketch, T-digest, and other mergeable summarization techniques--which work without explicit bucket configuration. These are better options than explicit percentiles as well. So I think the Views API proposed above is the answer, but just a technical note:
It is true that there is a singleton global instance, it is provided as a convenience which allows metric instruments to be configured statically. (Note that Prometheus clients use a global registry, with the same benefit.) The default SDK can be used without being installed as the global. Multiple can co-exist in a process. |
Is there any way to define custom buckets for different instruments now? I still didn't find a way to do this, and #1280 is not resolved. |
The revised metric SDK being merged in #3175 contains Please give them a look. They will be included in the next metric SDK release (expected in a few days). |
@MrAlias I didn't find the method to apply view to the instrument. I can create a view and call TransformInstrument successfully but don't know how to change My view is like:
And this is my instrument:
|
Ah, I make it work. Thanks! btw, I noticed two breaking changes:
Are these expected? |
And I added an example in prometheus #3177
Besides, a |
This was indeed a bug #3183 It should be resolved in v0.32.1 |
This is also a bug. You can track its resolution in #3224 |
Closed by #3177 |
Context
Currently, when using Prometheus exporter, buckets are set when creating and initializing a Meter and we have to know ahead of time if we want buckets to use
Int64
boundaries orFloat64
boundaries.Problem
The boundaries we define is a function of the instrument we measure. Depending on the type of instrument and what the instrument measures, we need to define different buckets. So, we should be able to define buckets per instrument basis.
When defining buckets at Meter level, it means:
Int64
orFloat64
.And since
Meter
is supposed to be singleton based on OpenTelemetry specifications, I can make a similar argument that quantiles should also be defined at instrument level. We may not necessary want the same quantiles for every instrument that uses summary aggregation.The text was updated successfully, but these errors were encountered: