opentelemetry-specification
opentelemetry-specification copied to clipboard
Are buckets optional in OTLP Exponential Histograms?
What are you trying to achieve?
As a vendor consuming OTLP data, we want to understand what kind of OTLP Exponential Histograms are aligned with the specification.
What did you expect to see?
OTLP Histogram buckets are optional according to the latest specification. The proto definition for OTLP Exponential Histograms allows sending an exponential histogram without buckets, but this is not explicitly mentioned in the data model document.
I would like the data model to explicitly mention if buckets are optional for exponential histograms.
I think as a vendor you should be prepared to accept exponential histograms without buckets. Consider negative buckets: these are only possible to produce outside of an SDK, since the metrics histogram API / SDK currently does not accept negative values. I would expect that some SDK implementations omit the negative bucket field rather than include an empty version
With that said, the java implementation does serialize an empty value for the negative buckets, rather than omitting it.
I think we should clarify this in the specification.
Given we're moving from Explicit Bucket => Exponential histograms, we think it is reasonable that users would ALSO be able to configure Exponential histograms with 0 buckets the way they do Explicit buckets today. In this case the user is looking for a "cheaper" summary of min/max/count/sum.
Specifically, if we look at the specification for configuring these, we do allow user to set MaxSize
to 0.
Specifically, if we look at the specification for configuring these, we do allow user to set MaxSize to 0.
Where do you see that? We actually just recently fixed a bug in java which was caused by setting the number of buckets to 1: https://github.com/open-telemetry/opentelemetry-java/issues/6089.
We might consider clarifying the spec to say that exponential buckets MaxSize is > 1, and that you a single bucket explicit bucket histogram is the mechanism you should use for producing a summary (min, max, count, sum).