From c40b105efd6ec435e412e16cc546cc072f50b16b Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 19 Jul 2022 18:11:33 +0200 Subject: [PATCH] histograms: Move to new exposition protobuf format This is an incompatible protobuf change. Instrumented targets must include https://github.com/prometheus/client_golang/pull/1092 to make this work. Signed-off-by: beorn7 --- model/textparse/protobufparse.go | 50 +- model/textparse/protobufparse_test.go | 60 +- prompb/io/prometheus/client/metrics.pb.go | 1171 +++++++++++---------- prompb/io/prometheus/client/metrics.proto | 66 +- 4 files changed, 678 insertions(+), 669 deletions(-) diff --git a/model/textparse/protobufparse.go b/model/textparse/protobufparse.go index 9bef9506d..2ca578243 100644 --- a/model/textparse/protobufparse.go +++ b/model/textparse/protobufparse.go @@ -38,7 +38,7 @@ import ( // protobuf format and then present it as it if were parsed by a // Prometheus-2-style text parser. This is only done so that we can easily plug // in the protobuf format into Prometheus 2. For future use (with the final -// format that will be used for sparse histograms), we have to revisit the +// format that will be used for native histograms), we have to revisit the // parsing. A lot of the efficiency tricks of the Prometheus-2-style parsing // could be used in a similar fashion (byte-slice pointers into the raw // payload), which requires some hand-coded protobuf handling. But the current @@ -132,8 +132,8 @@ func (p *ProtobufParser) Series() ([]byte, *int64, float64) { return p.metricBytes.Bytes(), nil, v } -// Histogram returns the bytes of a series with a sparse histogram as a -// value, the timestamp if set, and the sparse histogram in the current +// Histogram returns the bytes of a series with a native histogram as a +// value, the timestamp if set, and the native histogram in the current // sample. func (p *ProtobufParser) Histogram() ([]byte, *int64, *histogram.Histogram) { var ( @@ -144,19 +144,19 @@ func (p *ProtobufParser) Histogram() ([]byte, *int64, *histogram.Histogram) { sh := histogram.Histogram{ Count: h.GetSampleCount(), Sum: h.GetSampleSum(), - ZeroThreshold: h.GetSbZeroThreshold(), - ZeroCount: h.GetSbZeroCount(), - Schema: h.GetSbSchema(), - PositiveSpans: make([]histogram.Span, len(h.GetSbPositive().GetSpan())), - PositiveBuckets: h.GetSbPositive().GetDelta(), - NegativeSpans: make([]histogram.Span, len(h.GetSbNegative().GetSpan())), - NegativeBuckets: h.GetSbNegative().GetDelta(), + ZeroThreshold: h.GetZeroThreshold(), + ZeroCount: h.GetZeroCount(), + Schema: h.GetSchema(), + PositiveSpans: make([]histogram.Span, len(h.GetPositiveSpan())), + PositiveBuckets: h.GetPositiveDelta(), + NegativeSpans: make([]histogram.Span, len(h.GetNegativeSpan())), + NegativeBuckets: h.GetNegativeDelta(), } - for i, span := range h.GetSbPositive().GetSpan() { + for i, span := range h.GetPositiveSpan() { sh.PositiveSpans[i].Offset = span.GetOffset() sh.PositiveSpans[i].Length = span.GetLength() } - for i, span := range h.GetSbNegative().GetSpan() { + for i, span := range h.GetNegativeSpan() { sh.NegativeSpans[i].Offset = span.GetOffset() sh.NegativeSpans[i].Length = span.GetLength() } @@ -231,7 +231,7 @@ func (p *ProtobufParser) Metric(l *labels.Labels) string { } // Exemplar writes the exemplar of the current sample into the passed -// exemplar. It returns if an exemplar exists or not. In case of a sparse +// exemplar. It returns if an exemplar exists or not. In case of a native // histogram, the legacy bucket section is still used for exemplars. To ingest // all examplars, call the Exemplar method repeatedly until it returns false. func (p *ProtobufParser) Exemplar(ex *exemplar.Exemplar) bool { @@ -246,7 +246,7 @@ func (p *ProtobufParser) Exemplar(ex *exemplar.Exemplar) bool { if p.state == EntrySeries { return false // At _count or _sum. } - p.fieldPos = 0 // Start at 1st bucket for sparse histograms. + p.fieldPos = 0 // Start at 1st bucket for native histograms. } for p.fieldPos < len(bb) { exProto = bb[p.fieldPos].GetExemplar() @@ -314,7 +314,7 @@ func (p *ProtobufParser) Next() (Entry, error) { p.state = EntryType case EntryType: if p.mf.GetType() == dto.MetricType_HISTOGRAM && - isSparseHistogram(p.mf.GetMetric()[0].GetHistogram()) { + isNativeHistogram(p.mf.GetMetric()[0].GetHistogram()) { p.state = EntryHistogram } else { p.state = EntrySeries @@ -465,18 +465,18 @@ func formatOpenMetricsFloat(f float64) string { return s + ".0" } -// isSparseHistogram returns false iff the provided histograms has no -// SparseBuckets and a zero threshold of 0 and a zero count of 0. In principle, -// this could still be meant to be a sparse histgram (with a zero threshold of 0 -// and no observations yet), but for now, we'll treat this case as a conventional +// isNativeHistogram returns false iff the provided histograms has no sparse +// buckets and a zero threshold of 0 and a zero count of 0. In principle, this +// could still be meant to be a native histogram (with a zero threshold of 0 and +// no observations yet), but for now, we'll treat this case as a conventional // histogram. // // TODO(beorn7): In the final format, there should be an unambiguous way of -// deciding if a histogram should be ingested as a conventional one or a sparse +// deciding if a histogram should be ingested as a conventional one or a native // one. -func isSparseHistogram(h *dto.Histogram) bool { - return len(h.GetSbNegative().GetDelta()) > 0 || - len(h.GetSbPositive().GetDelta()) > 0 || - h.GetSbZeroCount() > 0 || - h.GetSbZeroThreshold() > 0 +func isNativeHistogram(h *dto.Histogram) bool { + return len(h.GetNegativeDelta()) > 0 || + len(h.GetPositiveDelta()) > 0 || + h.GetZeroCount() > 0 || + h.GetZeroThreshold() > 0 } diff --git a/model/textparse/protobufparse_test.go b/model/textparse/protobufparse_test.go index 8a479a87a..6cf210587 100644 --- a/model/textparse/protobufparse_test.go +++ b/model/textparse/protobufparse_test.go @@ -122,38 +122,34 @@ metric: < value: -0.00029 > > - sb_schema: 3 - sb_zero_threshold: 2.938735877055719e-39 - sb_zero_count: 2 - sb_negative: < - span: < - offset: -162 - length: 1 - > - span: < - offset: 23 - length: 4 - > - delta: 1 - delta: 3 - delta: -2 - delta: -1 - delta: 1 + schema: 3 + zero_threshold: 2.938735877055719e-39 + zero_count: 2 + negative_span: < + offset: -162 + length: 1 > - sb_positive: < - span: < - offset: -161 - length: 1 - > - span: < - offset: 8 - length: 3 - > - delta: 1 - delta: 2 - delta: -1 - delta: -1 + negative_span: < + offset: 23 + length: 4 + > + negative_delta: 1 + negative_delta: 3 + negative_delta: -2 + negative_delta: -1 + negative_delta: 1 + positive_span: < + offset: -161 + length: 1 + > + positive_span: < + offset: 8 + length: 3 > + positive_delta: 1 + positive_delta: 2 + positive_delta: -1 + positive_delta: -1 > timestamp_ms: 1234568 > @@ -196,8 +192,8 @@ metric: < value: -0.000295 > > - sb_schema: 0 - sb_zero_threshold: 0 + schema: 0 + zero_threshold: 0 > > diff --git a/prompb/io/prometheus/client/metrics.pb.go b/prompb/io/prometheus/client/metrics.pb.go index 48f68ec19..1be98a2f7 100644 --- a/prompb/io/prometheus/client/metrics.pb.go +++ b/prompb/io/prometheus/client/metrics.pb.go @@ -391,25 +391,37 @@ func (m *Untyped) GetValue() float64 { } type Histogram struct { - SampleCount uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount,proto3" json:"sample_count,omitempty"` - SampleCountFloat float64 `protobuf:"fixed64,9,opt,name=sample_count_float,json=sampleCountFloat,proto3" json:"sample_count_float,omitempty"` - SampleSum float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum,proto3" json:"sample_sum,omitempty"` - Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket,proto3" json:"bucket,omitempty"` - // Sparse bucket (sb) stuff: - // The sb_schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8. + SampleCount uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount,proto3" json:"sample_count,omitempty"` + SampleCountFloat float64 `protobuf:"fixed64,4,opt,name=sample_count_float,json=sampleCountFloat,proto3" json:"sample_count_float,omitempty"` + SampleSum float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum,proto3" json:"sample_sum,omitempty"` + // Buckets for the conventional histogram. + Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket,proto3" json:"bucket,omitempty"` + // schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8. // They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and // then each power of two is divided into 2^n logarithmic buckets. // Or in other words, each bucket boundary is the previous boundary times 2^(2^-n). // In the future, more bucket schemas may be added using numbers < -4 or > 8. - SbSchema int32 `protobuf:"zigzag32,4,opt,name=sb_schema,json=sbSchema,proto3" json:"sb_schema,omitempty"` - SbZeroThreshold float64 `protobuf:"fixed64,5,opt,name=sb_zero_threshold,json=sbZeroThreshold,proto3" json:"sb_zero_threshold,omitempty"` - SbZeroCount uint64 `protobuf:"varint,6,opt,name=sb_zero_count,json=sbZeroCount,proto3" json:"sb_zero_count,omitempty"` - SbZeroCountFloat float64 `protobuf:"fixed64,10,opt,name=sb_zero_count_float,json=sbZeroCountFloat,proto3" json:"sb_zero_count_float,omitempty"` - SbNegative *SparseBuckets `protobuf:"bytes,7,opt,name=sb_negative,json=sbNegative,proto3" json:"sb_negative,omitempty"` - SbPositive *SparseBuckets `protobuf:"bytes,8,opt,name=sb_positive,json=sbPositive,proto3" json:"sb_positive,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Schema int32 `protobuf:"zigzag32,5,opt,name=schema,proto3" json:"schema,omitempty"` + ZeroThreshold float64 `protobuf:"fixed64,6,opt,name=zero_threshold,json=zeroThreshold,proto3" json:"zero_threshold,omitempty"` + ZeroCount uint64 `protobuf:"varint,7,opt,name=zero_count,json=zeroCount,proto3" json:"zero_count,omitempty"` + ZeroCountFloat float64 `protobuf:"fixed64,8,opt,name=zero_count_float,json=zeroCountFloat,proto3" json:"zero_count_float,omitempty"` + // Negative buckets for the native histogram. + NegativeSpan []*BucketSpan `protobuf:"bytes,9,rep,name=negative_span,json=negativeSpan,proto3" json:"negative_span,omitempty"` + // Use either "negative_delta" or "negative_count", the former for + // regular histograms with integer counts, the latter for float + // histograms. + NegativeDelta []int64 `protobuf:"zigzag64,10,rep,packed,name=negative_delta,json=negativeDelta,proto3" json:"negative_delta,omitempty"` + NegativeCount []float64 `protobuf:"fixed64,11,rep,packed,name=negative_count,json=negativeCount,proto3" json:"negative_count,omitempty"` + // Positive buckets for the native histogram. + PositiveSpan []*BucketSpan `protobuf:"bytes,12,rep,name=positive_span,json=positiveSpan,proto3" json:"positive_span,omitempty"` + // Use either "positive_delta" or "positive_count", the former for + // regular histograms with integer counts, the latter for float + // histograms. + PositiveDelta []int64 `protobuf:"zigzag64,13,rep,packed,name=positive_delta,json=positiveDelta,proto3" json:"positive_delta,omitempty"` + PositiveCount []float64 `protobuf:"fixed64,14,rep,packed,name=positive_count,json=positiveCount,proto3" json:"positive_count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Histogram) Reset() { *m = Histogram{} } @@ -473,44 +485,72 @@ func (m *Histogram) GetBucket() []*Bucket { return nil } -func (m *Histogram) GetSbSchema() int32 { +func (m *Histogram) GetSchema() int32 { if m != nil { - return m.SbSchema + return m.Schema } return 0 } -func (m *Histogram) GetSbZeroThreshold() float64 { +func (m *Histogram) GetZeroThreshold() float64 { if m != nil { - return m.SbZeroThreshold + return m.ZeroThreshold } return 0 } -func (m *Histogram) GetSbZeroCount() uint64 { +func (m *Histogram) GetZeroCount() uint64 { if m != nil { - return m.SbZeroCount + return m.ZeroCount } return 0 } -func (m *Histogram) GetSbZeroCountFloat() float64 { +func (m *Histogram) GetZeroCountFloat() float64 { if m != nil { - return m.SbZeroCountFloat + return m.ZeroCountFloat } return 0 } -func (m *Histogram) GetSbNegative() *SparseBuckets { +func (m *Histogram) GetNegativeSpan() []*BucketSpan { + if m != nil { + return m.NegativeSpan + } + return nil +} + +func (m *Histogram) GetNegativeDelta() []int64 { + if m != nil { + return m.NegativeDelta + } + return nil +} + +func (m *Histogram) GetNegativeCount() []float64 { + if m != nil { + return m.NegativeCount + } + return nil +} + +func (m *Histogram) GetPositiveSpan() []*BucketSpan { + if m != nil { + return m.PositiveSpan + } + return nil +} + +func (m *Histogram) GetPositiveDelta() []int64 { if m != nil { - return m.SbNegative + return m.PositiveDelta } return nil } -func (m *Histogram) GetSbPositive() *SparseBuckets { +func (m *Histogram) GetPositiveCount() []float64 { if m != nil { - return m.SbPositive + return m.PositiveCount } return nil } @@ -586,78 +626,13 @@ func (m *Bucket) GetExemplar() *Exemplar { return nil } -type SparseBuckets struct { - Span []*SparseBuckets_Span `protobuf:"bytes,1,rep,name=span,proto3" json:"span,omitempty"` - // Only one of "delta" or "count" may be used, the former for regular - // histograms with integer counts, the latter for float histograms. - Delta []int64 `protobuf:"zigzag64,2,rep,packed,name=delta,proto3" json:"delta,omitempty"` - Count []float64 `protobuf:"fixed64,3,rep,packed,name=count,proto3" json:"count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SparseBuckets) Reset() { *m = SparseBuckets{} } -func (m *SparseBuckets) String() string { return proto.CompactTextString(m) } -func (*SparseBuckets) ProtoMessage() {} -func (*SparseBuckets) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{8} -} -func (m *SparseBuckets) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SparseBuckets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SparseBuckets.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SparseBuckets) XXX_Merge(src proto.Message) { - xxx_messageInfo_SparseBuckets.Merge(m, src) -} -func (m *SparseBuckets) XXX_Size() int { - return m.Size() -} -func (m *SparseBuckets) XXX_DiscardUnknown() { - xxx_messageInfo_SparseBuckets.DiscardUnknown(m) -} - -var xxx_messageInfo_SparseBuckets proto.InternalMessageInfo - -func (m *SparseBuckets) GetSpan() []*SparseBuckets_Span { - if m != nil { - return m.Span - } - return nil -} - -func (m *SparseBuckets) GetDelta() []int64 { - if m != nil { - return m.Delta - } - return nil -} - -func (m *SparseBuckets) GetCount() []float64 { - if m != nil { - return m.Count - } - return nil -} - -// A Span is a given number of consecutive buckets at a given -// offset. Logically, it would be more straightforward to include -// the bucket counts in the Span. However, the protobuf -// representation is more compact in the way the data is structured -// here (with all the buckets in a single array separate from the -// Spans). -type SparseBuckets_Span struct { +// A BucketSpan defines a number of consecutive buckets in a native +// histogram with their offset. Logically, it would be more +// straightforward to include the bucket counts in the Span. However, +// the protobuf representation is more compact in the way the data is +// structured here (with all the buckets in a single array separate +// from the Spans). +type BucketSpan struct { Offset int32 `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"` Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -665,18 +640,18 @@ type SparseBuckets_Span struct { XXX_sizecache int32 `json:"-"` } -func (m *SparseBuckets_Span) Reset() { *m = SparseBuckets_Span{} } -func (m *SparseBuckets_Span) String() string { return proto.CompactTextString(m) } -func (*SparseBuckets_Span) ProtoMessage() {} -func (*SparseBuckets_Span) Descriptor() ([]byte, []int) { - return fileDescriptor_d1e5ddb18987a258, []int{8, 0} +func (m *BucketSpan) Reset() { *m = BucketSpan{} } +func (m *BucketSpan) String() string { return proto.CompactTextString(m) } +func (*BucketSpan) ProtoMessage() {} +func (*BucketSpan) Descriptor() ([]byte, []int) { + return fileDescriptor_d1e5ddb18987a258, []int{8} } -func (m *SparseBuckets_Span) XXX_Unmarshal(b []byte) error { +func (m *BucketSpan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SparseBuckets_Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SparseBuckets_Span.Marshal(b, m, deterministic) + return xxx_messageInfo_BucketSpan.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -686,26 +661,26 @@ func (m *SparseBuckets_Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *SparseBuckets_Span) XXX_Merge(src proto.Message) { - xxx_messageInfo_SparseBuckets_Span.Merge(m, src) +func (m *BucketSpan) XXX_Merge(src proto.Message) { + xxx_messageInfo_BucketSpan.Merge(m, src) } -func (m *SparseBuckets_Span) XXX_Size() int { +func (m *BucketSpan) XXX_Size() int { return m.Size() } -func (m *SparseBuckets_Span) XXX_DiscardUnknown() { - xxx_messageInfo_SparseBuckets_Span.DiscardUnknown(m) +func (m *BucketSpan) XXX_DiscardUnknown() { + xxx_messageInfo_BucketSpan.DiscardUnknown(m) } -var xxx_messageInfo_SparseBuckets_Span proto.InternalMessageInfo +var xxx_messageInfo_BucketSpan proto.InternalMessageInfo -func (m *SparseBuckets_Span) GetOffset() int32 { +func (m *BucketSpan) GetOffset() int32 { if m != nil { return m.Offset } return 0 } -func (m *SparseBuckets_Span) GetLength() uint32 { +func (m *BucketSpan) GetLength() uint32 { if m != nil { return m.Length } @@ -951,8 +926,7 @@ func init() { proto.RegisterType((*Untyped)(nil), "io.prometheus.client.Untyped") proto.RegisterType((*Histogram)(nil), "io.prometheus.client.Histogram") proto.RegisterType((*Bucket)(nil), "io.prometheus.client.Bucket") - proto.RegisterType((*SparseBuckets)(nil), "io.prometheus.client.SparseBuckets") - proto.RegisterType((*SparseBuckets_Span)(nil), "io.prometheus.client.SparseBuckets.Span") + proto.RegisterType((*BucketSpan)(nil), "io.prometheus.client.BucketSpan") proto.RegisterType((*Exemplar)(nil), "io.prometheus.client.Exemplar") proto.RegisterType((*Metric)(nil), "io.prometheus.client.Metric") proto.RegisterType((*MetricFamily)(nil), "io.prometheus.client.MetricFamily") @@ -963,65 +937,63 @@ func init() { } var fileDescriptor_d1e5ddb18987a258 = []byte{ - // 913 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x72, 0xdb, 0x44, - 0x14, 0x46, 0xb1, 0xfc, 0xa3, 0xe3, 0x86, 0x38, 0xdb, 0x4c, 0x47, 0x93, 0x92, 0xc4, 0x88, 0x9b, - 0xd0, 0x01, 0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, 0x10, 0x81, 0xbd, 0xa0, 0x51, - 0x6a, 0xbe, 0x86, 0xea, 0x37, 0x3a, 0x02, 0x5b, 0x6a, 0x54, 0x2b, 0x7c, 0xf7, 0x7e, 0xbf, 0x5e, - 0x95, 0x9e, 0x3c, 0x59, 0xa6, 0x14, 0x2b, 0xb4, 0xcc, 0x57, 0xfd, 0x05, 0x77, 0xed, 0xff, 0xca, - 0x57, 0xcd, 0xc3, 0x06, 0x7b, 0x2f, 0x00, 0xa8, 0x26, 0xa1, 0x2e, 0xb4, 0x1f, 0x3d, 0x9b, 0x9e, - 0x4f, 0x4e, 0x71, 0xef, 0x1d, 0xe4, 0x40, 0xf3, 0xec, 0x78, 0x7a, 0x76, 0xda, 0xb3, 0x64, 0x7f, - 0x3c, 0x1d, 0x8d, 0x8e, 0xf1, 0xf3, 0xde, 0x86, 0x2c, 0xa6, 0xe7, 0x93, 0xe7, 0x17, 0xa7, 0x8f, - 0x7b, 0x0d, 0xb4, 0x09, 0xce, 0xd3, 0xaf, 0xc7, 0x93, 0x67, 0x67, 0xf8, 0x78, 0xd4, 0xb3, 0xd1, - 0x6d, 0xd8, 0x52, 0x1c, 0xbf, 0x6a, 0x36, 0x4f, 0xbc, 0x3f, 0xae, 0xf7, 0xad, 0x3f, 0xaf, 0xf7, - 0xad, 0xbf, 0xaf, 0xf7, 0xad, 0x17, 0x3b, 0x21, 0xf3, 0x2b, 0x59, 0xbe, 0x96, 0x15, 0xb4, 0xd4, - 0x69, 0xfe, 0xf4, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0x77, 0x31, 0x97, 0x9b, 0x08, 0x00, - 0x00, + // 894 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x6e, 0xe3, 0x44, + 0x18, 0xc5, 0xcd, 0xaf, 0xbf, 0x34, 0xdd, 0xec, 0x50, 0xad, 0xac, 0x42,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4d, 0xe9, 0x51, 0x1d, 0xe1, 0xde, 0xb6, 0x7f, 0xb8, 0x9e, 0x3c, + 0xbb, 0x4e, 0x29, 0x56, 0x6c, 0xd9, 0xb9, 0xfa, 0xab, 0xee, 0x35, 0x5f, 0xd5, 0xb9, 0x5a, 0x87, + 0x0d, 0xf7, 0xc3, 0x05, 0x40, 0x35, 0x09, 0xf5, 0xa0, 0xf3, 0xe0, 0xe9, 0xfc, 0xc9, 0x6c, 0x8c, + 0x07, 0x6f, 0x21, 0x17, 0x5a, 0x17, 0x67, 0xf3, 0x8b, 0xf1, 0xc0, 0x91, 0xf8, 0x74, 0x3e, 0x99, + 0x9c, 0xe1, 0xe7, 0x83, 0x1d, 0xb9, 0x98, 0x3f, 0x99, 0x3d, 0x7f, 0x36, 0x7e, 0x38, 0x68, 0xa0, + 0x3e, 0xb8, 0x8f, 0xbf, 0x9e, 0xce, 0x9e, 0x5e, 0xe0, 0xb3, 0xc9, 0xa0, 0x89, 0xde, 0x86, 0x3b, + 0x4a, 0x13, 0x56, 0x60, 0xeb, 0xdc, 0xff, 0xe3, 0xe6, 0xc8, 0xf9, 0xf3, 0xe6, 0xc8, 0xf9, 0xeb, + 0xe6, 0xc8, 0xf9, 0x6e, 0x3f, 0xe2, 0x61, 0x65, 0x2b, 0xd4, 0xb6, 0x16, 0x6d, 0x75, 0x9b, 0x3f, + 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xbc, 0x25, 0x8b, 0xaf, 0x08, 0x00, 0x00, } func (m *LabelPair) Marshal() (dAtA []byte, err error) { @@ -1291,57 +1263,119 @@ func (m *Histogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.SbZeroCountFloat != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SbZeroCountFloat)))) + if len(m.PositiveCount) > 0 { + for iNdEx := len(m.PositiveCount) - 1; iNdEx >= 0; iNdEx-- { + f2 := math.Float64bits(float64(m.PositiveCount[iNdEx])) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f2)) + } + i = encodeVarintMetrics(dAtA, i, uint64(len(m.PositiveCount)*8)) i-- - dAtA[i] = 0x51 - } - if m.SampleCountFloat != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SampleCountFloat)))) + dAtA[i] = 0x72 + } + if len(m.PositiveDelta) > 0 { + var j3 int + dAtA5 := make([]byte, len(m.PositiveDelta)*10) + for _, num := range m.PositiveDelta { + x4 := (uint64(num) << 1) ^ uint64((num >> 63)) + for x4 >= 1<<7 { + dAtA5[j3] = uint8(uint64(x4)&0x7f | 0x80) + j3++ + x4 >>= 7 + } + dAtA5[j3] = uint8(x4) + j3++ + } + i -= j3 + copy(dAtA[i:], dAtA5[:j3]) + i = encodeVarintMetrics(dAtA, i, uint64(j3)) i-- - dAtA[i] = 0x49 + dAtA[i] = 0x6a } - if m.SbPositive != nil { - { - size, err := m.SbPositive.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.PositiveSpan) > 0 { + for iNdEx := len(m.PositiveSpan) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PositiveSpan[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x62 + } + } + if len(m.NegativeCount) > 0 { + for iNdEx := len(m.NegativeCount) - 1; iNdEx >= 0; iNdEx-- { + f6 := math.Float64bits(float64(m.NegativeCount[iNdEx])) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f6)) } + i = encodeVarintMetrics(dAtA, i, uint64(len(m.NegativeCount)*8)) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x5a + } + if len(m.NegativeDelta) > 0 { + var j7 int + dAtA9 := make([]byte, len(m.NegativeDelta)*10) + for _, num := range m.NegativeDelta { + x8 := (uint64(num) << 1) ^ uint64((num >> 63)) + for x8 >= 1<<7 { + dAtA9[j7] = uint8(uint64(x8)&0x7f | 0x80) + j7++ + x8 >>= 7 + } + dAtA9[j7] = uint8(x8) + j7++ + } + i -= j7 + copy(dAtA[i:], dAtA9[:j7]) + i = encodeVarintMetrics(dAtA, i, uint64(j7)) + i-- + dAtA[i] = 0x52 } - if m.SbNegative != nil { - { - size, err := m.SbNegative.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.NegativeSpan) > 0 { + for iNdEx := len(m.NegativeSpan) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NegativeSpan[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a } + } + if m.ZeroCountFloat != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ZeroCountFloat)))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x41 } - if m.SbZeroCount != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.SbZeroCount)) + if m.ZeroCount != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.ZeroCount)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x38 } - if m.SbZeroThreshold != 0 { + if m.ZeroThreshold != 0 { i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SbZeroThreshold)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.ZeroThreshold)))) + i-- + dAtA[i] = 0x31 + } + if m.Schema != 0 { + i = encodeVarintMetrics(dAtA, i, uint64((uint32(m.Schema)<<1)^uint32((m.Schema>>31)))) i-- - dAtA[i] = 0x29 + dAtA[i] = 0x28 } - if m.SbSchema != 0 { - i = encodeVarintMetrics(dAtA, i, uint64((uint32(m.SbSchema)<<1)^uint32((m.SbSchema>>31)))) + if m.SampleCountFloat != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SampleCountFloat)))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x21 } if len(m.Bucket) > 0 { for iNdEx := len(m.Bucket) - 1; iNdEx >= 0; iNdEx-- { @@ -1427,77 +1461,7 @@ func (m *Bucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SparseBuckets) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SparseBuckets) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SparseBuckets) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Count) > 0 { - for iNdEx := len(m.Count) - 1; iNdEx >= 0; iNdEx-- { - f5 := math.Float64bits(float64(m.Count[iNdEx])) - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f5)) - } - i = encodeVarintMetrics(dAtA, i, uint64(len(m.Count)*8)) - i-- - dAtA[i] = 0x1a - } - if len(m.Delta) > 0 { - var j6 int - dAtA8 := make([]byte, len(m.Delta)*10) - for _, num := range m.Delta { - x7 := (uint64(num) << 1) ^ uint64((num >> 63)) - for x7 >= 1<<7 { - dAtA8[j6] = uint8(uint64(x7)&0x7f | 0x80) - j6++ - x7 >>= 7 - } - dAtA8[j6] = uint8(x7) - j6++ - } - i -= j6 - copy(dAtA[i:], dAtA8[:j6]) - i = encodeVarintMetrics(dAtA, i, uint64(j6)) - i-- - dAtA[i] = 0x12 - } - if len(m.Span) > 0 { - for iNdEx := len(m.Span) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Span[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SparseBuckets_Span) Marshal() (dAtA []byte, err error) { +func (m *BucketSpan) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1507,12 +1471,12 @@ func (m *SparseBuckets_Span) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SparseBuckets_Span) MarshalTo(dAtA []byte) (int, error) { +func (m *BucketSpan) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SparseBuckets_Span) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *BucketSpan) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1899,28 +1863,52 @@ func (m *Histogram) Size() (n int) { n += 1 + l + sovMetrics(uint64(l)) } } - if m.SbSchema != 0 { - n += 1 + sozMetrics(uint64(m.SbSchema)) - } - if m.SbZeroThreshold != 0 { + if m.SampleCountFloat != 0 { n += 9 } - if m.SbZeroCount != 0 { - n += 1 + sovMetrics(uint64(m.SbZeroCount)) + if m.Schema != 0 { + n += 1 + sozMetrics(uint64(m.Schema)) } - if m.SbNegative != nil { - l = m.SbNegative.Size() - n += 1 + l + sovMetrics(uint64(l)) + if m.ZeroThreshold != 0 { + n += 9 } - if m.SbPositive != nil { - l = m.SbPositive.Size() - n += 1 + l + sovMetrics(uint64(l)) + if m.ZeroCount != 0 { + n += 1 + sovMetrics(uint64(m.ZeroCount)) } - if m.SampleCountFloat != 0 { + if m.ZeroCountFloat != 0 { n += 9 } - if m.SbZeroCountFloat != 0 { - n += 9 + if len(m.NegativeSpan) > 0 { + for _, e := range m.NegativeSpan { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if len(m.NegativeDelta) > 0 { + l = 0 + for _, e := range m.NegativeDelta { + l += sozMetrics(uint64(e)) + } + n += 1 + sovMetrics(uint64(l)) + l + } + if len(m.NegativeCount) > 0 { + n += 1 + sovMetrics(uint64(len(m.NegativeCount)*8)) + len(m.NegativeCount)*8 + } + if len(m.PositiveSpan) > 0 { + for _, e := range m.PositiveSpan { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if len(m.PositiveDelta) > 0 { + l = 0 + for _, e := range m.PositiveDelta { + l += sozMetrics(uint64(e)) + } + n += 1 + sovMetrics(uint64(l)) + l + } + if len(m.PositiveCount) > 0 { + n += 1 + sovMetrics(uint64(len(m.PositiveCount)*8)) + len(m.PositiveCount)*8 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -1953,35 +1941,7 @@ func (m *Bucket) Size() (n int) { return n } -func (m *SparseBuckets) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Span) > 0 { - for _, e := range m.Span { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if len(m.Delta) > 0 { - l = 0 - for _, e := range m.Delta { - l += sozMetrics(uint64(e)) - } - n += 1 + sovMetrics(uint64(l)) + l - } - if len(m.Count) > 0 { - n += 1 + sovMetrics(uint64(len(m.Count)*8)) + len(m.Count)*8 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SparseBuckets_Span) Size() (n int) { +func (m *BucketSpan) Size() (n int) { if m == nil { return 0 } @@ -2719,8 +2679,19 @@ func (m *Histogram) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field SampleCountFloat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.SampleCountFloat = float64(math.Float64frombits(v)) + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SbSchema", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) } var v int32 for shift := uint(0); ; shift += 7 { @@ -2738,10 +2709,10 @@ func (m *Histogram) Unmarshal(dAtA []byte) error { } } v = int32((uint32(v) >> 1) ^ uint32(((v&1)<<31)>>31)) - m.SbSchema = v - case 5: + m.Schema = v + case 6: if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field SbZeroThreshold", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ZeroThreshold", wireType) } var v uint64 if (iNdEx + 8) > l { @@ -2749,31 +2720,12 @@ func (m *Histogram) Unmarshal(dAtA []byte) error { } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - m.SbZeroThreshold = float64(math.Float64frombits(v)) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SbZeroCount", wireType) - } - m.SbZeroCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SbZeroCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } + m.ZeroThreshold = float64(math.Float64frombits(v)) case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SbNegative", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ZeroCount", wireType) } - var msglen int + m.ZeroCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetrics @@ -2783,31 +2735,25 @@ func (m *Histogram) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.ZeroCount |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics + case 8: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field ZeroCountFloat", wireType) } - if postIndex > l { + var v uint64 + if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - if m.SbNegative == nil { - m.SbNegative = &SparseBuckets{} - } - if err := m.SbNegative.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.ZeroCountFloat = float64(math.Float64frombits(v)) + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SbPositive", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NegativeSpan", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2834,217 +2780,146 @@ func (m *Histogram) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SbPositive == nil { - m.SbPositive = &SparseBuckets{} - } - if err := m.SbPositive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.NegativeSpan = append(m.NegativeSpan, &BucketSpan{}) + if err := m.NegativeSpan[len(m.NegativeSpan)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 9: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field SampleCountFloat", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.SampleCountFloat = float64(math.Float64frombits(v)) case 10: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field SbZeroCountFloat", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.SbZeroCountFloat = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipMetrics(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Bucket) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Bucket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Bucket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CumulativeCount", wireType) - } - m.CumulativeCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.NegativeDelta = append(m.NegativeDelta, int64(v)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - m.CumulativeCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } } + elementCount = count + if elementCount != 0 && len(m.NegativeDelta) == 0 { + m.NegativeDelta = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.NegativeDelta = append(m.NegativeDelta, int64(v)) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field NegativeDelta", wireType) } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field UpperBound", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.UpperBound = float64(math.Float64frombits(v)) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplar", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics + case 11: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF } - if iNdEx >= l { + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.NegativeCount = append(m.NegativeCount, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.NegativeCount) == 0 { + m.NegativeCount = make([]float64, 0, elementCount) } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.NegativeCount = append(m.NegativeCount, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field NegativeCount", wireType) } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Exemplar == nil { - m.Exemplar = &Exemplar{} - } - if err := m.Exemplar.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field CumulativeCountFloat", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.CumulativeCountFloat = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipMetrics(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SparseBuckets) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SparseBuckets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SparseBuckets: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Span", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositiveSpan", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3071,12 +2946,12 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Span = append(m.Span, &SparseBuckets_Span{}) - if err := m.Span[len(m.Span)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PositiveSpan = append(m.PositiveSpan, &BucketSpan{}) + if err := m.PositiveSpan[len(m.PositiveSpan)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 13: if wireType == 0 { var v uint64 for shift := uint(0); ; shift += 7 { @@ -3094,7 +2969,7 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { } } v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.Delta = append(m.Delta, int64(v)) + m.PositiveDelta = append(m.PositiveDelta, int64(v)) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -3129,8 +3004,8 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.Delta) == 0 { - m.Delta = make([]int64, 0, elementCount) + if elementCount != 0 && len(m.PositiveDelta) == 0 { + m.PositiveDelta = make([]int64, 0, elementCount) } for iNdEx < postIndex { var v uint64 @@ -3149,12 +3024,12 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { } } v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) - m.Delta = append(m.Delta, int64(v)) + m.PositiveDelta = append(m.PositiveDelta, int64(v)) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field Delta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositiveDelta", wireType) } - case 3: + case 14: if wireType == 1 { var v uint64 if (iNdEx + 8) > l { @@ -3163,7 +3038,7 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 v2 := float64(math.Float64frombits(v)) - m.Count = append(m.Count, v2) + m.PositiveCount = append(m.PositiveCount, v2) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -3192,8 +3067,8 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { } var elementCount int elementCount = packedLen / 8 - if elementCount != 0 && len(m.Count) == 0 { - m.Count = make([]float64, 0, elementCount) + if elementCount != 0 && len(m.PositiveCount) == 0 { + m.PositiveCount = make([]float64, 0, elementCount) } for iNdEx < postIndex { var v uint64 @@ -3203,11 +3078,139 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 v2 := float64(math.Float64frombits(v)) - m.Count = append(m.Count, v2) + m.PositiveCount = append(m.PositiveCount, v2) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositiveCount", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bucket) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Bucket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bucket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CumulativeCount", wireType) + } + m.CumulativeCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CumulativeCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field UpperBound", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.UpperBound = float64(math.Float64frombits(v)) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplar", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Exemplar == nil { + m.Exemplar = &Exemplar{} + } + if err := m.Exemplar.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CumulativeCountFloat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.CumulativeCountFloat = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipMetrics(dAtA[iNdEx:]) @@ -3230,7 +3233,7 @@ func (m *SparseBuckets) Unmarshal(dAtA []byte) error { } return nil } -func (m *SparseBuckets_Span) Unmarshal(dAtA []byte) error { +func (m *BucketSpan) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3253,10 +3256,10 @@ func (m *SparseBuckets_Span) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Span: wiretype end group for non-group") + return fmt.Errorf("proto: BucketSpan: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Span: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BucketSpan: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/prompb/io/prometheus/client/metrics.proto b/prompb/io/prometheus/client/metrics.proto index f0a0f40c4..8787f1e22 100644 --- a/prompb/io/prometheus/client/metrics.proto +++ b/prompb/io/prometheus/client/metrics.proto @@ -68,22 +68,39 @@ message Untyped { } message Histogram { - uint64 sample_count = 1; - double sample_count_float = 9; // Overrides sample_count if > 0. - double sample_sum = 2; - repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional. - // Sparse bucket (sb) stuff: - // The sb_schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8. + uint64 sample_count = 1; + double sample_count_float = 4; // Overrides sample_count if > 0. + double sample_sum = 2; + // Buckets for the conventional histogram. + repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional. + + // Everything below here is for native histograms (also known as sparse histograms). + + // schema defines the bucket schema. Currently, valid numbers are -4 <= n <= 8. // They are all for base-2 bucket schemas, where 1 is a bucket boundary in each case, and // then each power of two is divided into 2^n logarithmic buckets. // Or in other words, each bucket boundary is the previous boundary times 2^(2^-n). // In the future, more bucket schemas may be added using numbers < -4 or > 8. - sint32 sb_schema = 4; - double sb_zero_threshold = 5; // Breadth of the zero bucket. - uint64 sb_zero_count = 6; // Count in zero bucket. - double sb_zero_count_float = 10; // Overrides sb_zero_count if > 0. - SparseBuckets sb_negative = 7; // Negative sparse buckets. - SparseBuckets sb_positive = 8; // Positive sparse buckets. + sint32 schema = 5; + double zero_threshold = 6; // Breadth of the zero bucket. + uint64 zero_count = 7; // Count in zero bucket. + double zero_count_float = 8; // Overrides sb_zero_count if > 0. + + // Negative buckets for the native histogram. + repeated BucketSpan negative_span = 9; + // Use either "negative_delta" or "negative_count", the former for + // regular histograms with integer counts, the latter for float + // histograms. + repeated sint64 negative_delta = 10; // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + repeated double negative_count = 11; // Absolute count of each bucket. + + // Positive buckets for the native 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 + // histograms. + repeated sint64 positive_delta = 13; // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + repeated double positive_count = 14; // Absolute count of each bucket. } message Bucket { @@ -93,22 +110,15 @@ message Bucket { Exemplar exemplar = 3; } -message SparseBuckets { - // A Span is a given number of consecutive buckets at a given - // offset. Logically, it would be more straightforward to include - // the bucket counts in the Span. However, the protobuf - // representation is more compact in the way the data is structured - // here (with all the buckets in a single array separate from the - // Spans). - message Span { - sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). - uint32 length = 2; // Length of consecutive buckets. - } - repeated Span span = 1; - // Only one of "delta" or "count" may be used, the former for regular - // histograms with integer counts, the latter for float histograms. - repeated sint64 delta = 2; // Count delta of each bucket compared to previous one (or to zero for 1st bucket). - repeated double count = 3; // Absolute count of each bucket. +// A BucketSpan defines a number of consecutive buckets in a native +// histogram with their offset. Logically, it would be more +// straightforward to include the bucket counts in the Span. However, +// the protobuf representation is more compact in the way the data is +// structured here (with all the buckets in a single array separate +// from the Spans). +message BucketSpan { + sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). + uint32 length = 2; // Length of consecutive buckets. } message Exemplar {