From 2a367b9c17011802927c005b7a165a40bedeeabe Mon Sep 17 00:00:00 2001 From: beorn7 Date: Thu, 20 Jul 2023 17:28:17 +0200 Subject: [PATCH] histogram: Add a doc comment about when to add a no-op span See https://github.com/prometheus/client_golang/issues/1127 for details. Signed-off-by: beorn7 --- go/metrics.pb.go | 3 +++ io/prometheus/client/metrics.proto | 3 +++ 2 files changed, 6 insertions(+) diff --git a/go/metrics.pb.go b/go/metrics.pb.go index 84946b2..cee360d 100644 --- a/go/metrics.pb.go +++ b/go/metrics.pb.go @@ -474,6 +474,9 @@ type Histogram struct { NegativeDelta []int64 `protobuf:"zigzag64,10,rep,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"` // Absolute count of each bucket. // Positive buckets for the native histogram. + // Use a no-op span (offset 0, length 0) for a native histogram without any + // observations yet and with a zero_threshold of 0. Otherwise, it would be + // indistinguishable from a classic histogram. PositiveSpan []*BucketSpan `protobuf:"bytes,12,rep,name=positive_span,json=positiveSpan" json:"positive_span,omitempty"` // Use either "positive_delta" or "positive_count", the former for // regular histograms with integer counts, the latter for float diff --git a/io/prometheus/client/metrics.proto b/io/prometheus/client/metrics.proto index 2102a68..c3c8cc1 100644 --- a/io/prometheus/client/metrics.proto +++ b/io/prometheus/client/metrics.proto @@ -98,6 +98,9 @@ message Histogram { repeated double negative_count = 11; // Absolute count of each bucket. // Positive buckets for the native histogram. + // Use a no-op span (offset 0, length 0) for a native histogram without any + // observations yet and with a zero_threshold of 0. Otherwise, it would be + // indistinguishable from a classic histogram. repeated BucketSpan positive_span = 12; // Use either "positive_delta" or "positive_count", the former for // regular histograms with integer counts, the latter for float