From 4b803f3550a4997ddf9f8713e01d7bc404bb97fc Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 6 Apr 2020 21:16:36 +0200 Subject: [PATCH 01/19] Experimental encoding for sparse buckets in histogram Signed-off-by: beorn7 --- go/metrics.pb.go | 252 +++++++++++++++++++++++++++++++++++++---------- metrics.proto | 15 +++ 2 files changed, 215 insertions(+), 52 deletions(-) diff --git a/go/metrics.pb.go b/go/metrics.pb.go index 2f4930d..b36bd26 100644 --- a/go/metrics.pb.go +++ b/go/metrics.pb.go @@ -345,12 +345,18 @@ func (m *Untyped) GetValue() float64 { } type Histogram struct { - SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` - SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` - Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` + SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` + Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` + // Sparse bucket (sb) stuff: + SbResolution *uint32 `protobuf:"varint,4,opt,name=sb_resolution,json=sbResolution" json:"sb_resolution,omitempty"` + SbZeroThreshold *float64 `protobuf:"fixed64,5,opt,name=sb_zero_threshold,json=sbZeroThreshold" json:"sb_zero_threshold,omitempty"` + SbZeroCount *uint64 `protobuf:"varint,6,opt,name=sb_zero_count,json=sbZeroCount" json:"sb_zero_count,omitempty"` + SbNegative *SparseBuckets `protobuf:"bytes,7,opt,name=sb_negative,json=sbNegative" json:"sb_negative,omitempty"` + SbPositive *SparseBuckets `protobuf:"bytes,8,opt,name=sb_positive,json=sbPositive" json:"sb_positive,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Histogram) Reset() { *m = Histogram{} } @@ -399,6 +405,41 @@ func (m *Histogram) GetBucket() []*Bucket { return nil } +func (m *Histogram) GetSbResolution() uint32 { + if m != nil && m.SbResolution != nil { + return *m.SbResolution + } + return 0 +} + +func (m *Histogram) GetSbZeroThreshold() float64 { + if m != nil && m.SbZeroThreshold != nil { + return *m.SbZeroThreshold + } + return 0 +} + +func (m *Histogram) GetSbZeroCount() uint64 { + if m != nil && m.SbZeroCount != nil { + return *m.SbZeroCount + } + return 0 +} + +func (m *Histogram) GetSbNegative() *SparseBuckets { + if m != nil { + return m.SbNegative + } + return nil +} + +func (m *Histogram) GetSbPositive() *SparseBuckets { + if m != nil { + return m.SbPositive + } + return nil +} + type Bucket struct { CumulativeCount *uint64 `protobuf:"varint,1,opt,name=cumulative_count,json=cumulativeCount" json:"cumulative_count,omitempty"` UpperBound *float64 `protobuf:"fixed64,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"` @@ -454,6 +495,100 @@ func (m *Bucket) GetExemplar() *Exemplar { return nil } +type SparseBuckets struct { + Span []*SparseBuckets_Span `protobuf:"bytes,1,rep,name=span" json:"span,omitempty"` + Delta []int64 `protobuf:"zigzag64,2,rep,name=delta" json:"delta,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_6039342a2ba47b72, []int{8} +} + +func (m *SparseBuckets) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SparseBuckets.Unmarshal(m, b) +} +func (m *SparseBuckets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SparseBuckets.Marshal(b, m, deterministic) +} +func (m *SparseBuckets) XXX_Merge(src proto.Message) { + xxx_messageInfo_SparseBuckets.Merge(m, src) +} +func (m *SparseBuckets) XXX_Size() int { + return xxx_messageInfo_SparseBuckets.Size(m) +} +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 +} + +type SparseBuckets_Span struct { + Offset *int32 `protobuf:"zigzag32,1,opt,name=offset" json:"offset,omitempty"` + Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + 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_6039342a2ba47b72, []int{8, 0} +} + +func (m *SparseBuckets_Span) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SparseBuckets_Span.Unmarshal(m, b) +} +func (m *SparseBuckets_Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SparseBuckets_Span.Marshal(b, m, deterministic) +} +func (m *SparseBuckets_Span) XXX_Merge(src proto.Message) { + xxx_messageInfo_SparseBuckets_Span.Merge(m, src) +} +func (m *SparseBuckets_Span) XXX_Size() int { + return xxx_messageInfo_SparseBuckets_Span.Size(m) +} +func (m *SparseBuckets_Span) XXX_DiscardUnknown() { + xxx_messageInfo_SparseBuckets_Span.DiscardUnknown(m) +} + +var xxx_messageInfo_SparseBuckets_Span proto.InternalMessageInfo + +func (m *SparseBuckets_Span) GetOffset() int32 { + if m != nil && m.Offset != nil { + return *m.Offset + } + return 0 +} + +func (m *SparseBuckets_Span) GetLength() uint32 { + if m != nil && m.Length != nil { + return *m.Length + } + return 0 +} + type Exemplar struct { Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"` Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` @@ -467,7 +602,7 @@ func (m *Exemplar) Reset() { *m = Exemplar{} } func (m *Exemplar) String() string { return proto.CompactTextString(m) } func (*Exemplar) ProtoMessage() {} func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{8} + return fileDescriptor_6039342a2ba47b72, []int{9} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { @@ -526,7 +661,7 @@ func (m *Metric) Reset() { *m = Metric{} } func (m *Metric) String() string { return proto.CompactTextString(m) } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{9} + return fileDescriptor_6039342a2ba47b72, []int{10} } func (m *Metric) XXX_Unmarshal(b []byte) error { @@ -610,7 +745,7 @@ func (m *MetricFamily) Reset() { *m = MetricFamily{} } func (m *MetricFamily) String() string { return proto.CompactTextString(m) } func (*MetricFamily) ProtoMessage() {} func (*MetricFamily) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{10} + return fileDescriptor_6039342a2ba47b72, []int{11} } func (m *MetricFamily) XXX_Unmarshal(b []byte) error { @@ -669,6 +804,8 @@ 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((*Exemplar)(nil), "io.prometheus.client.Exemplar") proto.RegisterType((*Metric)(nil), "io.prometheus.client.Metric") proto.RegisterType((*MetricFamily)(nil), "io.prometheus.client.MetricFamily") @@ -677,47 +814,58 @@ func init() { func init() { proto.RegisterFile("metrics.proto", fileDescriptor_6039342a2ba47b72) } var fileDescriptor_6039342a2ba47b72 = []byte{ - // 665 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xfd, 0xdc, 0x38, 0x3f, 0xbe, 0x69, 0x3f, 0xa2, 0x51, 0x17, 0x56, 0xa1, 0x24, 0x78, 0x55, - 0x58, 0x38, 0xa2, 0x6a, 0x05, 0x2a, 0xb0, 0x68, 0x4b, 0x48, 0x91, 0x48, 0x5b, 0x26, 0xc9, 0xa2, - 0xb0, 0x88, 0x1c, 0x77, 0x70, 0x2c, 0x3c, 0xb1, 0xb1, 0x67, 0x2a, 0xb2, 0x66, 0xc1, 0x16, 0x5e, - 0x81, 0x17, 0x05, 0xcd, 0x8f, 0x6d, 0x2a, 0xb9, 0x95, 0x40, 0xec, 0x66, 0xee, 0x3d, 0xe7, 0xfa, - 0xcc, 0xf8, 0x9c, 0x81, 0x0d, 0x4a, 0x58, 0x1a, 0xfa, 0x99, 0x9b, 0xa4, 0x31, 0x8b, 0xd1, 0x66, - 0x18, 0x8b, 0x15, 0x25, 0x6c, 0x41, 0x78, 0xe6, 0xfa, 0x51, 0x48, 0x96, 0x6c, 0xab, 0x1b, 0xc4, - 0x71, 0x10, 0x91, 0xbe, 0xc4, 0xcc, 0xf9, 0x87, 0x3e, 0x0b, 0x29, 0xc9, 0x98, 0x47, 0x13, 0x45, - 0x73, 0xf6, 0xc1, 0x7a, 0xe3, 0xcd, 0x49, 0x74, 0xee, 0x85, 0x29, 0x42, 0x60, 0x2e, 0x3d, 0x4a, - 0x6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54, 0x09, 0x3d, 0x84, 0x8e, 0xcf, 0x29, 0x8f, 0x3c, 0x16, - 0x5e, 0x5d, 0x97, 0x71, 0xa7, 0xac, 0x2b, 0x29, 0x5d, 0x68, 0xf3, 0x24, 0x21, 0xe9, 0x6c, 0x1e, - 0xf3, 0xe5, 0xa5, 0xd6, 0x02, 0xb2, 0x74, 0x24, 0x2a, 0xd7, 0x1c, 0x50, 0xfb, 0x43, 0x07, 0x7c, - 0x37, 0xa0, 0x95, 0x97, 0xd1, 0x3e, 0xd4, 0x23, 0xe1, 0x60, 0xdb, 0x90, 0x87, 0xea, 0x56, 0x4f, - 0x29, 0x4c, 0x8e, 0x15, 0xba, 0xda, 0x1d, 0xe8, 0x29, 0x58, 0x45, 0x42, 0xb4, 0xac, 0x2d, 0x57, - 0x65, 0xc8, 0xcd, 0x33, 0xe4, 0x4e, 0x72, 0x04, 0x2e, 0xc1, 0xce, 0xcf, 0x35, 0x68, 0x8c, 0x64, - 0x22, 0xff, 0x56, 0xd1, 0x63, 0xa8, 0x07, 0x22, 0x53, 0x3a, 0x10, 0x77, 0xab, 0x69, 0x32, 0x76, - 0x58, 0x21, 0xd1, 0x13, 0x68, 0xfa, 0x2a, 0x67, 0x5a, 0xec, 0x76, 0x35, 0x49, 0x87, 0x11, 0xe7, - 0x68, 0x41, 0xcc, 0x54, 0x08, 0x6c, 0xf3, 0x36, 0xa2, 0x4e, 0x0a, 0xce, 0xd1, 0x82, 0xc8, 0x95, - 0x69, 0xed, 0xfa, 0x6d, 0x44, 0xed, 0x6c, 0x9c, 0xa3, 0xd1, 0x0b, 0xb0, 0x16, 0xb9, 0x97, 0xed, - 0xa6, 0xa4, 0xde, 0x70, 0x31, 0x85, 0xe5, 0x71, 0xc9, 0x10, 0xee, 0x2f, 0xee, 0x7a, 0x46, 0x33, - 0xbb, 0xd1, 0x33, 0x76, 0x6a, 0xb8, 0x5d, 0xd4, 0x46, 0x99, 0xf3, 0xc3, 0x80, 0x75, 0xf5, 0x07, - 0x5e, 0x79, 0x34, 0x8c, 0x56, 0x95, 0xcf, 0x19, 0x02, 0x73, 0x41, 0xa2, 0x44, 0xbf, 0x66, 0x72, - 0x8d, 0xf6, 0xc0, 0x14, 0x1a, 0xe5, 0x15, 0xfe, 0xbf, 0xdb, 0xab, 0x56, 0xa5, 0x26, 0x4f, 0x56, - 0x09, 0xc1, 0x12, 0x2d, 0xd2, 0xa4, 0x5e, 0x60, 0xdb, 0xbc, 0x2d, 0x4d, 0x8a, 0x87, 0x35, 0xf6, - 0xd1, 0x08, 0xa0, 0x9c, 0x84, 0xda, 0xd0, 0x3c, 0x3e, 0x9b, 0x9e, 0x4e, 0x06, 0xb8, 0xf3, 0x1f, - 0xb2, 0xa0, 0x3e, 0x3c, 0x9c, 0x0e, 0x07, 0x1d, 0x43, 0xd4, 0xc7, 0xd3, 0xd1, 0xe8, 0x10, 0x5f, - 0x74, 0xd6, 0xc4, 0x66, 0x7a, 0x3a, 0xb9, 0x38, 0x1f, 0xbc, 0xec, 0xd4, 0xd0, 0x06, 0x58, 0x27, - 0xaf, 0xc7, 0x93, 0xb3, 0x21, 0x3e, 0x1c, 0x75, 0xcc, 0x23, 0x0c, 0x95, 0xef, 0xfe, 0xbb, 0x83, - 0x20, 0x64, 0x0b, 0x3e, 0x77, 0xfd, 0x98, 0xf6, 0xcb, 0x6e, 0x5f, 0x75, 0x67, 0x34, 0xbe, 0x24, - 0x51, 0x3f, 0x88, 0x9f, 0x85, 0xf1, 0xac, 0xec, 0xce, 0x54, 0xf7, 0x57, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xd0, 0x84, 0x91, 0x73, 0x59, 0x06, 0x00, 0x00, + // 840 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x8f, 0xdb, 0x44, + 0x14, 0xc6, 0x1b, 0xe7, 0xd7, 0xcb, 0x86, 0xa6, 0xa3, 0x0a,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x73, 0x18, 0x88, 0x24, 0xca, 0x49, 0x1a, 0xcb, 0xec, 0x0d, 0x19, + 0x77, 0xcd, 0x2f, 0x72, 0xbf, 0x59, 0xef, 0xbc, 0x88, 0x4b, 0x41, 0xac, 0x6a, 0x81, 0x41, 0x24, + 0x57, 0x8e, 0xe6, 0xaa, 0x14, 0x5c, 0x64, 0xa6, 0x4a, 0xef, 0xad, 0xaa, 0x5c, 0x3b, 0x5a, 0xf0, + 0xab, 0x07, 0x1d, 0x9b, 0x47, 0x1f, 0xc3, 0x68, 0xa5, 0x98, 0xa2, 0xa6, 0xfc, 0xce, 0x3d, 0xdc, + 0xd9, 0xe6, 0x6d, 0x07, 0x27, 0x30, 0x50, 0x45, 0x41, 0xca, 0x28, 0xe1, 0x2a, 0x5f, 0xbb, 0xcb, + 0x00, 0x93, 0x3a, 0xd7, 0x99, 0x9d, 0x11, 0x68, 0xbd, 0xe5, 0x08, 0xfc, 0xee, 0xc1, 0x70, 0x47, + 0x30, 0x7a, 0x0a, 0xbe, 0x28, 0xe2, 0x7c, 0xec, 0x99, 0x9b, 0x3d, 0xfd, 0x17, 0x3d, 0xea, 0x28, + 0xc7, 0x86, 0xa5, 0xff, 0xbf, 0x35, 0xa1, 0x32, 0x1e, 0x1f, 0x4c, 0x5a, 0xa7, 0x08, 0xdb, 0xe0, + 0xe8, 0x53, 0xf0, 0x35, 0x06, 0xbd, 0x07, 0x1d, 0x7e, 0x73, 0x23, 0x88, 0xed, 0xf5, 0x2e, 0x76, + 0x91, 0xce, 0x53, 0x92, 0xa7, 0x72, 0x63, 0xba, 0x1b, 0x62, 0x17, 0x05, 0xbf, 0x79, 0xd0, 0xab, + 0x44, 0xa3, 0xc7, 0xd0, 0xa6, 0xda, 0x60, 0x9c, 0xb2, 0x93, 0x66, 0x65, 0xb5, 0x07, 0x61, 0x8b, + 0x6e, 0x1e, 0x5e, 0xf4, 0x39, 0xf4, 0x6b, 0x03, 0x73, 0x87, 0x76, 0x14, 0x5a, 0x8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 0xcb, 0xcb, 0x8b, 0x91, 0xa7, 0xf3, 0xf3, 0xe5, 0x6c, 0x76, 0x86, 0x5f, 0x8d, + 0x0e, 0x74, 0xb0, 0xbc, 0x5a, 0xbc, 0xba, 0xbe, 0x78, 0x3e, 0x6a, 0xa1, 0x21, 0xf4, 0x5f, 0x7c, + 0x3d, 0x5f, 0xbc, 0xbc, 0xc4, 0x67, 0xb3, 0x91, 0x7f, 0x8e, 0xa1, 0xf1, 0x59, 0x7e, 0xfd, 0x24, + 0xcd, 0xe4, 0x46, 0x25, 0xe1, 0x8a, 0xb3, 0xe9, 0x76, 0x77, 0x6a, 0x77, 0x23, 0xc6, 0xd7, 0x84, + 0x4e, 0x53, 0xfe, 0x45, 0xc6, 0xa3, 0xed, 0x6e, 0x64, 0x77, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, + 0x83, 0x68, 0x91, 0x48, 0xf8, 0x07, 0x00, 0x00, } diff --git a/metrics.proto b/metrics.proto index c9546f1..5d99642 100644 --- a/metrics.proto +++ b/metrics.proto @@ -60,6 +60,12 @@ message Histogram { optional uint64 sample_count = 1; optional double sample_sum = 2; repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional. + // Sparse bucket (sb) stuff: + optional uint32 sb_resolution = 4; // That many buckets per power of ten. Must be <256. Zero for no sparse buckets. + optional double sb_zero_threshold = 5; // Breadth of the zero bucket. + optional uint64 sb_zero_count = 6; // Count in zero bucket. + optional SparseBuckets sb_negative = 7; // Negative sparse buckets. + optional SparseBuckets sb_positive = 8; // Positive sparse buckets. } message Bucket { @@ -68,6 +74,15 @@ message Bucket { optional Exemplar exemplar = 3; } +message SparseBuckets { + message Span { + optional sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). + optional uint32 length = 2; // Length of consecutive buckets. + } + repeated Span span = 1; + repeated sint64 delta = 2; // Count delta of each bucket compared to previous one (or to zero for 1st bucket). +} + message Exemplar { repeated LabelPair label = 1; optional double value = 2; From 1106810388a4fb5df594cf104c24f0ec52d04200 Mon Sep 17 00:00:00 2001 From: prombot Date: Tue, 23 Jun 2020 00:09:03 +0000 Subject: [PATCH 02/19] Update common Prometheus files Signed-off-by: prombot --- CODE_OF_CONDUCT.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9a1aff4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +## Prometheus Community Code of Conduct + +Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). From 1bb3080dbccc8bbba2f14763f60b71612f68e5d5 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sat, 16 Jan 2021 13:59:17 +0100 Subject: [PATCH 03/19] Add SECURITY.md This commit adds a security policy to this repository. SECURITY.md files are threated in a special way by GitHub, helping users to know how to best submit security issues for the projects. In this case, we simply point to our existing documentation on prometheus.io. The content of this file will be synced automatically with the prometheus/prometheus repository, as our security policy covers all the repositories. This sync is automated with prombot, like other files (LICENSE, Makefile.common). https://docs.github.com/en/free-pro-team@latest/github/managing-security-vulnerabilities/adding-a-security-policy-to-your-repository Signed-off-by: Julien Pivotto --- SECURITY.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..67741f0 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,6 @@ +# Reporting a security issue + +The Prometheus security policy, including how to report vulnerabilities, can be +found here: + +https://prometheus.io/docs/operating/security/ From 1f48c5c8567fbfb0110350f7788befea93397ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rabenstein?= Date: Mon, 7 Jun 2021 20:03:59 +0200 Subject: [PATCH 04/19] Rename metrics.proto to io_prometheus_client_metrics.proto (#45) This should solve naming collision problems, apparently caused by having a very generically named file directly in the root directory of the repository. Fixes #44 (which also provides more context). Signed-off-by: beorn7 --- Makefile | 2 +- ....go => io_prometheus_client_metrics.pb.go} | 118 +++++++++--------- ...roto => io_prometheus_client_metrics.proto | 0 3 files changed, 60 insertions(+), 60 deletions(-) rename go/{metrics.pb.go => io_prometheus_client_metrics.pb.go} (79%) rename metrics.proto => io_prometheus_client_metrics.proto (100%) diff --git a/Makefile b/Makefile index 63f4c9d..c98d575 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ SUFFIXES: go: go/metrics.pb.go -go/metrics.pb.go: metrics.proto +go/metrics.pb.go: io_prometheus_client_metrics.proto protoc $< --go_out=import_path=github.com/prometheus/client_model/,paths=source_relative:go/ clean: diff --git a/go/metrics.pb.go b/go/io_prometheus_client_metrics.pb.go similarity index 79% rename from go/metrics.pb.go rename to go/io_prometheus_client_metrics.pb.go index 2f4930d..5764344 100644 --- a/go/metrics.pb.go +++ b/go/io_prometheus_client_metrics.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: metrics.proto +// source: io_prometheus_client_metrics.proto package io_prometheus_client @@ -67,7 +67,7 @@ func (x *MetricType) UnmarshalJSON(data []byte) error { } func (MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{0} + return fileDescriptor_f8c9445e275c4714, []int{0} } type LabelPair struct { @@ -82,7 +82,7 @@ func (m *LabelPair) Reset() { *m = LabelPair{} } func (m *LabelPair) String() string { return proto.CompactTextString(m) } func (*LabelPair) ProtoMessage() {} func (*LabelPair) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{0} + return fileDescriptor_f8c9445e275c4714, []int{0} } func (m *LabelPair) XXX_Unmarshal(b []byte) error { @@ -128,7 +128,7 @@ func (m *Gauge) Reset() { *m = Gauge{} } func (m *Gauge) String() string { return proto.CompactTextString(m) } func (*Gauge) ProtoMessage() {} func (*Gauge) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{1} + return fileDescriptor_f8c9445e275c4714, []int{1} } func (m *Gauge) XXX_Unmarshal(b []byte) error { @@ -168,7 +168,7 @@ func (m *Counter) Reset() { *m = Counter{} } func (m *Counter) String() string { return proto.CompactTextString(m) } func (*Counter) ProtoMessage() {} func (*Counter) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{2} + return fileDescriptor_f8c9445e275c4714, []int{2} } func (m *Counter) XXX_Unmarshal(b []byte) error { @@ -215,7 +215,7 @@ func (m *Quantile) Reset() { *m = Quantile{} } func (m *Quantile) String() string { return proto.CompactTextString(m) } func (*Quantile) ProtoMessage() {} func (*Quantile) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{3} + return fileDescriptor_f8c9445e275c4714, []int{3} } func (m *Quantile) XXX_Unmarshal(b []byte) error { @@ -263,7 +263,7 @@ func (m *Summary) Reset() { *m = Summary{} } func (m *Summary) String() string { return proto.CompactTextString(m) } func (*Summary) ProtoMessage() {} func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{4} + return fileDescriptor_f8c9445e275c4714, []int{4} } func (m *Summary) XXX_Unmarshal(b []byte) error { @@ -316,7 +316,7 @@ func (m *Untyped) Reset() { *m = Untyped{} } func (m *Untyped) String() string { return proto.CompactTextString(m) } func (*Untyped) ProtoMessage() {} func (*Untyped) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{5} + return fileDescriptor_f8c9445e275c4714, []int{5} } func (m *Untyped) XXX_Unmarshal(b []byte) error { @@ -357,7 +357,7 @@ func (m *Histogram) Reset() { *m = Histogram{} } func (m *Histogram) String() string { return proto.CompactTextString(m) } func (*Histogram) ProtoMessage() {} func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{6} + return fileDescriptor_f8c9445e275c4714, []int{6} } func (m *Histogram) XXX_Unmarshal(b []byte) error { @@ -412,7 +412,7 @@ func (m *Bucket) Reset() { *m = Bucket{} } func (m *Bucket) String() string { return proto.CompactTextString(m) } func (*Bucket) ProtoMessage() {} func (*Bucket) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{7} + return fileDescriptor_f8c9445e275c4714, []int{7} } func (m *Bucket) XXX_Unmarshal(b []byte) error { @@ -467,7 +467,7 @@ func (m *Exemplar) Reset() { *m = Exemplar{} } func (m *Exemplar) String() string { return proto.CompactTextString(m) } func (*Exemplar) ProtoMessage() {} func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{8} + return fileDescriptor_f8c9445e275c4714, []int{8} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { @@ -526,7 +526,7 @@ func (m *Metric) Reset() { *m = Metric{} } func (m *Metric) String() string { return proto.CompactTextString(m) } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{9} + return fileDescriptor_f8c9445e275c4714, []int{9} } func (m *Metric) XXX_Unmarshal(b []byte) error { @@ -610,7 +610,7 @@ func (m *MetricFamily) Reset() { *m = MetricFamily{} } func (m *MetricFamily) String() string { return proto.CompactTextString(m) } func (*MetricFamily) ProtoMessage() {} func (*MetricFamily) Descriptor() ([]byte, []int) { - return fileDescriptor_6039342a2ba47b72, []int{10} + return fileDescriptor_f8c9445e275c4714, []int{10} } func (m *MetricFamily) XXX_Unmarshal(b []byte) error { @@ -674,50 +674,50 @@ func init() { proto.RegisterType((*MetricFamily)(nil), "io.prometheus.client.MetricFamily") } -func init() { proto.RegisterFile("metrics.proto", fileDescriptor_6039342a2ba47b72) } - -var fileDescriptor_6039342a2ba47b72 = []byte{ - // 665 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xfd, 0xdc, 0x38, 0x3f, 0xbe, 0x69, 0x3f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0xda, 0x1d, 0xe8, 0x29, 0x58, 0x45, 0x42, 0xb4, 0xac, 0x2d, 0x57, - 0x65, 0xc8, 0xcd, 0x33, 0xe4, 0x4e, 0x72, 0x04, 0x2e, 0xc1, 0xce, 0xcf, 0x35, 0x68, 0x8c, 0x64, - 0x22, 0xff, 0x56, 0xd1, 0x63, 0xa8, 0x07, 0x22, 0x53, 0x3a, 0x10, 0x77, 0xab, 0x69, 0x32, 0x76, - 0x58, 0x21, 0xd1, 0x13, 0x68, 0xfa, 0x2a, 0x67, 0x5a, 0xec, 0x76, 0x35, 0x49, 0x87, 0x11, 0xe7, - 0x68, 0x41, 0xcc, 0x54, 0x08, 0x6c, 0xf3, 0x36, 0xa2, 0x4e, 0x0a, 0xce, 0xd1, 0x82, 0xc8, 0x95, - 0x69, 0xed, 0xfa, 0x6d, 0x44, 0xed, 0x6c, 0x9c, 0xa3, 0xd1, 0x0b, 0xb0, 0x16, 0xb9, 0x97, 0xed, - 0xa6, 0xa4, 0xde, 0x70, 0x31, 0x85, 0xe5, 0x71, 0xc9, 0x10, 0xee, 0x2f, 0xee, 0x7a, 0x46, 0x33, - 0xbb, 0xd1, 0x33, 0x76, 0x6a, 0xb8, 0x5d, 0xd4, 0x46, 0x99, 0xf3, 0xc3, 0x80, 0x75, 0xf5, 0x07, - 0x5e, 0x79, 0x34, 0x8c, 0x56, 0x95, 0xcf, 0x19, 0x02, 0x73, 0x41, 0xa2, 0x44, 0xbf, 0x66, 0x72, - 0x8d, 0xf6, 0xc0, 0x14, 0x1a, 0xe5, 0x15, 0xfe, 0xbf, 0xdb, 0xab, 0x56, 0xa5, 0x26, 0x4f, 0x56, - 0x09, 0xc1, 0x12, 0x2d, 0xd2, 0xa4, 0x5e, 0x60, 0xdb, 0xbc, 0x2d, 0x4d, 0x8a, 0x87, 0x35, 0xf6, - 0xd1, 0x08, 0xa0, 0x9c, 0x84, 0xda, 0xd0, 0x3c, 0x3e, 0x9b, 0x9e, 0x4e, 0x06, 0xb8, 0xf3, 0x1f, - 0xb2, 0xa0, 0x3e, 0x3c, 0x9c, 0x0e, 0x07, 0x1d, 0x43, 0xd4, 0xc7, 0xd3, 0xd1, 0xe8, 0x10, 0x5f, - 0x74, 0xd6, 0xc4, 0x66, 0x7a, 0x3a, 0xb9, 0x38, 0x1f, 0xbc, 0xec, 0xd4, 0xd0, 0x06, 0x58, 0x27, - 0xaf, 0xc7, 0x93, 0xb3, 0x21, 0x3e, 0x1c, 0x75, 0xcc, 0x23, 0x0c, 0x95, 0xef, 0xfe, 0xbb, 0x83, - 0x20, 0x64, 0x0b, 0x3e, 0x77, 0xfd, 0x98, 0xf6, 0xcb, 0x6e, 0x5f, 0x75, 0x67, 0x34, 0xbe, 0x24, - 0x51, 0x3f, 0x88, 0x9f, 0x85, 0xf1, 0xac, 0xec, 0xce, 0x54, 0xf7, 0x57, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xd0, 0x84, 0x91, 0x73, 0x59, 0x06, 0x00, 0x00, +func init() { proto.RegisterFile("io_prometheus_client_metrics.proto", fileDescriptor_f8c9445e275c4714) } + +var fileDescriptor_f8c9445e275c4714 = []byte{ + // 668 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xd3, 0x40, + 0x14, 0xc4, 0x8d, 0xf3, 0xe1, 0x97, 0x02, 0xd1, 0xaa, 0x07, 0xab, 0x50, 0x12, 0x7c, 0x2a, 0x1c, + 0x1c, 0x51, 0xb5, 0x02, 0x15, 0x38, 0xb4, 0x25, 0xa4, 0x48, 0xa4, 0x2d, 0x9b, 0xe4, 0x50, 0x38, + 0x44, 0x8e, 0xbb, 0x38, 0x16, 0xde, 0xd8, 0xd8, 0xbb, 0x15, 0x39, 0x73, 0xe0, 0x0a, 0x7f, 0x81, + 0x3f, 0x0a, 0xda, 0x0f, 0xdb, 0x54, 0x72, 0x2b, 0x81, 0xb8, 0xed,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d4, 0x31, + 0x0f, 0x31, 0x54, 0xbe, 0xfb, 0xef, 0xf7, 0x83, 0x90, 0x2d, 0xf8, 0xdc, 0xf5, 0x63, 0xda, 0x2f, + 0x4f, 0xfb, 0xf9, 0x97, 0x23, 0xbe, 0x20, 0x51, 0x3f, 0x88, 0x9f, 0x57, 0x7d, 0x57, 0x7e, 0x07, + 0x00, 0x00, 0xff, 0xff, 0xd7, 0x55, 0x72, 0xeb, 0x6e, 0x06, 0x00, 0x00, } diff --git a/metrics.proto b/io_prometheus_client_metrics.proto similarity index 100% rename from metrics.proto rename to io_prometheus_client_metrics.proto From 147c58e9608a4f9628b53b6cc863325ca746f63a Mon Sep 17 00:00:00 2001 From: bufdev <4228796+bufdev@users.noreply.github.com> Date: Mon, 7 Jun 2021 17:07:12 -0400 Subject: [PATCH 05/19] Move .proto file and add caching of protoc and protoc-gen-go during build (#46) Signed-off-by: bufdev --- .gitignore | 1 + Makefile | 69 ++++++++-- go.mod | 5 +- go.sum | 6 +- ...eus_client_metrics.pb.go => metrics.pb.go} | 120 +++++++++--------- .../prometheus/client/metrics.proto | 0 6 files changed, 126 insertions(+), 75 deletions(-) rename go/{io_prometheus_client_metrics.pb.go => metrics.pb.go} (79%) rename io_prometheus_client_metrics.proto => io/prometheus/client/metrics.proto (100%) diff --git a/.gitignore b/.gitignore index 2f7896d..9fbc864 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ target/ +tmp/ diff --git a/Makefile b/Makefile index c98d575..cb9e041 100644 --- a/Makefile +++ b/Makefile @@ -11,18 +11,71 @@ # See the License for the specific language governing permissions and # limitations under the License. -KEY_ID ?= _DEFINE_ME_ +all: + $(MAKE) go + $(MAKE) build -all: go +GO_FILE := go/metrics.pb.go +PROTO_FILE := io/prometheus/client/metrics.proto -SUFFIXES: +# Need to be on a previous version that doesn't cause the updated WKT go_package values to be added. +PROTOC_VERSION := 3.13.0 +# This has been around for a while. +PROTOC_GEN_GO_VERSION := v1.3.5 -go: go/metrics.pb.go +# There are no protobuf releases for Darwin ARM so for +# now we always use the x86_64 release through Rosetta. +UNAME_OS := $(shell uname -s) +UNAME_ARCH := $(shell uname -m) +ifeq ($(UNAME_OS),Darwin) +PROTOC_OS := osx +PROTOC_ARCH := x86_64 +endif +ifeq ($(UNAME_OS),Linux) +PROTOC_OS = linux +PROTOC_ARCH := $(UNAME_ARCH) +endif +PROTOC := tmp/versions/protoc/$(PROTOC_VERSION) +PROTOC_BIN := tmp/bin/protoc +PROTOC_INCLUDE := tmp/include/google +$(PROTOC): + @if ! command -v curl >/dev/null 2>/dev/null; then echo "error: curl must be installed" >&2; exit 1; fi + @if ! command -v unzip >/dev/null 2>/dev/null; then echo "error: unzip must be installed" >&2; exit 1; fi + @rm -f $(PROTOC_BIN) + @rm -rf $(PROTOC_INCLUDE) + @mkdir -p $(dir $(PROTOC_BIN)) $(dir $(PROTOC_INCLUDE)) + $(eval PROTOC_TMP := $(shell mktemp -d)) + cd $(PROTOC_TMP); curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-$(PROTOC_OS)-$(PROTOC_ARCH).zip -o protoc.zip + cd $(PROTOC_TMP); unzip protoc.zip && mv bin/protoc $(PWD)/$(PROTOC_BIN) && mv include/google $(PWD)/$(PROTOC_INCLUDE) + @rm -rf $(PROTOC_TMP) + @rm -rf $(dir $(PROTOC)) + @mkdir -p $(dir $(PROTOC)) + @touch $(PROTOC) -go/metrics.pb.go: io_prometheus_client_metrics.proto - protoc $< --go_out=import_path=github.com/prometheus/client_model/,paths=source_relative:go/ +PROTOC_GEN_GO := tmp/versions/protoc-gen-go/$(PROTOC_GEN_GO_VERSION) +PROTOC_GEN_GO_BIN := tmp/bin/protoc-gen-go +$(PROTOC_GEN_GO): + @rm -f $(PROTOC_GEN_GO_BIN) + @mkdir -p $(dir $(PROTOC_GEN_GO_BIN)) + $(eval PROTOC_GEN_GO_TMP := $(shell mktemp -d)) + cd $(PROTOC_GEN_GO_TMP); GOBIN=$(PWD)/$(dir $(PROTOC_GEN_GO_BIN)) go get github.com/golang/protobuf/protoc-gen-go@$(PROTOC_GEN_GO_VERSION) + @rm -rf $(PROTOC_GEN_GO_TMP) + @rm -rf $(dir $(PROTOC_GEN_GO)) + @mkdir -p $(dir $(PROTOC_GEN_GO)) + @touch $(PROTOC_GEN_GO) + +go: $(GO_FILE) + +$(GO_FILE): $(PROTO_FILE) $(PROTOC_GEN_GO) $(PROTOC) + @rm -rf $(dir $(GO_FILE)) tmp/go + @mkdir -p $(dir $(GO_FILE)) tmp/go + PATH=$(PWD)/tmp/bin:$$PATH protoc -I tmp/include -I . --go_out=paths=source_relative:tmp/go $(PROTO_FILE) + @mv tmp/go/$(patsubst %.proto,%.pb.go,$(PROTO_FILE)) $(GO_FILE) + +build: $(GO_FILE) + go build ./go clean: - -rm -rf go/* + -rm -rf go tmp -.PHONY: all clean go +.PHONY: all clean go build diff --git a/go.mod b/go.mod index e7e0a86..c4b4c16 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,4 @@ module github.com/prometheus/client_model go 1.9 -require ( - github.com/golang/protobuf v1.2.0 - golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect -) +require github.com/golang/protobuf v1.3.5 diff --git a/go.sum b/go.sum index 9c84c90..6124ed3 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,2 @@ -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= diff --git a/go/io_prometheus_client_metrics.pb.go b/go/metrics.pb.go similarity index 79% rename from go/io_prometheus_client_metrics.pb.go rename to go/metrics.pb.go index 5764344..a255337 100644 --- a/go/io_prometheus_client_metrics.pb.go +++ b/go/metrics.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: io_prometheus_client_metrics.proto +// source: io/prometheus/client/metrics.proto package io_prometheus_client @@ -67,7 +67,7 @@ func (x *MetricType) UnmarshalJSON(data []byte) error { } func (MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{0} + return fileDescriptor_d1e5ddb18987a258, []int{0} } type LabelPair struct { @@ -82,7 +82,7 @@ func (m *LabelPair) Reset() { *m = LabelPair{} } func (m *LabelPair) String() string { return proto.CompactTextString(m) } func (*LabelPair) ProtoMessage() {} func (*LabelPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{0} + return fileDescriptor_d1e5ddb18987a258, []int{0} } func (m *LabelPair) XXX_Unmarshal(b []byte) error { @@ -128,7 +128,7 @@ func (m *Gauge) Reset() { *m = Gauge{} } func (m *Gauge) String() string { return proto.CompactTextString(m) } func (*Gauge) ProtoMessage() {} func (*Gauge) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{1} + return fileDescriptor_d1e5ddb18987a258, []int{1} } func (m *Gauge) XXX_Unmarshal(b []byte) error { @@ -168,7 +168,7 @@ func (m *Counter) Reset() { *m = Counter{} } func (m *Counter) String() string { return proto.CompactTextString(m) } func (*Counter) ProtoMessage() {} func (*Counter) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{2} + return fileDescriptor_d1e5ddb18987a258, []int{2} } func (m *Counter) XXX_Unmarshal(b []byte) error { @@ -215,7 +215,7 @@ func (m *Quantile) Reset() { *m = Quantile{} } func (m *Quantile) String() string { return proto.CompactTextString(m) } func (*Quantile) ProtoMessage() {} func (*Quantile) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{3} + return fileDescriptor_d1e5ddb18987a258, []int{3} } func (m *Quantile) XXX_Unmarshal(b []byte) error { @@ -263,7 +263,7 @@ func (m *Summary) Reset() { *m = Summary{} } func (m *Summary) String() string { return proto.CompactTextString(m) } func (*Summary) ProtoMessage() {} func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{4} + return fileDescriptor_d1e5ddb18987a258, []int{4} } func (m *Summary) XXX_Unmarshal(b []byte) error { @@ -316,7 +316,7 @@ func (m *Untyped) Reset() { *m = Untyped{} } func (m *Untyped) String() string { return proto.CompactTextString(m) } func (*Untyped) ProtoMessage() {} func (*Untyped) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{5} + return fileDescriptor_d1e5ddb18987a258, []int{5} } func (m *Untyped) XXX_Unmarshal(b []byte) error { @@ -357,7 +357,7 @@ func (m *Histogram) Reset() { *m = Histogram{} } func (m *Histogram) String() string { return proto.CompactTextString(m) } func (*Histogram) ProtoMessage() {} func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{6} + return fileDescriptor_d1e5ddb18987a258, []int{6} } func (m *Histogram) XXX_Unmarshal(b []byte) error { @@ -412,7 +412,7 @@ func (m *Bucket) Reset() { *m = Bucket{} } func (m *Bucket) String() string { return proto.CompactTextString(m) } func (*Bucket) ProtoMessage() {} func (*Bucket) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{7} + return fileDescriptor_d1e5ddb18987a258, []int{7} } func (m *Bucket) XXX_Unmarshal(b []byte) error { @@ -467,7 +467,7 @@ func (m *Exemplar) Reset() { *m = Exemplar{} } func (m *Exemplar) String() string { return proto.CompactTextString(m) } func (*Exemplar) ProtoMessage() {} func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{8} + return fileDescriptor_d1e5ddb18987a258, []int{8} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { @@ -526,7 +526,7 @@ func (m *Metric) Reset() { *m = Metric{} } func (m *Metric) String() string { return proto.CompactTextString(m) } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{9} + return fileDescriptor_d1e5ddb18987a258, []int{9} } func (m *Metric) XXX_Unmarshal(b []byte) error { @@ -610,7 +610,7 @@ func (m *MetricFamily) Reset() { *m = MetricFamily{} } func (m *MetricFamily) String() string { return proto.CompactTextString(m) } func (*MetricFamily) ProtoMessage() {} func (*MetricFamily) Descriptor() ([]byte, []int) { - return fileDescriptor_f8c9445e275c4714, []int{10} + return fileDescriptor_d1e5ddb18987a258, []int{10} } func (m *MetricFamily) XXX_Unmarshal(b []byte) error { @@ -674,50 +674,52 @@ func init() { proto.RegisterType((*MetricFamily)(nil), "io.prometheus.client.MetricFamily") } -func init() { proto.RegisterFile("io_prometheus_client_metrics.proto", fileDescriptor_f8c9445e275c4714) } - -var fileDescriptor_f8c9445e275c4714 = []byte{ - // 668 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xd3, 0x40, - 0x14, 0xc4, 0x8d, 0xf3, 0xe1, 0x97, 0x02, 0xd1, 0xaa, 0x07, 0xab, 0x50, 0x12, 0x7c, 0x2a, 0x1c, - 0x1c, 0x51, 0xb5, 0x02, 0x15, 0x38, 0xb4, 0x25, 0xa4, 0x48, 0xa4, 0x2d, 0x9b, 0xe4, 0x50, 0x38, - 0x44, 0x8e, 0xbb, 0x38, 0x16, 0xde, 0xd8, 0xd8, 0xbb, 0x15, 0x39, 0x73, 0xe0, 0x0a, 0x7f, 0x81, - 0x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0xdb, 0x60, 0x1d, 0xbf, 0x19, 0x4f, 0x4e, 0x87, 0xf8, 0x60, 0xd4, 0x31, - 0x0f, 0x31, 0x54, 0xbe, 0xfb, 0xef, 0xf7, 0x83, 0x90, 0x2d, 0xf8, 0xdc, 0xf5, 0x63, 0xda, 0x2f, - 0x4f, 0xfb, 0xf9, 0x97, 0x23, 0xbe, 0x20, 0x51, 0x3f, 0x88, 0x9f, 0x57, 0x7d, 0x57, 0x7e, 0x07, - 0x00, 0x00, 0xff, 0xff, 0xd7, 0x55, 0x72, 0xeb, 0x6e, 0x06, 0x00, 0x00, +func init() { + proto.RegisterFile("io/prometheus/client/metrics.proto", fileDescriptor_d1e5ddb18987a258) +} + +var fileDescriptor_d1e5ddb18987a258 = []byte{ + // 672 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xfd, 0xdc, 0x38, 0x3f, 0xbe, 0xe9, 0x07, 0xd1, 0xa8, 0x0b, 0xab, 0x50, 0x12, 0xbc, 0x2a, + 0x2c, 0x1c, 0x51, 0xb5, 0x02, 0x15, 0x58, 0xb4, 0x25, 0xa4, 0x48, 0xa4, 0x2d, 0x93, 0x64, 0x51, + 0x58, 0x44, 0x8e, 0x3b, 0x38, 0x16, 0x9e, 0x8c, 0xb1, 0x3d, 0x15, 0x59, 0xb3, 0x60, 0x0b, 0xaf, + 0xc0, 0x8b, 0x82, 0xe6, 0xc7, 0x36, 0x15, 0x6e, 0x25, 0x10, 0xbb, 0x99, 0x3b, 0xe7, 0x5c, 0x9f, + 0x3b, 0x39, 0x67, 0x02, 0x4e, 0xc8, 0xfa, 0x71, 0xc2, 0x28, 0xc9, 0x16, 0x84, 0xa7, 0x7d, 0x3f, + 0x0a, 0xc9, 0x32, 0xeb, 0x53, 0x92, 0x25, 0xa1, 0x9f, 0xba, 0x71, 0xc2, 0x32,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, 0xf4, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x33, 0xa8, 0xbc, 0x6e, 0x06, 0x00, 0x00, } diff --git a/io_prometheus_client_metrics.proto b/io/prometheus/client/metrics.proto similarity index 100% rename from io_prometheus_client_metrics.proto rename to io/prometheus/client/metrics.proto From bbaf1cc17b1504419b345cdddd4c363b8950a280 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Fri, 11 Jun 2021 00:00:27 +0200 Subject: [PATCH 06/19] Switch to base 2 and powers of 2 for resolution This follows what looks to be the winning proposal in https://github.com/open-telemetry/oteps/pull/149 See more detail in upcoming commit for prometheus/client_golang. Signed-off-by: beorn7 --- go/metrics.pb.go | 121 +++++++++++++++-------------- io/prometheus/client/metrics.proto | 7 +- 2 files changed, 69 insertions(+), 59 deletions(-) diff --git a/go/metrics.pb.go b/go/metrics.pb.go index 4649de7..dcd58b4 100644 --- a/go/metrics.pb.go +++ b/go/metrics.pb.go @@ -349,7 +349,12 @@ type Histogram struct { SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` // Sparse bucket (sb) stuff: - SbResolution *uint32 `protobuf:"varint,4,opt,name=sb_resolution,json=sbResolution" json:"sb_resolution,omitempty"` + // The sb_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" json:"sb_schema,omitempty"` SbZeroThreshold *float64 `protobuf:"fixed64,5,opt,name=sb_zero_threshold,json=sbZeroThreshold" json:"sb_zero_threshold,omitempty"` SbZeroCount *uint64 `protobuf:"varint,6,opt,name=sb_zero_count,json=sbZeroCount" json:"sb_zero_count,omitempty"` SbNegative *SparseBuckets `protobuf:"bytes,7,opt,name=sb_negative,json=sbNegative" json:"sb_negative,omitempty"` @@ -405,9 +410,9 @@ func (m *Histogram) GetBucket() []*Bucket { return nil } -func (m *Histogram) GetSbResolution() uint32 { - if m != nil && m.SbResolution != nil { - return *m.SbResolution +func (m *Histogram) GetSbSchema() int32 { + if m != nil && m.SbSchema != nil { + return *m.SbSchema } return 0 } @@ -816,58 +821,58 @@ func init() { } var fileDescriptor_d1e5ddb18987a258 = []byte{ - // 847 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x8f, 0xdb, 0x44, - 0x14, 0xc6, 0x1b, 0xe7, 0xd7, 0xcb, 0x86, 0xa6, 0xa3, 0x0a, 0x45, 0x0b, 0xcb, 0x06, 0xf7, 0xb2, - 0xf4, 0xe0, 0x88, 0xaa, 0x05, 0x54, 0xca, 0x61, 0xb7, 0x5d, 0xb6, 0x48, 0x64, 0xbb, 0x4c, 0x92, - 0x43, 0xcb, 0xc1, 0xb2, 0x93, 0x59, 0xc7, 0x62, 0xc6, 0x63, 0x3c, 0x33, 0x15, 0xcb, 0x19, 0x89, - 0x2b, 0x9c, 0xb9, 0xf1, 0x8f, 0x82, 0xe6, 0x87, 0x1d, 0x56, 0x38, 0x88, 0x45, 0xbd, 0xcd, 0x7b, - 0xf3, 0x7d, 0xcf, 0xdf, 0x9b, 0xf1, 0xfb, 0x06, 0x82, 0x8c, 0x4f, 0x8b, 0x92, 0x33, 0x22, 0x37, - 0x44, 0x89, 0xe9, 0x8a, 0x66, 0x24, 0x97, 0x53, 0x46, 0x64, 0x99, 0xad, 0x44, 0x58, 0x94, 0x5c, - 0x72, 0x74, 0x2f, 0xe3, 0xe1, 0x16, 0x13, 0x5a, 0xcc, 0xc1, 0x51, 0xca, 0x79, 0x4a, 0xc9, 0xd4, - 0x60,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 0x06, 0xcf, + 0xb8, 0xcc, 0x2b, 0x5a, 0xb6, 0x03, 0xd0, 0x13, 0x18, 0xd2, 0x1f, 0x29, 0x2b, 0x32, 0x52, 0xea, + 0xc2, 0xa3, 0x87, 0x1f, 0x04, 0x6d, 0x0d, 0x04, 0x67, 0x16, 0x85, 0x1b, 0xbc, 0xff, 0x14, 0x86, + 0xdf, 0x4a, 0x92, 0x57, 0x69, 0x46, 0xd1, 0x01, 0x0c, 0x7f, 0xb0, 0xdf, 0xf6, 0x07, 0x4d, 0x7c, + 0x53, 0x79, 0x23, 0xed, 0x67, 0x07, 0x06, 0x0b, 0xc9, 0x18, 0x29, 0xaf, 0xd1, 0x87, 0x70, 0x47, + 0x10, 0x56, 0x64, 0x34, 0x5c, 0x2b, 0xb5, 0xba, 0x82, 0x8b, 0x47, 0x26, 0xa7, 0x1b, 0x40, 0x87, + 0x00, 0x16, 0x22, 0x24, 0xb3, 0x95, 0x3c, 0x93, 0x59, 0x48, 0xa6, 0xfa, 0x68, 0xfe, 0xdf, 0x9d, + 0x76, 0x77, 0xf7, 0x51, 0x2b, 0xde, 0xea, 0xf3, 0x8f, 0x60, 0xb0, 0xca, 0xab, 0xeb, 0x82, 0x6e, + 0x76, 0x4c, 0xf1, 0x8f, 0x0e, 0x78, 0x2f, 0x52, 0x51, 0xf1, 0xb8, 0x24, 0xec, 0x2d, 0x88, 0x7d, + 0x04, 0xfd, 0x48, 0xae, 0xbf, 0xa7, 0x95, 0x95, 0xfa, 0x7e, 0xbb, 0xd4, 0x53, 0x8d, 0xc1, 0x16, + 0x8b, 0xee, 0x83, 0x27, 0xa2, 0x50, 0xac, 0x13, 0xca, 0xc8, 0xc4, 0x9d, 0x3a, 0xc7, 0xfb, 0x78, + 0x28, 0xa2, 0x85, 0x8e, 0xd1, 0x03, 0xd8, 0x17, 0x51, 0xf8, 0x13, 0x2d, 0x79, 0x58, 0x25, 0x25, + 0x15, 0x09, 0xcf, 0x36, 0x93, 0x9e, 0xfe, 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, 0xf0, 0xb0, 0xc5, 0x3e, 0x98, 0x03, 0x6c, 0x2b, 0xa1, 0x11, 0x0c, 0x9e, 0xbd, 0x5c, + 0x5d, 0x2c, 0xcf, 0xf0, 0xf8, 0x1d, 0xe4, 0x41, 0xef, 0xfc, 0x64, 0x75, 0x7e, 0x36, 0x76, 0x54, + 0x7e, 0xb1, 0x9a, 0xcf, 0x4f, 0xf0, 0xab, 0x71, 0x47, 0x05, 0xab, 0x8b, 0xe5, 0xab, 0xcb, 0xb3, + 0xe7, 0xe3, 0x2e, 0xda, 0x03, 0xef, 0xc5, 0xd7, 0x8b, 0xe5, 0xcb, 0x73, 0x7c, 0x32, 0x1f, 0xbb, + 0xa7, 0x18, 0x5a, 0x9f, 0xe3, 0xd7, 0x4f, 0xe2, 0xb4, 0x4a, 0x64, 0x14, 0xac, 0x39, 0xfb, 0xe7, + 0x83, 0x1e, 0x32, 0xbe, 0xa1, 0xd9, 0x2c, 0xe6, 0x5f, 0xa4, 0x3c, 0xdc, 0xae, 0x86, 0x66, 0xf5, + 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x8f, 0x04, 0x1a, 0x05, 0x08, 0x00, 0x00, } diff --git a/io/prometheus/client/metrics.proto b/io/prometheus/client/metrics.proto index 5d99642..7c973de 100644 --- a/io/prometheus/client/metrics.proto +++ b/io/prometheus/client/metrics.proto @@ -61,7 +61,12 @@ message Histogram { optional double sample_sum = 2; repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional. // Sparse bucket (sb) stuff: - optional uint32 sb_resolution = 4; // That many buckets per power of ten. Must be <256. Zero for no sparse buckets. + // The sb_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. + optional sint32 sb_schema = 4; optional double sb_zero_threshold = 5; // Breadth of the zero bucket. optional uint64 sb_zero_count = 6; // Count in zero bucket. optional SparseBuckets sb_negative = 7; // Negative sparse buckets. From 56ab8d94ba268763aa214e0c98a248bbcc34dc47 Mon Sep 17 00:00:00 2001 From: prombot Date: Sun, 12 Sep 2021 00:02:08 +0000 Subject: [PATCH 07/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..431fef7 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,29 @@ +name: golangci-lint +on: + push: + paths: + - "go.sum" + - "go.mod" + - "**.go" + - "scripts/errcheck_excludes.txt" + - ".github/workflows/golangci-lint.yml" + pull_request: + paths: + - "go.sum" + - "go.mod" + - "**.go" + - "scripts/errcheck_excludes.txt" + - ".github/workflows/golangci-lint.yml" + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.42.0 From a3e65514ca0d8e9b2bb1eb230cbf32e48344bff0 Mon Sep 17 00:00:00 2001 From: prombot Date: Sun, 24 Oct 2021 00:01:38 +0000 Subject: [PATCH 08/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 431fef7..f96c76a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -7,6 +7,7 @@ on: - "**.go" - "scripts/errcheck_excludes.txt" - ".github/workflows/golangci-lint.yml" + - ".golangci.yml" pull_request: paths: - "go.sum" @@ -14,6 +15,7 @@ on: - "**.go" - "scripts/errcheck_excludes.txt" - ".github/workflows/golangci-lint.yml" + - ".golangci.yml" jobs: golangci: From 2fc368cb39fcfdb2c5ab539f76bcab47b5aac4dc Mon Sep 17 00:00:00 2001 From: prombot Date: Thu, 3 Mar 2022 19:50:37 +0000 Subject: [PATCH 09/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index f96c76a..99a9ab4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -23,9 +23,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Lint uses: golangci/golangci-lint-action@v2 with: - version: v1.42.0 + version: v1.44.2 From bc75c6a2977345e96dbd05c6982ad2d28d2cc823 Mon Sep 17 00:00:00 2001 From: prombot Date: Tue, 29 Mar 2022 19:50:29 +0000 Subject: [PATCH 10/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 99a9ab4..8211b9a 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -9,13 +9,6 @@ on: - ".github/workflows/golangci-lint.yml" - ".golangci.yml" pull_request: - paths: - - "go.sum" - - "go.mod" - - "**.go" - - "scripts/errcheck_excludes.txt" - - ".github/workflows/golangci-lint.yml" - - ".golangci.yml" jobs: golangci: @@ -24,8 +17,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - + - name: install Go + uses: actions/setup-go@v2 + with: + go-version: 1.17.x - name: Lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3.1.0 with: version: v1.44.2 From a227486945b8dcb32f8072aaabd430d5b72c170c Mon Sep 17 00:00:00 2001 From: prombot Date: Thu, 31 Mar 2022 19:50:44 +0000 Subject: [PATCH 11/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8211b9a..662ea3b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,8 +20,8 @@ jobs: - name: install Go uses: actions/setup-go@v2 with: - go-version: 1.17.x + go-version: 1.18.x - name: Lint uses: golangci/golangci-lint-action@v3.1.0 with: - version: v1.44.2 + version: v1.45.2 From f60d1ac733d3ea2a39d13d875ce9b83471fb9994 Mon Sep 17 00:00:00 2001 From: prombot Date: Tue, 3 May 2022 19:50:35 +0000 Subject: [PATCH 12/19] Update common Prometheus files Signed-off-by: prombot --- CODE_OF_CONDUCT.md | 4 ++-- SECURITY.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9a1aff4..d325872 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,3 @@ -## Prometheus Community Code of Conduct +# Prometheus Community Code of Conduct -Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). +Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). diff --git a/SECURITY.md b/SECURITY.md index 67741f0..fed02d8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,4 +3,4 @@ The Prometheus security policy, including how to report vulnerabilities, can be found here: -https://prometheus.io/docs/operating/security/ + From 6b8c74289eedd4c6612480457a99fe4756207b2f Mon Sep 17 00:00:00 2001 From: prombot Date: Fri, 6 May 2022 11:02:16 +0000 Subject: [PATCH 13/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 662ea3b..136d7d4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -21,6 +21,9 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.18.x + - name: Install snmp_exporter/generator dependencies + run: sudo apt-get update && sudo apt-get -y install libsnmp-dev + if: github.repository == 'prometheus/snmp_exporter' - name: Lint uses: golangci/golangci-lint-action@v3.1.0 with: From 942d53ce18b58b1c70716e701cbc03d08fb0277e Mon Sep 17 00:00:00 2001 From: prombot Date: Thu, 2 Jun 2022 19:50:36 +0000 Subject: [PATCH 14/19] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 136d7d4..6034bcb 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,6 +25,6 @@ jobs: run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' - name: Lint - uses: golangci/golangci-lint-action@v3.1.0 + uses: golangci/golangci-lint-action@v3.2.0 with: version: v1.45.2 From 8171e83b1d1064c0f3f38e7a7ee3b13543bead25 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 14 Jun 2022 19:45:23 +0200 Subject: [PATCH 15/19] Add float histograms and gauge histograms to proto spec Note that this is only an extension of the proto spec. Both generators and consumers of the protobuf still need changes to make use of these changes. Gauge histograms measure current distributions. For one, they are inspired by the GaugeHistogram type introducted by OpenMetrics, see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#gaugehistogram They are also handled in the same way as OpenMetrics does it, by using a new MetricType enum field GAUGE_HISTOGRAM, but not changing anything else, i.e. for both regular and gauge histograms, the same Histogram message type is used. The other reason why we need gauge histograms comes from PromQL: If you `rate` a histogram (which is possible with the new sparse histograms as 1st class data type), the result is a gauge histogram. A rate'd histogram can be created by a recording rule and then stored in the TSDB. From there, it can be exposed by federation, so we need to be able to represent it in the exposition format. Float histograms are histograms where all counts (count of observations, counts in each bucket, zero bucket count) are floating point numbers rather than integer numbers. They are rarely needed for direct instrumentation. Use cases are weighted histograms or timing histograms, see https://github.com/kubernetes/kubernetes/pull/109277 for a real-world example. However, float histograms happen all the time as results of PromQL expressions. Following the same line of argument as above, those float histograms can end up in the TSDB via recording rules, which means they can be exposed via federation. Note that float histograms are implicitly supported by the original Prometheus text format, as this format simply uses floating point numbers for all sample values. OpenMetrics has avoided this ambiguity and has specified integers for bucket counts and the count of observations in a histogram, which means it needs to be extended to support float histograms, similar to how this commit extends the original Prometheus protobuf format. Signed-off-by: beorn7 --- go/metrics.pb.go | 190 ++++++++++++++++++----------- io/prometheus/client/metrics.proto | 47 ++++--- 2 files changed, 149 insertions(+), 88 deletions(-) diff --git a/go/metrics.pb.go b/go/metrics.pb.go index dcd58b4..8fca0a8 100644 --- a/go/metrics.pb.go +++ b/go/metrics.pb.go @@ -24,11 +24,18 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type MetricType int32 const ( - MetricType_COUNTER MetricType = 0 - MetricType_GAUGE MetricType = 1 - MetricType_SUMMARY MetricType = 2 - MetricType_UNTYPED MetricType = 3 + // COUNTER must use the Metric field "counter". + MetricType_COUNTER MetricType = 0 + // GAUGE must use the Metric field "gauge". + MetricType_GAUGE MetricType = 1 + // SUMMARY must use the Metric field "summary". + MetricType_SUMMARY MetricType = 2 + // UNTYPED must use the Metric field "untyped". + MetricType_UNTYPED MetricType = 3 + // HISTOGRAM must use the Metric field "histogram". MetricType_HISTOGRAM MetricType = 4 + // GAUGE_HISTOGRAM must use the Metric field "histogram". + MetricType_GAUGE_HISTOGRAM MetricType = 5 ) var MetricType_name = map[int32]string{ @@ -37,14 +44,16 @@ var MetricType_name = map[int32]string{ 2: "SUMMARY", 3: "UNTYPED", 4: "HISTOGRAM", + 5: "GAUGE_HISTOGRAM", } var MetricType_value = map[string]int32{ - "COUNTER": 0, - "GAUGE": 1, - "SUMMARY": 2, - "UNTYPED": 3, - "HISTOGRAM": 4, + "COUNTER": 0, + "GAUGE": 1, + "SUMMARY": 2, + "UNTYPED": 3, + "HISTOGRAM": 4, + "GAUGE_HISTOGRAM": 5, } func (x MetricType) Enum() *MetricType { @@ -345,9 +354,10 @@ func (m *Untyped) GetValue() float64 { } type Histogram struct { - SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` - SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` - Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` + SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` + SampleCountFloat *float64 `protobuf:"fixed64,9,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"` + SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` + Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" json:"bucket,omitempty"` // Sparse bucket (sb) stuff: // The sb_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 @@ -357,6 +367,7 @@ type Histogram struct { SbSchema *int32 `protobuf:"zigzag32,4,opt,name=sb_schema,json=sbSchema" json:"sb_schema,omitempty"` SbZeroThreshold *float64 `protobuf:"fixed64,5,opt,name=sb_zero_threshold,json=sbZeroThreshold" json:"sb_zero_threshold,omitempty"` SbZeroCount *uint64 `protobuf:"varint,6,opt,name=sb_zero_count,json=sbZeroCount" json:"sb_zero_count,omitempty"` + SbZeroCountFloat *float64 `protobuf:"fixed64,10,opt,name=sb_zero_count_float,json=sbZeroCountFloat" json:"sb_zero_count_float,omitempty"` SbNegative *SparseBuckets `protobuf:"bytes,7,opt,name=sb_negative,json=sbNegative" json:"sb_negative,omitempty"` SbPositive *SparseBuckets `protobuf:"bytes,8,opt,name=sb_positive,json=sbPositive" json:"sb_positive,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -396,6 +407,13 @@ func (m *Histogram) GetSampleCount() uint64 { return 0 } +func (m *Histogram) GetSampleCountFloat() float64 { + if m != nil && m.SampleCountFloat != nil { + return *m.SampleCountFloat + } + return 0 +} + func (m *Histogram) GetSampleSum() float64 { if m != nil && m.SampleSum != nil { return *m.SampleSum @@ -431,6 +449,13 @@ func (m *Histogram) GetSbZeroCount() uint64 { return 0 } +func (m *Histogram) GetSbZeroCountFloat() float64 { + if m != nil && m.SbZeroCountFloat != nil { + return *m.SbZeroCountFloat + } + return 0 +} + func (m *Histogram) GetSbNegative() *SparseBuckets { if m != nil { return m.SbNegative @@ -447,6 +472,7 @@ func (m *Histogram) GetSbPositive() *SparseBuckets { type Bucket struct { CumulativeCount *uint64 `protobuf:"varint,1,opt,name=cumulative_count,json=cumulativeCount" json:"cumulative_count,omitempty"` + CumulativeCountFloat *float64 `protobuf:"fixed64,4,opt,name=cumulative_count_float,json=cumulativeCountFloat" json:"cumulative_count_float,omitempty"` UpperBound *float64 `protobuf:"fixed64,2,opt,name=upper_bound,json=upperBound" json:"upper_bound,omitempty"` Exemplar *Exemplar `protobuf:"bytes,3,opt,name=exemplar" json:"exemplar,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -486,6 +512,13 @@ func (m *Bucket) GetCumulativeCount() uint64 { return 0 } +func (m *Bucket) GetCumulativeCountFloat() float64 { + if m != nil && m.CumulativeCountFloat != nil { + return *m.CumulativeCountFloat + } + return 0 +} + func (m *Bucket) GetUpperBound() float64 { if m != nil && m.UpperBound != nil { return *m.UpperBound @@ -501,11 +534,14 @@ func (m *Bucket) GetExemplar() *Exemplar { } type SparseBuckets struct { - Span []*SparseBuckets_Span `protobuf:"bytes,1,rep,name=span" json:"span,omitempty"` - Delta []int64 `protobuf:"zigzag64,2,rep,name=delta" json:"delta,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Span []*SparseBuckets_Span `protobuf:"bytes,1,rep,name=span" 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,name=delta" json:"delta,omitempty"` + Count []float64 `protobuf:"fixed64,3,rep,name=count" json:"count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SparseBuckets) Reset() { *m = SparseBuckets{} } @@ -547,6 +583,13 @@ func (m *SparseBuckets) GetDelta() []int64 { return nil } +func (m *SparseBuckets) GetCount() []float64 { + if m != nil { + return m.Count + } + return nil +} + type SparseBuckets_Span struct { Offset *int32 `protobuf:"zigzag32,1,opt,name=offset" json:"offset,omitempty"` Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` @@ -821,58 +864,63 @@ func init() { } var fileDescriptor_d1e5ddb18987a258 = []byte{ - // 846 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xc6, 0xbb, 0xde, 0x1f, 0x7e, 0xdb, 0xd0, 0xcd, 0xa8, 0x42, 0xab, 0x94, 0x90, 0xc5, 0x5c, - 0x42, 0x0f, 0x5e, 0x51, 0xb5, 0x80, 0x4a, 0x39, 0x24, 0x6d, 0x48, 0x91, 0xd8, 0x34, 0xcc, 0xee, - 0x1e, 0x5a, 0x0e, 0xd6, 0x78, 0x77, 0x62, 0x5b, 0x78, 0x3c, 0xc6, 0xe3, 0xa9, 0x08, 0xff, 0x00, - 0x57, 0x38, 0x73, 0xe3, 0xef, 0x44, 0x02, 0xcd, 0x0f, 0x7b, 0x89, 0xf0, 0x22, 0x82, 0x7a, 0xf3, - 0x7b, 0xf3, 0x7d, 0xcf, 0xdf, 0x7b, 0x33, 0xf3, 0x0d, 0xf8, 0x29, 0x9f, 0x15, 0x25, 0x67, 0xb4, - 0x4a, 0xa8, 0x14, 0xb3, 0x75, 0x96, 0xd2, 0xbc, 0x9a, 0x31, 0x5a, 0x95, 0xe9, 0x5a, 0x04, 0x45, - 0xc9, 0x2b, 0x8e, 0xee, 0xa5, 0x3c, 0xd8, 0x62, 0x02, 0x83, 0x39, 0x38, 0x8a, 0x39, 0x8f, 0x33, - 0x3a, 0xd3, 0x98, 0x48, 0x5e, 0xcd, 0xaa, 0x94, 0x51, 0x51, 0x11, 0x56, 0x18, 0x9a, 0xff, 0x18, - 0xbc, 0x6f, 0x48, 0x44, 0xb3, 0x4b, 0x92, 0x96, 0x08, 0x81, 0x9b, 0x13, 0x46, 0x27, 0xce, 0xd4, - 0x39, 0xf6, 0xb0, 0xfe, 0x46, 0xf7, 0xa0, 0xf7, 0x86, 0x64, 0x92, 0x4e, 0x3a, 0x3a, 0x69, 0x02, - 0xff, 0x10, 0x7a, 0xe7, 0x44, 0xc6, 0x7f, 0x5b, 0x56, 0x1c, 0xa7, 0x5e, 0xfe, 0x0e, 0x06, 0xcf, - 0xb8, 0xcc, 0x2b, 0x5a, 0xb6, 0x03, 0xd0, 0x13, 0x18, 0xd2, 0x1f, 0x29, 0x2b, 0x32, 0x52, 0xea, - 0xc2, 0xa3, 0x87, 0x1f, 0x04, 0x6d, 0x0d, 0x04, 0x67, 0x16, 0x85, 0x1b, 0xbc, 0xff, 0x14, 0x86, - 0xdf, 0x4a, 0x92, 0x57, 0x69, 0x46, 0xd1, 0x01, 0x0c, 0x7f, 0xb0, 0xdf, 0xf6, 0x07, 0x4d, 0x7c, - 0x53, 0x79, 0x23, 0xed, 0x67, 0x07, 0x06, 0x0b, 0xc9, 0x18, 0x29, 0xaf, 0xd1, 0x87, 0x70, 0x47, - 0x10, 0x56, 0x64, 0x34, 0x5c,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0x4f, 0xe2, 0xb4, 0x4a, 0x64, 0x14, 0xac, 0x39, 0xfb, 0xe7, - 0x83, 0x1e, 0x32, 0xbe, 0xa1, 0xd9, 0x2c, 0xe6, 0x5f, 0xa4, 0x3c, 0xdc, 0xae, 0x86, 0x66, 0xf5, - 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x8f, 0x04, 0x1a, 0x05, 0x08, 0x00, 0x00, + // 914 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x72, 0xdb, 0x44, + 0x14, 0x46, 0xb1, 0xfc, 0xa3, 0xe3, 0x86, 0x38, 0xdb, 0x4c, 0xc7, 0x93, 0x12, 0x62, 0xc4, 0x4d, + 0xe8, 0x80, 0x3c, 0x74, 0x52, 0x60, 0x4a, 0xb9, 0x48, 0xda, 0x34, 0x65, 0x06, 0xa7, 0x61, 0x6d, + 0x5f, 0xb4, 0x5c, 0x68, 0x56, 0xf6, 0x46, 0xd6, 0xa0, 0xd5, 0x0a, 0xad, 0xd4, 0x21, 0xbc, 0x00, + 0xd7, 0xbc, 0x02, 0x6f, 0xc0, 0x4b, 0xf0, 0x0e, 0x3c, 0x0d, 0xcc, 0xfe, 0x48, 0x8a, 0x8b, 0x0c, + 0x6d, 0xef, 0x74, 0xce, 0x7e, 0xdf, 0xd1, 0xf9, 0x8e, 0x76, 0xbf, 0x15, 0xb8, 0x11, 0x1f, 0xa7, + 0x19, 0x67, 0x34, 0x5f, 0xd1, 0x42, 0x8c, 0x17, 0x71, 0x44, 0x93, 0x7c, 0xcc, 0x68, 0x9e, 0x45, + 0x0b, 0xe1, 0xa5, 0x19, 0xcf, 0x39, 0xda, 0x8b, 0xb8, 0x57, 0x63, 0x3c, 0x8d, 0xd9, 0x3f, 0x0c, + 0x39, 0x0f, 0x63, 0x3a, 0x56, 0x98, 0xa0, 0xb8, 0x1a, 0xe7, 0x11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e, 0xc5, 0xd0, 0xf8, 0x33, 0xf1, 0xf2, 0x61, 0x18, 0xe5, 0xab, 0x22, 0xf0, + 0x16, 0x9c, 0xfd, 0xfb, 0x77, 0xc4, 0x67, 0x7c, 0x49, 0xe3, 0x71, 0xc8, 0xbf, 0x8e, 0xb8, 0x5f, + 0xaf, 0xfa, 0x7a, 0xf5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x31, 0xb7, 0xd8, 0xc3, 0x08, + 0x00, 0x00, } diff --git a/io/prometheus/client/metrics.proto b/io/prometheus/client/metrics.proto index 7c973de..a198d3c 100644 --- a/io/prometheus/client/metrics.proto +++ b/io/prometheus/client/metrics.proto @@ -25,11 +25,18 @@ message LabelPair { } enum MetricType { - COUNTER = 0; - GAUGE = 1; - SUMMARY = 2; - UNTYPED = 3; - HISTOGRAM = 4; + // COUNTER must use the Metric field "counter". + COUNTER = 0; + // GAUGE must use the Metric field "gauge". + GAUGE = 1; + // SUMMARY must use the Metric field "summary". + SUMMARY = 2; + // UNTYPED must use the Metric field "untyped". + UNTYPED = 3; + // HISTOGRAM must use the Metric field "histogram". + HISTOGRAM = 4; + // GAUGE_HISTOGRAM must use the Metric field "histogram". + GAUGE_HISTOGRAM = 5; } message Gauge { @@ -57,26 +64,29 @@ message Untyped { } message Histogram { - optional uint64 sample_count = 1; - optional double sample_sum = 2; - repeated Bucket bucket = 3; // Ordered in increasing order of upper_bound, +Inf bucket is optional. + optional uint64 sample_count = 1; + optional double sample_count_float = 9; // Overrides sample_count if > 0. + optional 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. // 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. - optional sint32 sb_schema = 4; - optional double sb_zero_threshold = 5; // Breadth of the zero bucket. - optional uint64 sb_zero_count = 6; // Count in zero bucket. - optional SparseBuckets sb_negative = 7; // Negative sparse buckets. - optional SparseBuckets sb_positive = 8; // Positive sparse buckets. + optional sint32 sb_schema = 4; + optional double sb_zero_threshold = 5; // Breadth of the zero bucket. + optional uint64 sb_zero_count = 6; // Count in zero bucket. + optional double sb_zero_count_float = 10; // Overrides sb_zero_count if > 0. + optional SparseBuckets sb_negative = 7; // Negative sparse buckets. + optional SparseBuckets sb_positive = 8; // Positive sparse buckets. } message Bucket { - optional uint64 cumulative_count = 1; // Cumulative in increasing order. - optional double upper_bound = 2; // Inclusive. - optional Exemplar exemplar = 3; + optional uint64 cumulative_count = 1; // Cumulative in increasing order. + optional double cumulative_count_float = 4; // Overrides cumulative_count if > 0. + optional double upper_bound = 2; // Inclusive. + optional Exemplar exemplar = 3; } message SparseBuckets { @@ -84,8 +94,11 @@ message SparseBuckets { optional sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). optional uint32 length = 2; // Length of consecutive buckets. } - repeated Span span = 1; + 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. } message Exemplar { From 0da32651340af3304864c3d04281029320ae9ab1 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Sun, 19 Jun 2022 19:10:29 +0200 Subject: [PATCH 16/19] Explain Span layout better Signed-off-by: beorn7 --- io/prometheus/client/metrics.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/io/prometheus/client/metrics.proto b/io/prometheus/client/metrics.proto index a198d3c..21a6955 100644 --- a/io/prometheus/client/metrics.proto +++ b/io/prometheus/client/metrics.proto @@ -90,6 +90,12 @@ message Bucket { } 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 { optional sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). optional uint32 length = 2; // Length of consecutive buckets. From a7ff7138f27137b11ceaa93990578e0c0bb6e395 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Thu, 14 Jul 2022 19:40:31 +0200 Subject: [PATCH 17/19] Flatten the buckets of native histograms This is slightly more efficient on the wire, and it matches the way the corresponding Go types are structured (`histogram.Histogram` and `histogram.FloatHistogram`). This follow the change for the remote-write protobuf in https://github.com/prometheus/prometheus/pull/11011 . This commit also moves away from the "sparse histogram" naming in lieu of the preferred name "native histogram". Note that this is deliberately an incompatible change of the proto spec. Keeping compatibility would cause some hassle but not much gain because we haven't published the proto spec in any release yet and always marked it as experimental. Compatibility to the released proto spec (without native histograms) is kept, of course. Signed-off-by: beorn7 --- go/metrics.pb.go | 324 ++++++++++++++--------------- io/prometheus/client/metrics.proto | 62 +++--- 2 files changed, 193 insertions(+), 193 deletions(-) diff --git a/go/metrics.pb.go b/go/metrics.pb.go index 8fca0a8..35904ea 100644 --- a/go/metrics.pb.go +++ b/go/metrics.pb.go @@ -354,25 +354,37 @@ func (m *Untyped) GetValue() float64 { } type Histogram struct { - SampleCount *uint64 `protobuf:"varint,1,opt,name=sample_count,json=sampleCount" json:"sample_count,omitempty"` - SampleCountFloat *float64 `protobuf:"fixed64,9,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"` - SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` - Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" 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" json:"sample_count,omitempty"` + SampleCountFloat *float64 `protobuf:"fixed64,4,opt,name=sample_count_float,json=sampleCountFloat" json:"sample_count_float,omitempty"` + SampleSum *float64 `protobuf:"fixed64,2,opt,name=sample_sum,json=sampleSum" json:"sample_sum,omitempty"` + // Buckets for the conventional histogram. + Bucket []*Bucket `protobuf:"bytes,3,rep,name=bucket" 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" json:"sb_schema,omitempty"` - SbZeroThreshold *float64 `protobuf:"fixed64,5,opt,name=sb_zero_threshold,json=sbZeroThreshold" json:"sb_zero_threshold,omitempty"` - SbZeroCount *uint64 `protobuf:"varint,6,opt,name=sb_zero_count,json=sbZeroCount" json:"sb_zero_count,omitempty"` - SbZeroCountFloat *float64 `protobuf:"fixed64,10,opt,name=sb_zero_count_float,json=sbZeroCountFloat" json:"sb_zero_count_float,omitempty"` - SbNegative *SparseBuckets `protobuf:"bytes,7,opt,name=sb_negative,json=sbNegative" json:"sb_negative,omitempty"` - SbPositive *SparseBuckets `protobuf:"bytes,8,opt,name=sb_positive,json=sbPositive" json:"sb_positive,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Schema *int32 `protobuf:"zigzag32,5,opt,name=schema" json:"schema,omitempty"` + ZeroThreshold *float64 `protobuf:"fixed64,6,opt,name=zero_threshold,json=zeroThreshold" json:"zero_threshold,omitempty"` + ZeroCount *uint64 `protobuf:"varint,7,opt,name=zero_count,json=zeroCount" json:"zero_count,omitempty"` + ZeroCountFloat *float64 `protobuf:"fixed64,8,opt,name=zero_count_float,json=zeroCountFloat" json:"zero_count_float,omitempty"` + // Negative buckets for the native histogram. + NegativeSpan []*BucketSpan `protobuf:"bytes,9,rep,name=negative_span,json=negativeSpan" 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,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"` + NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"` + // Positive buckets for the native 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 + // histograms. + PositiveDelta []int64 `protobuf:"zigzag64,13,rep,name=positive_delta,json=positiveDelta" json:"positive_delta,omitempty"` + PositiveCount []float64 `protobuf:"fixed64,14,rep,name=positive_count,json=positiveCount" json:"positive_count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Histogram) Reset() { *m = Histogram{} } @@ -428,48 +440,78 @@ func (m *Histogram) GetBucket() []*Bucket { return nil } -func (m *Histogram) GetSbSchema() int32 { - if m != nil && m.SbSchema != nil { - return *m.SbSchema +func (m *Histogram) GetSchema() int32 { + if m != nil && m.Schema != nil { + return *m.Schema } return 0 } -func (m *Histogram) GetSbZeroThreshold() float64 { - if m != nil && m.SbZeroThreshold != nil { - return *m.SbZeroThreshold +func (m *Histogram) GetZeroThreshold() float64 { + if m != nil && m.ZeroThreshold != nil { + return *m.ZeroThreshold } return 0 } -func (m *Histogram) GetSbZeroCount() uint64 { - if m != nil && m.SbZeroCount != nil { - return *m.SbZeroCount +func (m *Histogram) GetZeroCount() uint64 { + if m != nil && m.ZeroCount != nil { + return *m.ZeroCount } return 0 } -func (m *Histogram) GetSbZeroCountFloat() float64 { - if m != nil && m.SbZeroCountFloat != nil { - return *m.SbZeroCountFloat +func (m *Histogram) GetZeroCountFloat() float64 { + if m != nil && m.ZeroCountFloat != nil { + 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.SbNegative + return m.NegativeDelta } return nil } -func (m *Histogram) GetSbPositive() *SparseBuckets { +func (m *Histogram) GetNegativeCount() []float64 { if m != nil { - return m.SbPositive + 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.PositiveDelta + } + return nil +} + +func (m *Histogram) GetPositiveCount() []float64 { + if m != nil { + return m.PositiveCount + } + return nil +} + +// A Bucket of a conventional histogram, each of which is treated as +// an individual counter-like time series by Prometheus. type Bucket struct { CumulativeCount *uint64 `protobuf:"varint,1,opt,name=cumulative_count,json=cumulativeCount" json:"cumulative_count,omitempty"` CumulativeCountFloat *float64 `protobuf:"fixed64,4,opt,name=cumulative_count_float,json=cumulativeCountFloat" json:"cumulative_count_float,omitempty"` @@ -533,64 +575,13 @@ func (m *Bucket) GetExemplar() *Exemplar { return nil } -type SparseBuckets struct { - Span []*SparseBuckets_Span `protobuf:"bytes,1,rep,name=span" 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,name=delta" json:"delta,omitempty"` - Count []float64 `protobuf:"fixed64,3,rep,name=count" 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 xxx_messageInfo_SparseBuckets.Unmarshal(m, b) -} -func (m *SparseBuckets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SparseBuckets.Marshal(b, m, deterministic) -} -func (m *SparseBuckets) XXX_Merge(src proto.Message) { - xxx_messageInfo_SparseBuckets.Merge(m, src) -} -func (m *SparseBuckets) XXX_Size() int { - return xxx_messageInfo_SparseBuckets.Size(m) -} -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 -} - -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" json:"offset,omitempty"` Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -598,39 +589,39 @@ 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 { - return xxx_messageInfo_SparseBuckets_Span.Unmarshal(m, b) +func (m *BucketSpan) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BucketSpan.Unmarshal(m, b) } -func (m *SparseBuckets_Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SparseBuckets_Span.Marshal(b, m, deterministic) +func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BucketSpan.Marshal(b, m, deterministic) } -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 { - return xxx_messageInfo_SparseBuckets_Span.Size(m) +func (m *BucketSpan) XXX_Size() int { + return xxx_messageInfo_BucketSpan.Size(m) } -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 && m.Offset != nil { return *m.Offset } return 0 } -func (m *SparseBuckets_Span) GetLength() uint32 { +func (m *BucketSpan) GetLength() uint32 { if m != nil && m.Length != nil { return *m.Length } @@ -852,8 +843,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") @@ -864,63 +854,61 @@ func init() { } var fileDescriptor_d1e5ddb18987a258 = []byte{ - // 914 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x72, 0xdb, 0x44, - 0x14, 0x46, 0xb1, 0xfc, 0xa3, 0xe3, 0x86, 0x38, 0xdb, 0x4c, 0xc7, 0x93, 0x12, 0x62, 0xc4, 0x4d, - 0xe8, 0x80, 0x3c, 0x74, 0x52, 0x60, 0x4a, 0xb9, 0x48, 0xda, 0x34, 0x65, 0x06, 0xa7, 0x61, 0x6d, - 0x5f, 0xb4, 0x5c, 0x68, 0x56, 0xf6, 0x46, 0xd6, 0xa0, 0xd5, 0x0a, 0xad, 0xd4, 0x21, 0xbc, 0x00, - 0xd7, 0xbc, 0x02, 0x6f, 0xc0, 0x4b, 0xf0, 0x0e, 0x3c, 0x0d, 0xcc, 0xfe, 0x48, 0x8a, 0x8b, 0x0c, - 0x6d, 0xef, 0x74, 0xce, 0x7e, 0xdf, 0xd1, 0xf9, 0x8e, 0x76, 0xbf, 0x15, 0xb8, 0x11, 0x1f, 0xa7, - 0x19, 0x67, 0x34, 0x5f, 0xd1, 0x42, 0x8c, 0x17, 0x71, 0x44, 0x93, 0x7c, 0xcc, 0x68, 0x9e, 0x45, - 0x0b, 0xe1, 0xa5, 0x19, 0xcf, 0x39, 0xda, 0x8b, 0xb8, 0x57, 0x63, 0x3c, 0x8d, 0xd9, 0x3f, 0x0c, - 0x39, 0x0f, 0x63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, 0xb7, 0x61, 0x47, 0x71, - 0xfc, 0x3a, 0xd9, 0x3e, 0xc5, 0xd0, 0xf8, 0x33, 0xf1, 0xf2, 0x61, 0x18, 0xe5, 0xab, 0x22, 0xf0, - 0x16, 0x9c, 0xfd, 0xfb, 0x77, 0xc4, 0x67, 0x7c, 0x49, 0xe3, 0x71, 0xc8, 0xbf, 0x8e, 0xb8, 0x5f, - 0xaf, 0xfa, 0x7a, 0xf5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x31, 0xb7, 0xd8, 0xc3, 0x08, - 0x00, 0x00, + // 896 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x8e, 0xdb, 0x44, + 0x18, 0xc5, 0x9b, 0x5f, 0x7f, 0xd9, 0x6c, 0xd3, 0x61, 0x55, 0x59, 0x0b, 0xcb, 0x06, 0x4b, 0x48, + 0x0b, 0x42, 0x8e, 0x40, 0x5b, 0x81, 0x0a, 0x5c, 0xec, 0xb6, 0xe9, 0x16, 0x89, 0xb4, 0x65, 0x92, + 0x5c, 0x14, 0x2e, 0xac, 0x49, 0x32, 0xeb, 0x58, 0x78, 0x3c, 0xc6, 0x1e, 0x57, 0x2c, 0x2f, 0xc0, + 0x35, 0xaf, 0xc0, 0xc3, 0xf0, 0x22, 0x3c, 0x08, 0x68, 0xfe, 0xec, 0xdd, 0xe2, 0x94, 0xd2, 0x3b, + 0x7f, 0x67, 0xce, 0xf7, 0xcd, 0x39, 0xe3, 0xc9, 0x71, 0xc0, 0x8f, 0xf9, 0x24, 0xcb, 0x39, 0xa3, + 0x62, 0x4b, 0xcb, 0x62, 0xb2, 0x4e, 0x62, 0x9a, 0x8a, 0x09, 0xa3, 0x22, 0x8f, 0xd7, 0x45, 0x90, + 0xe5, 0x5c, 0x70, 0x74, 0x18, 0xf3, 0xa0, 0xe6, 0x04, 0x9a, 0x73, 0x74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x8b, 0x1a, 0x6a, 0x51, 0x16, 0xad, 0x44, 0x55, + 0x34, 0x2d, 0xea, 0x40, 0x8b, 0xb2, 0xa8, 0x12, 0xe5, 0xff, 0xe9, 0x40, 0x57, 0x6f, 0x85, 0x3e, + 0x86, 0xd1, 0xba, 0x64, 0x65, 0x72, 0xd3, 0x88, 0xbe, 0x66, 0x77, 0x6a, 0x5c, 0x5b, 0x39, 0x83, + 0x7b, 0xaf, 0x52, 0x6f, 0x5d, 0xb7, 0xc3, 0x57, 0x1a, 0xf4, 0x5b, 0x39, 0x81, 0x41, 0x99, 0x65, + 0x34, 0x0f, 0x57, 0xbc, 0x4c, 0x37, 0xe6, 0xce, 0x81, 0x82, 0x2e, 0x24, 0x72, 0x2b, 0x17, 0x5a, + 0xff, 0x3b, 0x17, 0xa0, 0x3e, 0x32, 0x79, 0x11, 0xf9, 0xd5, 0x55, 0x41, 0xb5, 0x83, 0xbb, 0xd8, + 0x54, 0x12, 0x4f, 0x68, 0x1a, 0x89, 0xad, 0xda, 0x7d, 0x88, 0x4d, 0xe5, 0xff, 0xee, 0x40, 0xdf, + 0x0e, 0x45, 0xf7, 0xa1, 0x93, 0xc8, 0x54, 0xf4, 0x1c, 0xf5, 0x82, 0x4e, 0x9a, 0x35, 0x54, 0xc1, + 0x89, 0x35, 0xbb, 0x39, 0x71, 0xd0, 0x97, 0xe0, 0x56, 0xa9, 0x6b, 0x4c, 0x1d, 0x05, 0x3a, 0x97, + 0x03, 0x9b, 0xcb, 0xc1, 0xc2, 0x32, 0x70, 0x4d, 0xf6, 0xff, 0xde, 0x83, 0xee, 0x4c, 0xa5, 0xfc, + 0xdb, 0x2a, 0xfa, 0x0c, 0x3a, 0x91, 0xcc, 0x69, 0x13, 0xb2, 0xef, 0x35, 0xb7, 0xa9, 0x28, 0xc7, + 0x9a, 0x89, 0xbe, 0x80, 0xde, 0x5a, 0x67, 0xb7, 0x11, 0x7b, 0xdc, 0xdc, 0x64, 0x02, 0x1e, 0x5b, + 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 0xc6, 0x3f, 0x18, 0x3f, 0x3c, 0x88, 0x62, 0xb1, 0x2d, 0x57, 0xc1, 0x9a, + 0xb3, 0x7f, 0xff, 0x45, 0x09, 0x19, 0xdf, 0xd0, 0x64, 0x12, 0xf1, 0xaf, 0x62, 0x1e, 0xd6, 0xab, + 0xa1, 0x5e, 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x16, 0x77, 0x81, 0x98, 0xd7, 0x08, 0x00, 0x00, } diff --git a/io/prometheus/client/metrics.proto b/io/prometheus/client/metrics.proto index 21a6955..f838da6 100644 --- a/io/prometheus/client/metrics.proto +++ b/io/prometheus/client/metrics.proto @@ -65,23 +65,42 @@ message Untyped { message Histogram { optional uint64 sample_count = 1; - optional double sample_count_float = 9; // Overrides sample_count if > 0. + optional double sample_count_float = 4; // Overrides sample_count if > 0. optional double sample_sum = 2; + // Buckets for the conventional histogram. 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. + + // 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. - optional sint32 sb_schema = 4; - optional double sb_zero_threshold = 5; // Breadth of the zero bucket. - optional uint64 sb_zero_count = 6; // Count in zero bucket. - optional double sb_zero_count_float = 10; // Overrides sb_zero_count if > 0. - optional SparseBuckets sb_negative = 7; // Negative sparse buckets. - optional SparseBuckets sb_positive = 8; // Positive sparse buckets. + optional sint32 schema = 5; + optional double zero_threshold = 6; // Breadth of the zero bucket. + optional uint64 zero_count = 7; // Count in zero bucket. + optional 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. } +// A Bucket of a conventional histogram, each of which is treated as +// an individual counter-like time series by Prometheus. message Bucket { optional uint64 cumulative_count = 1; // Cumulative in increasing order. optional double cumulative_count_float = 4; // Overrides cumulative_count if > 0. @@ -89,22 +108,15 @@ message Bucket { optional 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 { - optional sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). - optional 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 { + optional sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative). + optional uint32 length = 2; // Length of consecutive buckets. } message Exemplar { From 7f720d22828060526c55ac83bceff08f43d4cdbc Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 11 Oct 2022 14:03:28 +0200 Subject: [PATCH 18/19] Add note about experimental state of native histograms Signed-off-by: beorn7 --- io/prometheus/client/metrics.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/io/prometheus/client/metrics.proto b/io/prometheus/client/metrics.proto index f838da6..778ebdc 100644 --- a/io/prometheus/client/metrics.proto +++ b/io/prometheus/client/metrics.proto @@ -71,6 +71,7 @@ message 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). + // Native histograms are an experimental feature without stability guarantees. // 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 From fdb567dcc1bd58466166fc1e3c39e9277d34a303 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Wed, 12 Oct 2022 18:11:01 +0200 Subject: [PATCH 19/19] Add note about native histograms to README Signed-off-by: beorn7 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e100975..61552be 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +_(If you are reading this because you are interested in Prometheus's native +histograms, pay special attention to the last paragraph below.)_ + # Deprecation note This repository used to contain the [protocol @@ -32,3 +35,10 @@ for the protobuf-based exposition format. Check out the [OpenMetrics project](https://openmetrics.io/) for the future of the data model and exposition format used by Prometheus and others. + +Note, though, that in an ironic twist of fate, the protobuf-based exposition +format got revived to ease the implementation of experimental support for +native histograms in Prometheus. Therefore, starting with v2.40.0, the +Prometheus server is again capable of ingesting the protobuf-based exposition +format (if the respective feature flag is enabled). Eventually, native +histogram support will be added in some form to OpenMetrics, too.