diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index cb19ace72..7997795bf 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -150,12 +150,11 @@ type flagConfig struct { featureList []string // These options are extracted from featureList // for ease of use. - enableExpandExternalLabels bool - enableNewSDManager bool - enablePerStepStats bool - enableAutoGOMAXPROCS bool - enableSenderRemoteWrite11 bool - enableSenderRemoteWrite11Minimized bool + enableExpandExternalLabels bool + enableNewSDManager bool + enablePerStepStats bool + enableAutoGOMAXPROCS bool + enableSenderRemoteWrite11 bool prometheusURL string corsRegexString string @@ -224,14 +223,8 @@ func (c *flagConfig) setFeatureListOptions(logger log.Logger) error { case "rw-1-1-sender": c.enableSenderRemoteWrite11 = true level.Info(logger).Log("msg", "Experimental remote write 1.1 will be used on the sender end, receiver must be able to parse this new protobuf format.") - case "rw-1-1-sender-min": - c.enableSenderRemoteWrite11Minimized = true - level.Info(logger).Log("msg", "Experimental remote write 1.1 will be used on the sender end, receiver must be able to parse this new protobuf format.") case "rw-1-1-receiver": c.web.EnableReceiverRemoteWrite11 = true - case "rw-1-1-receiver-min": - c.web.EnableReceiverRemoteWrite11Min = true - level.Info(logger).Log("msg", "Experimental remote write 1.1 will be supported on the receiver end, sender can send this new protobuf format.") default: level.Warn(logger).Log("msg", "Unknown option for --enable-feature", "option", o) } @@ -617,7 +610,7 @@ func main() { var ( localStorage = &readyStorage{stats: tsdb.NewDBStats()} scraper = &readyScrapeManager{} - remoteStorage = remote.NewStorage(log.With(logger, "component", "remote"), prometheus.DefaultRegisterer, localStorage.StartTime, localStoragePath, time.Duration(cfg.RemoteFlushDeadline), scraper, cfg.enableSenderRemoteWrite11, cfg.enableSenderRemoteWrite11Minimized) + remoteStorage = remote.NewStorage(log.With(logger, "component", "remote"), prometheus.DefaultRegisterer, localStorage.StartTime, localStoragePath, time.Duration(cfg.RemoteFlushDeadline), scraper, cfg.enableSenderRemoteWrite11) fanoutStorage = storage.NewFanout(logger, localStorage, remoteStorage) ) diff --git a/prompb/remote.pb.go b/prompb/remote.pb.go index 5fb5f8b04..c8c24d8bd 100644 --- a/prompb/remote.pb.go +++ b/prompb/remote.pb.go @@ -60,7 +60,7 @@ func (x ReadRequest_ResponseType) String() string { } func (ReadRequest_ResponseType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{3, 0} + return fileDescriptor_eefc82927d57d89b, []int{2, 0} } type WriteRequest struct { @@ -118,62 +118,6 @@ func (m *WriteRequest) GetMetadata() []MetricMetadata { return nil } -type WriteRequestWithRefs struct { - Timeseries []ReducedTimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` - // Symbol table for label names/values. - StringSymbolTable map[uint64]string `protobuf:"bytes,4,rep,name=string_symbol_table,json=stringSymbolTable,proto3" json:"string_symbol_table" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteRequestWithRefs) Reset() { *m = WriteRequestWithRefs{} } -func (m *WriteRequestWithRefs) String() string { return proto.CompactTextString(m) } -func (*WriteRequestWithRefs) ProtoMessage() {} -func (*WriteRequestWithRefs) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{1} -} -func (m *WriteRequestWithRefs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WriteRequestWithRefs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WriteRequestWithRefs.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 *WriteRequestWithRefs) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequestWithRefs.Merge(m, src) -} -func (m *WriteRequestWithRefs) XXX_Size() int { - return m.Size() -} -func (m *WriteRequestWithRefs) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequestWithRefs.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteRequestWithRefs proto.InternalMessageInfo - -func (m *WriteRequestWithRefs) GetTimeseries() []ReducedTimeSeries { - if m != nil { - return m.Timeseries - } - return nil -} - -func (m *WriteRequestWithRefs) GetStringSymbolTable() map[uint64]string { - if m != nil { - return m.StringSymbolTable - } - return nil -} - type MinimizedWriteRequest struct { Timeseries []MinimizedTimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` // The symbols table. All symbols are concatenated strings. To read the symbols table, it's required @@ -188,7 +132,7 @@ func (m *MinimizedWriteRequest) Reset() { *m = MinimizedWriteRequest{} } func (m *MinimizedWriteRequest) String() string { return proto.CompactTextString(m) } func (*MinimizedWriteRequest) ProtoMessage() {} func (*MinimizedWriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{2} + return fileDescriptor_eefc82927d57d89b, []int{1} } func (m *MinimizedWriteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -249,7 +193,7 @@ func (m *ReadRequest) Reset() { *m = ReadRequest{} } func (m *ReadRequest) String() string { return proto.CompactTextString(m) } func (*ReadRequest) ProtoMessage() {} func (*ReadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{3} + return fileDescriptor_eefc82927d57d89b, []int{2} } func (m *ReadRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +249,7 @@ func (m *ReadResponse) Reset() { *m = ReadResponse{} } func (m *ReadResponse) String() string { return proto.CompactTextString(m) } func (*ReadResponse) ProtoMessage() {} func (*ReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{4} + return fileDescriptor_eefc82927d57d89b, []int{3} } func (m *ReadResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -355,7 +299,7 @@ func (m *Query) Reset() { *m = Query{} } func (m *Query) String() string { return proto.CompactTextString(m) } func (*Query) ProtoMessage() {} func (*Query) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{5} + return fileDescriptor_eefc82927d57d89b, []int{4} } func (m *Query) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -424,7 +368,7 @@ func (m *QueryResult) Reset() { *m = QueryResult{} } func (m *QueryResult) String() string { return proto.CompactTextString(m) } func (*QueryResult) ProtoMessage() {} func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{6} + return fileDescriptor_eefc82927d57d89b, []int{5} } func (m *QueryResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -477,7 +421,7 @@ func (m *ChunkedReadResponse) Reset() { *m = ChunkedReadResponse{} } func (m *ChunkedReadResponse) String() string { return proto.CompactTextString(m) } func (*ChunkedReadResponse) ProtoMessage() {} func (*ChunkedReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eefc82927d57d89b, []int{7} + return fileDescriptor_eefc82927d57d89b, []int{6} } func (m *ChunkedReadResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -523,8 +467,6 @@ func (m *ChunkedReadResponse) GetQueryIndex() int64 { func init() { proto.RegisterEnum("prometheus.ReadRequest_ResponseType", ReadRequest_ResponseType_name, ReadRequest_ResponseType_value) proto.RegisterType((*WriteRequest)(nil), "prometheus.WriteRequest") - proto.RegisterType((*WriteRequestWithRefs)(nil), "prometheus.WriteRequestWithRefs") - proto.RegisterMapType((map[uint64]string)(nil), "prometheus.WriteRequestWithRefs.StringSymbolTableEntry") proto.RegisterType((*MinimizedWriteRequest)(nil), "prometheus.MinimizedWriteRequest") proto.RegisterType((*ReadRequest)(nil), "prometheus.ReadRequest") proto.RegisterType((*ReadResponse)(nil), "prometheus.ReadResponse") @@ -536,48 +478,41 @@ func init() { func init() { proto.RegisterFile("remote.proto", fileDescriptor_eefc82927d57d89b) } var fileDescriptor_eefc82927d57d89b = []byte{ - // 655 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x4a, - 0x14, 0xae, 0x93, 0xb4, 0xc9, 0x3d, 0xe9, 0xad, 0xdc, 0x69, 0xda, 0xfa, 0x46, 0xba, 0x6d, 0x64, - 0xdd, 0x45, 0xa4, 0x5e, 0x05, 0x51, 0x2a, 0x40, 0xa8, 0x0b, 0xfa, 0x13, 0xa9, 0x94, 0x9a, 0x9f, - 0x71, 0x50, 0x11, 0x42, 0xb2, 0x1c, 0xfb, 0xd0, 0x58, 0x8d, 0x7f, 0xea, 0x19, 0xa3, 0x9a, 0x35, - 0x0f, 0xc0, 0x03, 0xf0, 0x34, 0xac, 0xba, 0x42, 0x3c, 0x01, 0x42, 0x7d, 0x12, 0xe4, 0xb1, 0x1d, - 0x26, 0x25, 0xaa, 0xd8, 0xcd, 0x9c, 0xef, 0x67, 0xce, 0x7c, 0x67, 0x6c, 0x58, 0x8c, 0xd1, 0x0f, - 0x39, 0xf6, 0xa2, 0x38, 0xe4, 0x21, 0x81, 0x28, 0x0e, 0x7d, 0xe4, 0x23, 0x4c, 0x58, 0xbb, 0xc9, - 0xd3, 0x08, 0x59, 0x0e, 0xb4, 0x5b, 0x67, 0xe1, 0x59, 0x28, 0x96, 0x77, 0xb2, 0x55, 0x5e, 0xd5, - 0x3f, 0x29, 0xb0, 0x78, 0x1a, 0x7b, 0x1c, 0x29, 0x5e, 0x24, 0xc8, 0x38, 0xd9, 0x05, 0xe0, 0x9e, - 0x8f, 0x0c, 0x63, 0x0f, 0x99, 0xa6, 0x74, 0xaa, 0xdd, 0xe6, 0xf6, 0x5a, 0xef, 0x97, 0x69, 0x6f, - 0xe0, 0xf9, 0x68, 0x0a, 0x74, 0xbf, 0x76, 0xf5, 0x7d, 0x73, 0x8e, 0x4a, 0x7c, 0xb2, 0x0b, 0x0d, - 0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0x16, 0xcc, 0x8f, 0xbc, - 0x80, 0xe7, 0xf3, 0x6c, 0x6e, 0xaf, 0xde, 0x0c, 0xf7, 0x28, 0x03, 0x69, 0xce, 0xd1, 0xfb, 0xd0, - 0x94, 0x2e, 0x47, 0xee, 0xff, 0xf9, 0xff, 0x40, 0x7e, 0x45, 0xfa, 0x25, 0xac, 0x1c, 0x8c, 0x92, - 0xe0, 0x3c, 0x1b, 0x8e, 0x94, 0xea, 0x63, 0x58, 0x72, 0xf2, 0xb2, 0x35, 0x65, 0xf9, 0x8f, 0x6c, - 0x59, 0x08, 0x0b, 0xd7, 0xbf, 0x1d, 0x79, 0x4b, 0x36, 0xa1, 0x99, 0x3d, 0xa3, 0xd4, 0xf2, 0x02, - 0x17, 0x2f, 0x8b, 0x9c, 0x40, 0x94, 0x9e, 0x64, 0x95, 0xfd, 0xd6, 0xd5, 0xf5, 0x86, 0xf2, 0xed, - 0x7a, 0x43, 0xf9, 0x71, 0xbd, 0xa1, 0xbc, 0x59, 0xc8, 0x7c, 0xa3, 0xe1, 0x70, 0x41, 0xfc, 0xef, - 0xee, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x42, 0x7e, 0x2f, 0x97, 0x2e, 0x05, 0x00, 0x00, + // 543 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xae, 0xeb, 0xb4, 0x09, 0xe3, 0x10, 0x99, 0x6d, 0x43, 0x4c, 0x0e, 0x49, 0x64, 0x71, 0x88, + 0x54, 0x14, 0x44, 0xa8, 0x38, 0xf5, 0x40, 0x5a, 0x22, 0x95, 0x52, 0xf3, 0xb3, 0x09, 0x02, 0x21, + 0x24, 0xcb, 0xb1, 0x47, 0x8d, 0x45, 0xfc, 0x53, 0xef, 0x5a, 0x6a, 0x38, 0xf3, 0x00, 0x3c, 0x13, + 0xa7, 0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65, 0xf1, 0x03, 0xa8, 0x5e, 0xa6, 0x72, 0xe5, 0x5b, + 0x72, 0xe5, 0x57, 0x29, 0x26, 0x4b, 0x5a, 0x2a, 0xc8, 0x7b, 0x68, 0x39, 0xae, 0x8b, 0x31, 0x47, + 0xcf, 0x4e, 0x90, 0xc5, 0x51, 0xc8, 0xd0, 0x16, 0xaf, 0x61, 0x6c, 0xf7, 0xd4, 0x7e, 0x63, 0x78, + 0x57, 0x36, 0x4b, 0x65, 0x06, 0xb4, 0x50, 0x4f, 0x97, 0x31, 0xd2, 0x66, 0x19, 0x22, 0xa3, 0xcc, + 0x3c, 0x84, 0xba, 0x0c, 0x10, 0x0d, 0xaa, 0x93, 0x91, 0xf5, 0xf2, 0x7c, 0x3c, 0xd1, 0xb7, 0x48, + 0x0b, 0xf6, 0x26, 0x53, 0x3a, 0x1e, 0x59, 0xe3, 0x27, 0xf6, 0xdb, 0x17, 0xd4, 0x3e, 0x39, 0x7d, + 0xfd, 0xfc, 0xd9, 0x44, 0x57, 0xcc, 0x51, 0xe6, 0x72, 0xd6, 0x51, 0xe4, 0x01, 0x54, 0x13, 0x64, + 0xe9, 0x82, 0x97, 0x17, 0x6a, 0xfd, 0x79, 0x21, 0xc1, 0xd3, 0x52, 0x67, 0x7e, 0x51, 0x60, 0x47, + 0x10, 0xe4, 0x1e, 0x10, 0xc6, 0x9d, 0x84, 0xdb, 0x62, 0xae, 0xdc, 0x09, 0x62, 0x3b, 0xc8, 0x72, + 0x94, 0xbe, 0x4a, 0x75, 0xc1, 0x4c, 0x4b, 0xc2, 0x62, 0xa4, 0x0f, 0x3a, 0x86, 0xde, 0xa6, 0x76, + 0x5b, 0x68, 0x1b, 0x18, 0x7a, 0xb2, 0xf2, 0x10, 0x6a, 0x81, 0xc3, 0xdd, 0x39, 0x26, 0xac, 0x58, + 0x20, 0x43, 0xee, 0xea, 0xdc, 0x99, 0xe1, 0xc2, 0xca, 0x05, 0x74, 0xad, 0x24, 0x07, 0xb0, 0x33, + 0xf7, 0x43, 0x9e, 0xbf, 0xa7, 0x36, 0x6c, 0xfe, 0x3e, 0xdc, 0xd3, 0x8c, 0xa4, 0xb9, 0xc6, 0x1c, + 0x83, 0x26, 0x5d, 0x8e, 0x3c, 0xfa, 0xff, 0x85, 0x97, 0xb7, 0xc8, 0xbc, 0x82, 0xbd, 0x93, 0x79, + 0x1a, 0x7e, 0xc8, 0x1e, 0x47, 0x9a, 0xea, 0x63, 0x68, 0xb8, 0x39, 0x6c, 0x6f, 0x44, 0xde, 0x91, + 0x23, 0x0b, 0x63, 0x91, 0x7a, 0xd3, 0x95, 0x8f, 0xa4, 0x0b, 0x5a, 0xb6, 0x46, 0x4b, 0xdb, 0x0f, + 0x3d, 0xbc, 0x2a, 0xe6, 0x04, 0x02, 0x7a, 0x9a, 0x21, 0xc7, 0xfb, 0xd7, 0xab, 0x8e, 0xf2, 0x6d, + 0xd5, 0x51, 0x7e, 0xac, 0x3a, 0xca, 0xbb, 0xdd, 0x2c, 0x37, 0x9e, 0xcd, 0x76, 0xc5, 0x0f, 0xfd, + 0xf0, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb0, 0x3e, 0xdc, 0x81, 0x0f, 0x04, 0x00, 0x00, } func (m *WriteRequest) Marshal() (dAtA []byte, err error) { @@ -635,64 +570,6 @@ func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *WriteRequestWithRefs) 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 *WriteRequestWithRefs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WriteRequestWithRefs) 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.StringSymbolTable) > 0 { - for k := range m.StringSymbolTable { - v := m.StringSymbolTable[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRemote(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i = encodeVarintRemote(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = encodeVarintRemote(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Timeseries) > 0 { - for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Timeseries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRemote(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *MinimizedWriteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1026,32 +903,6 @@ func (m *WriteRequest) Size() (n int) { return n } -func (m *WriteRequestWithRefs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Timeseries) > 0 { - for _, e := range m.Timeseries { - l = e.Size() - n += 1 + l + sovRemote(uint64(l)) - } - } - if len(m.StringSymbolTable) > 0 { - for k, v := range m.StringSymbolTable { - _ = k - _ = v - mapEntrySize := 1 + sovRemote(uint64(k)) + 1 + len(v) + sovRemote(uint64(len(v))) - n += mapEntrySize + 1 + sovRemote(uint64(mapEntrySize)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *MinimizedWriteRequest) Size() (n int) { if m == nil { return 0 @@ -1309,204 +1160,6 @@ func (m *WriteRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WriteRequestWithRefs) 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 ErrIntOverflowRemote - } - 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: WriteRequestWithRefs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WriteRequestWithRefs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeseries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timeseries = append(m.Timeseries, ReducedTimeSeries{}) - if err := m.Timeseries[len(m.Timeseries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringSymbolTable", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRemote - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRemote - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.StringSymbolTable == nil { - m.StringSymbolTable = make(map[uint64]string) - } - var mapkey uint64 - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRemote - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthRemote - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthRemote - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.StringSymbolTable[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRemote(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRemote - } - 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 *MinimizedWriteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/prompb/remote.proto b/prompb/remote.proto index 7974502fe..ac6a74be2 100644 --- a/prompb/remote.proto +++ b/prompb/remote.proto @@ -28,16 +28,6 @@ message WriteRequest { } -message WriteRequestWithRefs { - repeated prometheus.ReducedTimeSeries timeseries = 1 [(gogoproto.nullable) = false]; - // Cortex uses this field to determine the source of the write request. - // We reserve it to avoid any compatibility issues. - reserved 2; - // Metadata (3) has moved to be part of the TimeSeries type - reserved 3; - // Symbol table for label names/values. - map string_symbol_table = 4 [(gogoproto.nullable) = false]; -} message MinimizedWriteRequest { repeated MinimizedTimeSeries timeseries = 1 [(gogoproto.nullable) = false]; // Cortex uses this field to determine the source of the write request. diff --git a/prompb/types.pb.go b/prompb/types.pb.go index ff0b3fc51..b19fb1621 100644 --- a/prompb/types.pb.go +++ b/prompb/types.pb.go @@ -68,49 +68,6 @@ func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_d938547f84707355, []int{0, 0} } -type MetricMetadataRef_MetricType int32 - -const ( - MetricMetadataRef_UNKNOWN MetricMetadataRef_MetricType = 0 - MetricMetadataRef_COUNTER MetricMetadataRef_MetricType = 1 - MetricMetadataRef_GAUGE MetricMetadataRef_MetricType = 2 - MetricMetadataRef_HISTOGRAM MetricMetadataRef_MetricType = 3 - MetricMetadataRef_GAUGEHISTOGRAM MetricMetadataRef_MetricType = 4 - MetricMetadataRef_SUMMARY MetricMetadataRef_MetricType = 5 - MetricMetadataRef_INFO MetricMetadataRef_MetricType = 6 - MetricMetadataRef_STATESET MetricMetadataRef_MetricType = 7 -) - -var MetricMetadataRef_MetricType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "COUNTER", - 2: "GAUGE", - 3: "HISTOGRAM", - 4: "GAUGEHISTOGRAM", - 5: "SUMMARY", - 6: "INFO", - 7: "STATESET", -} - -var MetricMetadataRef_MetricType_value = map[string]int32{ - "UNKNOWN": 0, - "COUNTER": 1, - "GAUGE": 2, - "HISTOGRAM": 3, - "GAUGEHISTOGRAM": 4, - "SUMMARY": 5, - "INFO": 6, - "STATESET": 7, -} - -func (x MetricMetadataRef_MetricType) String() string { - return proto.EnumName(MetricMetadataRef_MetricType_name, int32(x)) -} - -func (MetricMetadataRef_MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1, 0} -} - type Histogram_ResetHint int32 const ( @@ -139,7 +96,7 @@ func (x Histogram_ResetHint) String() string { } func (Histogram_ResetHint) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{5, 0} + return fileDescriptor_d938547f84707355, []int{3, 0} } type LabelMatcher_Type int32 @@ -170,7 +127,7 @@ func (x LabelMatcher_Type) String() string { } func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{13, 0} + return fileDescriptor_d938547f84707355, []int{9, 0} } // We require this to match chunkenc.Encoding. @@ -202,7 +159,7 @@ func (x Chunk_Encoding) String() string { } func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{15, 0} + return fileDescriptor_d938547f84707355, []int{11, 0} } type MetricMetadata struct { @@ -278,71 +235,6 @@ func (m *MetricMetadata) GetUnit() string { return "" } -type MetricMetadataRef struct { - // Represents the metric type, these match the set from Prometheus. - // Refer to model/textparse/interface.go for details. - Type MetricMetadataRef_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus.MetricMetadataRef_MetricType" json:"type,omitempty"` - HelpRef int64 `protobuf:"varint,4,opt,name=help_ref,json=helpRef,proto3" json:"help_ref,omitempty"` - UnitRef int64 `protobuf:"varint,5,opt,name=unit_ref,json=unitRef,proto3" json:"unit_ref,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricMetadataRef) Reset() { *m = MetricMetadataRef{} } -func (m *MetricMetadataRef) String() string { return proto.CompactTextString(m) } -func (*MetricMetadataRef) ProtoMessage() {} -func (*MetricMetadataRef) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1} -} -func (m *MetricMetadataRef) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadataRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadataRef.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 *MetricMetadataRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadataRef.Merge(m, src) -} -func (m *MetricMetadataRef) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadataRef) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadataRef.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricMetadataRef proto.InternalMessageInfo - -func (m *MetricMetadataRef) GetType() MetricMetadataRef_MetricType { - if m != nil { - return m.Type - } - return MetricMetadataRef_UNKNOWN -} - -func (m *MetricMetadataRef) GetHelpRef() int64 { - if m != nil { - return m.HelpRef - } - return 0 -} - -func (m *MetricMetadataRef) GetUnitRef() int64 { - if m != nil { - return m.UnitRef - } - return 0 -} - type Sample struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` // timestamp is in ms format, see model/timestamp/timestamp.go for @@ -357,7 +249,7 @@ func (m *Sample) Reset() { *m = Sample{} } func (m *Sample) String() string { return proto.CompactTextString(m) } func (*Sample) ProtoMessage() {} func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{2} + return fileDescriptor_d938547f84707355, []int{1} } func (m *Sample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -416,7 +308,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_d938547f84707355, []int{3} + return fileDescriptor_d938547f84707355, []int{2} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -466,72 +358,6 @@ func (m *Exemplar) GetTimestamp() int64 { return 0 } -type ExemplarRef struct { - // Optional, can be empty. - Labels []LabelRef `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` - // timestamp is in ms format, see model/timestamp/timestamp.go for - // conversion from time.Time to Prometheus timestamp. - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExemplarRef) Reset() { *m = ExemplarRef{} } -func (m *ExemplarRef) String() string { return proto.CompactTextString(m) } -func (*ExemplarRef) ProtoMessage() {} -func (*ExemplarRef) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{4} -} -func (m *ExemplarRef) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExemplarRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ExemplarRef.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 *ExemplarRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExemplarRef.Merge(m, src) -} -func (m *ExemplarRef) XXX_Size() int { - return m.Size() -} -func (m *ExemplarRef) XXX_DiscardUnknown() { - xxx_messageInfo_ExemplarRef.DiscardUnknown(m) -} - -var xxx_messageInfo_ExemplarRef proto.InternalMessageInfo - -func (m *ExemplarRef) GetLabels() []LabelRef { - if m != nil { - return m.Labels - } - return nil -} - -func (m *ExemplarRef) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *ExemplarRef) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - // A native histogram, also known as a sparse histogram. // Original design doc: // https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit @@ -586,7 +412,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_d938547f84707355, []int{5} + return fileDescriptor_d938547f84707355, []int{3} } func (m *Histogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -789,7 +615,7 @@ 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_d938547f84707355, []int{6} + return fileDescriptor_d938547f84707355, []int{4} } func (m *BucketSpan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -849,7 +675,7 @@ func (m *TimeSeries) Reset() { *m = TimeSeries{} } func (m *TimeSeries) String() string { return proto.CompactTextString(m) } func (*TimeSeries) ProtoMessage() {} func (*TimeSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{7} + return fileDescriptor_d938547f84707355, []int{5} } func (m *TimeSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -906,92 +732,10 @@ func (m *TimeSeries) GetHistograms() []Histogram { return nil } -// TimeSeries represents samples and labels for a single time series. -type ReducedTimeSeries struct { - // For a timeseries to be valid, and for the samples and exemplars - // to be ingested by the remote system properly, the labels field is required. - Labels []LabelRef `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` - Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` - Exemplars []ExemplarRef `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` - Histograms []Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms"` - Metadata MetricMetadataRef `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReducedTimeSeries) Reset() { *m = ReducedTimeSeries{} } -func (m *ReducedTimeSeries) String() string { return proto.CompactTextString(m) } -func (*ReducedTimeSeries) ProtoMessage() {} -func (*ReducedTimeSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{8} -} -func (m *ReducedTimeSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReducedTimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReducedTimeSeries.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 *ReducedTimeSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReducedTimeSeries.Merge(m, src) -} -func (m *ReducedTimeSeries) XXX_Size() int { - return m.Size() -} -func (m *ReducedTimeSeries) XXX_DiscardUnknown() { - xxx_messageInfo_ReducedTimeSeries.DiscardUnknown(m) -} - -var xxx_messageInfo_ReducedTimeSeries proto.InternalMessageInfo - -func (m *ReducedTimeSeries) GetLabels() []LabelRef { - if m != nil { - return m.Labels - } - return nil -} - -func (m *ReducedTimeSeries) GetSamples() []Sample { - if m != nil { - return m.Samples - } - return nil -} - -func (m *ReducedTimeSeries) GetExemplars() []ExemplarRef { - if m != nil { - return m.Exemplars - } - return nil -} - -func (m *ReducedTimeSeries) GetHistograms() []Histogram { - if m != nil { - return m.Histograms - } - return nil -} - -func (m *ReducedTimeSeries) GetMetadata() MetricMetadataRef { - if m != nil { - return m.Metadata - } - return MetricMetadataRef{} -} - // based on an experiment by marco type MinimizedTimeSeries struct { - // Sorted list of label name-value pair references. This list is always even. At even indices - // there's the reference to label name, while at odd indices there's the reference to label value. + // Sorted list of label name-value pair references. This list's len is always multiple of 4, + // packing tuples of (label name offset, label name length, label value offset, label value length). LabelSymbols []uint32 `protobuf:"varint,1,rep,packed,name=label_symbols,json=labelSymbols,proto3" json:"label_symbols,omitempty"` // Sorted by time, oldest sample first. // TODO: support references for other types @@ -1007,7 +751,7 @@ func (m *MinimizedTimeSeries) Reset() { *m = MinimizedTimeSeries{} } func (m *MinimizedTimeSeries) String() string { return proto.CompactTextString(m) } func (*MinimizedTimeSeries) ProtoMessage() {} func (*MinimizedTimeSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{9} + return fileDescriptor_d938547f84707355, []int{6} } func (m *MinimizedTimeSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1064,61 +808,6 @@ func (m *MinimizedTimeSeries) GetHistograms() []Histogram { return nil } -type LabelRef struct { - NameRef uint64 `protobuf:"varint,1,opt,name=name_ref,json=nameRef,proto3" json:"name_ref,omitempty"` - ValueRef uint64 `protobuf:"varint,2,opt,name=value_ref,json=valueRef,proto3" json:"value_ref,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LabelRef) Reset() { *m = LabelRef{} } -func (m *LabelRef) String() string { return proto.CompactTextString(m) } -func (*LabelRef) ProtoMessage() {} -func (*LabelRef) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{10} -} -func (m *LabelRef) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelRef.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 *LabelRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelRef.Merge(m, src) -} -func (m *LabelRef) XXX_Size() int { - return m.Size() -} -func (m *LabelRef) XXX_DiscardUnknown() { - xxx_messageInfo_LabelRef.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelRef proto.InternalMessageInfo - -func (m *LabelRef) GetNameRef() uint64 { - if m != nil { - return m.NameRef - } - return 0 -} - -func (m *LabelRef) GetValueRef() uint64 { - if m != nil { - return m.ValueRef - } - return 0 -} - type Label struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` @@ -1131,7 +820,7 @@ func (m *Label) Reset() { *m = Label{} } func (m *Label) String() string { return proto.CompactTextString(m) } func (*Label) ProtoMessage() {} func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{11} + return fileDescriptor_d938547f84707355, []int{7} } func (m *Label) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1185,7 +874,7 @@ func (m *Labels) Reset() { *m = Labels{} } func (m *Labels) String() string { return proto.CompactTextString(m) } func (*Labels) ProtoMessage() {} func (*Labels) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{12} + return fileDescriptor_d938547f84707355, []int{8} } func (m *Labels) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1235,7 +924,7 @@ func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } func (*LabelMatcher) ProtoMessage() {} func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{13} + return fileDescriptor_d938547f84707355, []int{9} } func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1302,7 +991,7 @@ func (m *ReadHints) Reset() { *m = ReadHints{} } func (m *ReadHints) String() string { return proto.CompactTextString(m) } func (*ReadHints) ProtoMessage() {} func (*ReadHints) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{14} + return fileDescriptor_d938547f84707355, []int{10} } func (m *ReadHints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1396,7 +1085,7 @@ func (m *Chunk) Reset() { *m = Chunk{} } func (m *Chunk) String() string { return proto.CompactTextString(m) } func (*Chunk) ProtoMessage() {} func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{15} + return fileDescriptor_d938547f84707355, []int{11} } func (m *Chunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1468,7 +1157,7 @@ func (m *ChunkedSeries) Reset() { *m = ChunkedSeries{} } func (m *ChunkedSeries) String() string { return proto.CompactTextString(m) } func (*ChunkedSeries) ProtoMessage() {} func (*ChunkedSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{16} + return fileDescriptor_d938547f84707355, []int{12} } func (m *ChunkedSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1513,21 +1202,16 @@ func (m *ChunkedSeries) GetChunks() []Chunk { func init() { proto.RegisterEnum("prometheus.MetricMetadata_MetricType", MetricMetadata_MetricType_name, MetricMetadata_MetricType_value) - proto.RegisterEnum("prometheus.MetricMetadataRef_MetricType", MetricMetadataRef_MetricType_name, MetricMetadataRef_MetricType_value) proto.RegisterEnum("prometheus.Histogram_ResetHint", Histogram_ResetHint_name, Histogram_ResetHint_value) proto.RegisterEnum("prometheus.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) proto.RegisterEnum("prometheus.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) proto.RegisterType((*MetricMetadata)(nil), "prometheus.MetricMetadata") - proto.RegisterType((*MetricMetadataRef)(nil), "prometheus.MetricMetadataRef") proto.RegisterType((*Sample)(nil), "prometheus.Sample") proto.RegisterType((*Exemplar)(nil), "prometheus.Exemplar") - proto.RegisterType((*ExemplarRef)(nil), "prometheus.ExemplarRef") proto.RegisterType((*Histogram)(nil), "prometheus.Histogram") proto.RegisterType((*BucketSpan)(nil), "prometheus.BucketSpan") proto.RegisterType((*TimeSeries)(nil), "prometheus.TimeSeries") - proto.RegisterType((*ReducedTimeSeries)(nil), "prometheus.ReducedTimeSeries") proto.RegisterType((*MinimizedTimeSeries)(nil), "prometheus.MinimizedTimeSeries") - proto.RegisterType((*LabelRef)(nil), "prometheus.LabelRef") proto.RegisterType((*Label)(nil), "prometheus.Label") proto.RegisterType((*Labels)(nil), "prometheus.Labels") proto.RegisterType((*LabelMatcher)(nil), "prometheus.LabelMatcher") @@ -1539,88 +1223,78 @@ func init() { func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } var fileDescriptor_d938547f84707355 = []byte{ - // 1282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xdd, 0x8e, 0xdb, 0xc4, - 0x17, 0x5f, 0xdb, 0x89, 0x63, 0x9f, 0x7c, 0xd4, 0x3b, 0xdd, 0xb6, 0x69, 0xff, 0xff, 0x6e, 0x17, - 0x4b, 0x85, 0x80, 0x50, 0xaa, 0x2e, 0x5c, 0x50, 0xb5, 0x02, 0xed, 0x6e, 0xb3, 0xdd, 0x8a, 0x26, - 0x51, 0x27, 0x59, 0x41, 0xb9, 0x89, 0x66, 0x93, 0x49, 0x62, 0x35, 0xfe, 0xc0, 0x33, 0xa9, 0x9a, - 0x5e, 0xf2, 0x0e, 0xdc, 0xf1, 0x12, 0xdc, 0xf0, 0x0c, 0x95, 0xb8, 0x81, 0x17, 0x40, 0xa8, 0x57, - 0x48, 0xbc, 0x04, 0x9a, 0x63, 0x3b, 0x4e, 0x9a, 0x16, 0xd1, 0xaa, 0x12, 0xe2, 0x6e, 0xce, 0xf7, - 0xef, 0x9c, 0x19, 0x9f, 0x73, 0x0c, 0x65, 0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, 0xa4, 0x65, 0x75, 0x5a, 0x0f, 0x93, 0x96, 0x45, 0xd5, 0x32, 0xa3, 0x18, - 0xb4, 0xe5, 0x18, 0xee, 0x8f, 0x9a, 0xea, 0x73, 0x6c, 0xa4, 0xda, 0x9c, 0x20, 0x97, 0xa0, 0x24, - 0x24, 0x8f, 0x06, 0xbe, 0x40, 0x5c, 0x06, 0x35, 0x15, 0xd9, 0x16, 0x2a, 0xf4, 0x78, 0x1e, 0x0c, - 0xb3, 0xd0, 0xea, 0xac, 0x0a, 0x2f, 0x24, 0x8b, 0xa5, 0xd2, 0x4e, 0xe6, 0x77, 0x09, 0xe9, 0xb6, - 0x20, 0x17, 0xc0, 0xe4, 0xc1, 0x68, 0x80, 0x17, 0xab, 0x04, 0x45, 0x1e, 0x8c, 0xda, 0x82, 0x5c, - 0x01, 0x6b, 0x12, 0x87, 0xf3, 0xc8, 0x0b, 0x26, 0xf5, 0xe2, 0x9e, 0xd1, 0xb0, 0xe9, 0x92, 0x26, - 0x35, 0xd0, 0xcf, 0x16, 0x38, 0x43, 0x2d, 0xaa, 0x9f, 0x2d, 0x94, 0xf7, 0x98, 0x05, 0x13, 0xae, - 0x9c, 0x94, 0x12, 0xef, 0x48, 0xb7, 0x85, 0xfb, 0xab, 0x06, 0xc5, 0xa3, 0xe9, 0x3c, 0x78, 0x4c, - 0x76, 0xa1, 0xec, 0x7b, 0xc1, 0x40, 0x75, 0xed, 0x1c, 0xb3, 0xed, 0x7b, 0x81, 0xfa, 0x02, 0xda, - 0x02, 0xe5, 0xec, 0xe9, 0x52, 0x9e, 0x6e, 0x53, 0x3e, 0x7b, 0x9a, 0xca, 0x9b, 0xe9, 0x25, 0x18, - 0x78, 0x09, 0x57, 0x56, 0x2f, 0x01, 0x03, 0x34, 0x5b, 0xc1, 0x30, 0x1c, 0x79, 0xc1, 0x24, 0xbf, - 0x01, 0xfc, 0x44, 0x55, 0x56, 0x15, 0x8a, 0x67, 0xf7, 0x2e, 0x58, 0x99, 0xd6, 0xc6, 0x9c, 0xf8, - 0xba, 0xab, 0x96, 0xc8, 0xb5, 0xcd, 0x51, 0x27, 0xe7, 0xe1, 0xdc, 0xf1, 0x83, 0xee, 0x41, 0x7f, - 0xb0, 0xb2, 0x4e, 0xba, 0xdf, 0x42, 0x15, 0x23, 0xf2, 0xd1, 0xdb, 0x76, 0xf9, 0x1b, 0x60, 0x0e, - 0x95, 0x87, 0xec, 0xeb, 0xdd, 0xde, 0xc8, 0x26, 0x33, 0x48, 0xd4, 0x0e, 0x77, 0x9e, 0xbf, 0xd8, - 0xd5, 0x7e, 0x79, 0xb1, 0xab, 0xfd, 0xfe, 0x62, 0x57, 0xfb, 0xc6, 0x54, 0xda, 0xd1, 0xd9, 0x99, - 0x89, 0x7f, 0x32, 0x9f, 0xfc, 0x15, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x7b, 0xd7, 0x1b, 0xfa, 0x0c, - 0x00, 0x00, + // 1129 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xdd, 0x8e, 0xdb, 0x44, + 0x14, 0x5e, 0xdb, 0x89, 0x13, 0x9f, 0xfc, 0xd4, 0x3b, 0xdd, 0x16, 0x53, 0xd1, 0x6d, 0xb0, 0x54, + 0x08, 0x08, 0x65, 0xd5, 0x85, 0x0b, 0x2a, 0x2a, 0xa4, 0xdd, 0x6d, 0xf6, 0x47, 0xac, 0x13, 0x75, + 0x92, 0x15, 0x94, 0x1b, 0x6b, 0x92, 0xcc, 0x26, 0x56, 0xfd, 0x87, 0x67, 0x52, 0x6d, 0xfa, 0x1e, + 0xdc, 0xf1, 0x12, 0xbc, 0x45, 0x25, 0x6e, 0xe0, 0x05, 0x10, 0xda, 0x2b, 0x24, 0x5e, 0x02, 0xcd, + 0xd8, 0x8e, 0x9d, 0x6e, 0x91, 0x28, 0x77, 0xdc, 0xcd, 0xf9, 0xce, 0xdf, 0x37, 0x73, 0xe6, 0xcc, + 0x19, 0x68, 0xf0, 0x55, 0x4c, 0x59, 0x2f, 0x4e, 0x22, 0x1e, 0x21, 0x88, 0x93, 0x28, 0xa0, 0x7c, + 0x41, 0x97, 0xec, 0xde, 0xce, 0x3c, 0x9a, 0x47, 0x12, 0xde, 0x13, 0xab, 0xd4, 0xc2, 0xfe, 0x49, + 0x85, 0xb6, 0x43, 0x79, 0xe2, 0x4d, 0x1d, 0xca, 0xc9, 0x8c, 0x70, 0x82, 0x1e, 0x43, 0x45, 0xc4, + 0xb0, 0x94, 0x8e, 0xd2, 0x6d, 0xef, 0x3f, 0xec, 0x15, 0x31, 0x7a, 0x9b, 0x96, 0x99, 0x38, 0x5e, + 0xc5, 0x14, 0x4b, 0x17, 0xf4, 0x19, 0xa0, 0x40, 0x62, 0xee, 0x25, 0x09, 0x3c, 0x7f, 0xe5, 0x86, + 0x24, 0xa0, 0x96, 0xda, 0x51, 0xba, 0x06, 0x36, 0x53, 0xcd, 0xb1, 0x54, 0x0c, 0x48, 0x40, 0x11, + 0x82, 0xca, 0x82, 0xfa, 0xb1, 0x55, 0x91, 0x7a, 0xb9, 0x16, 0xd8, 0x32, 0xf4, 0xb8, 0x55, 0x4d, + 0x31, 0xb1, 0xb6, 0x57, 0x00, 0x45, 0x26, 0xd4, 0x80, 0xda, 0xc5, 0xe0, 0x9b, 0xc1, 0xf0, 0xdb, + 0x81, 0xb9, 0x25, 0x84, 0xa3, 0xe1, 0xc5, 0x60, 0xdc, 0xc7, 0xa6, 0x82, 0x0c, 0xa8, 0x9e, 0x1c, + 0x5c, 0x9c, 0xf4, 0x4d, 0x15, 0xb5, 0xc0, 0x38, 0x3d, 0x1b, 0x8d, 0x87, 0x27, 0xf8, 0xc0, 0x31, + 0x35, 0x84, 0xa0, 0x2d, 0x35, 0x05, 0x56, 0x11, 0xae, 0xa3, 0x0b, 0xc7, 0x39, 0xc0, 0xcf, 0xcd, + 0x2a, 0xaa, 0x43, 0xe5, 0x6c, 0x70, 0x3c, 0x34, 0x75, 0xd4, 0x84, 0xfa, 0x68, 0x7c, 0x30, 0xee, + 0x8f, 0xfa, 0x63, 0xb3, 0x66, 0x3f, 0x01, 0x7d, 0x44, 0x82, 0xd8, 0xa7, 0x68, 0x07, 0xaa, 0x2f, + 0x89, 0xbf, 0x4c, 0x8f, 0x45, 0xc1, 0xa9, 0x80, 0x3e, 0x00, 0x83, 0x7b, 0x01, 0x65, 0x9c, 0x04, + 0xb1, 0xdc, 0xa7, 0x86, 0x0b, 0xc0, 0x8e, 0xa0, 0xde, 0xbf, 0xa2, 0x41, 0xec, 0x93, 0x04, 0xed, + 0x81, 0xee, 0x93, 0x09, 0xf5, 0x99, 0xa5, 0x74, 0xb4, 0x6e, 0x63, 0x7f, 0xbb, 0x7c, 0xae, 0xe7, + 0x42, 0x73, 0x58, 0x79, 0xfd, 0xfb, 0x83, 0x2d, 0x9c, 0x99, 0x15, 0x09, 0xd5, 0x7f, 0x4c, 0xa8, + 0xbd, 0x99, 0xf0, 0x97, 0x2a, 0x18, 0xa7, 0x1e, 0xe3, 0xd1, 0x3c, 0x21, 0x01, 0xba, 0x0f, 0xc6, + 0x34, 0x5a, 0x86, 0xdc, 0xf5, 0x42, 0x2e, 0x69, 0x57, 0x4e, 0xb7, 0x70, 0x5d, 0x42, 0x67, 0x21, + 0x47, 0x1f, 0x42, 0x23, 0x55, 0x5f, 0xfa, 0x11, 0xe1, 0x69, 0x9a, 0xd3, 0x2d, 0x0c, 0x12, 0x3c, + 0x16, 0x18, 0x32, 0x41, 0x63, 0xcb, 0x40, 0xe6, 0x51, 0xb0, 0x58, 0xa2, 0xbb, 0xa0, 0xb3, 0xe9, + 0x82, 0x06, 0x44, 0x56, 0x6d, 0x1b, 0x67, 0x12, 0x7a, 0x08, 0xed, 0x57, 0x34, 0x89, 0x5c, 0xbe, + 0x48, 0x28, 0x5b, 0x44, 0xfe, 0x4c, 0x56, 0x50, 0xc1, 0x2d, 0x81, 0x8e, 0x73, 0x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x01, + 0xb9, 0xca, 0xf4, 0xbd, 0xac, 0x08, 0x9a, 0x2c, 0xc2, 0xbd, 0x72, 0x11, 0x64, 0x82, 0x5e, 0x3f, + 0x9c, 0x46, 0x33, 0x2f, 0x9c, 0x17, 0x15, 0x10, 0x3f, 0x16, 0xb9, 0xab, 0x26, 0x96, 0x6b, 0xfb, + 0x29, 0xd4, 0x73, 0xab, 0x1b, 0x4f, 0xd5, 0x77, 0x43, 0xf1, 0xa1, 0xd8, 0xf8, 0x45, 0xa8, 0xe8, + 0x36, 0xdc, 0x3a, 0x3e, 0x1f, 0x1e, 0x8c, 0xdd, 0xd2, 0xd7, 0xc2, 0xfe, 0x01, 0x5a, 0x32, 0x23, + 0x9d, 0xfd, 0xd7, 0x87, 0x66, 0x0f, 0xf4, 0xa9, 0x88, 0x90, 0x77, 0xde, 0xf6, 0x8d, 0xdd, 0xe4, + 0x0e, 0xa9, 0xd9, 0xe1, 0xce, 0xeb, 0xeb, 0x5d, 0xe5, 0xd7, 0xeb, 0x5d, 0xe5, 0x8f, 0xeb, 0x5d, + 0xe5, 0x7b, 0x5d, 0x58, 0xc7, 0x93, 0x89, 0x2e, 0x3f, 0x74, 0x9f, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0xff, 0x7c, 0x73, 0x0c, 0xa7, 0x01, 0x0a, 0x00, 0x00, } func (m *MetricMetadata) Marshal() (dAtA []byte, err error) { @@ -1676,48 +1350,6 @@ func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MetricMetadataRef) 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 *MetricMetadataRef) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricMetadataRef) 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 m.UnitRef != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.UnitRef)) - i-- - dAtA[i] = 0x28 - } - if m.HelpRef != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.HelpRef)) - i-- - dAtA[i] = 0x20 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *Sample) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1808,58 +1440,6 @@ func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ExemplarRef) 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 *ExemplarRef) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExemplarRef) 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 m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x18 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x11 - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *Histogram) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2188,99 +1768,6 @@ func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ReducedTimeSeries) 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 *ReducedTimeSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReducedTimeSeries) 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) - } - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Histograms) > 0 { - for iNdEx := len(m.Histograms) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Histograms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Exemplars) > 0 { - for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *MinimizedTimeSeries) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2348,63 +1835,26 @@ func (m *MinimizedTimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } if len(m.LabelSymbols) > 0 { - dAtA11 := make([]byte, len(m.LabelSymbols)*10) - var j10 int + dAtA10 := make([]byte, len(m.LabelSymbols)*10) + var j9 int for _, num := range m.LabelSymbols { for num >= 1<<7 { - dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) + dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j10++ + j9++ } - dAtA11[j10] = uint8(num) - j10++ + dAtA10[j9] = uint8(num) + j9++ } - i -= j10 - copy(dAtA[i:], dAtA11[:j10]) - i = encodeVarintTypes(dAtA, i, uint64(j10)) + i -= j9 + copy(dAtA[i:], dAtA10[:j9]) + i = encodeVarintTypes(dAtA, i, uint64(j9)) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *LabelRef) 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 *LabelRef) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelRef) 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 m.ValueRef != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ValueRef)) - i-- - dAtA[i] = 0x10 - } - if m.NameRef != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.NameRef)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2748,27 +2198,6 @@ func (m *MetricMetadata) Size() (n int) { return n } -func (m *MetricMetadataRef) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.HelpRef != 0 { - n += 1 + sovTypes(uint64(m.HelpRef)) - } - if m.UnitRef != 0 { - n += 1 + sovTypes(uint64(m.UnitRef)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *Sample) Size() (n int) { if m == nil { return 0 @@ -2811,30 +2240,6 @@ func (m *Exemplar) Size() (n int) { return n } -func (m *ExemplarRef) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *Histogram) Size() (n int) { if m == nil { return 0 @@ -2990,44 +2395,6 @@ func (m *TimeSeries) Size() (n int) { return n } -func (m *ReducedTimeSeries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Samples) > 0 { - for _, e := range m.Samples { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Exemplars) > 0 { - for _, e := range m.Exemplars { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Histograms) > 0 { - for _, e := range m.Histograms { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - l = m.Metadata.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *MinimizedTimeSeries) Size() (n int) { if m == nil { return 0 @@ -3065,24 +2432,6 @@ func (m *MinimizedTimeSeries) Size() (n int) { return n } -func (m *LabelRef) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NameRef != 0 { - n += 1 + sovTypes(uint64(m.NameRef)) - } - if m.ValueRef != 0 { - n += 1 + sovTypes(uint64(m.ValueRef)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *Label) Size() (n int) { if m == nil { return 0 @@ -3402,114 +2751,6 @@ func (m *MetricMetadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *MetricMetadataRef) 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 ErrIntOverflowTypes - } - 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: MetricMetadataRef: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadataRef: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= MetricMetadataRef_MetricType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HelpRef", wireType) - } - m.HelpRef = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HelpRef |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnitRef", wireType) - } - m.UnitRef = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnitRef |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 *Sample) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3706,121 +2947,6 @@ func (m *Exemplar) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExemplarRef) 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 ErrIntOverflowTypes - } - 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: ExemplarRef: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExemplarRef: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, LabelRef{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 *Histogram) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4625,226 +3751,6 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { } return nil } -func (m *ReducedTimeSeries) 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 ErrIntOverflowTypes - } - 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: ReducedTimeSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReducedTimeSeries: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, LabelRef{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Samples = append(m.Samples, Sample{}) - if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Exemplars = append(m.Exemplars, ExemplarRef{}) - if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Histograms", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Histograms = append(m.Histograms, Histogram{}) - if err := m.Histograms[len(m.Histograms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 *MinimizedTimeSeries) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5074,95 +3980,6 @@ func (m *MinimizedTimeSeries) Unmarshal(dAtA []byte) error { } return nil } -func (m *LabelRef) 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 ErrIntOverflowTypes - } - 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: LabelRef: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelRef: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NameRef", wireType) - } - m.NameRef = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NameRef |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValueRef", wireType) - } - m.ValueRef = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValueRef |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 *Label) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/prompb/types.proto b/prompb/types.proto index 012a59682..d436004eb 100644 --- a/prompb/types.proto +++ b/prompb/types.proto @@ -38,24 +38,6 @@ message MetricMetadata { string unit = 5; } -message MetricMetadataRef { - enum MetricType { - UNKNOWN = 0; - COUNTER = 1; - GAUGE = 2; - HISTOGRAM = 3; - GAUGEHISTOGRAM = 4; - SUMMARY = 5; - INFO = 6; - STATESET = 7; - } - - // Represents the metric type, these match the set from Prometheus. - // Refer to model/textparse/interface.go for details. - MetricType type = 1; - int64 help_ref = 4; - int64 unit_ref = 5; -} message Sample { double value = 1; // timestamp is in ms format, see model/timestamp/timestamp.go for @@ -72,14 +54,6 @@ message Exemplar { int64 timestamp = 3; } -message ExemplarRef { - // Optional, can be empty. - repeated LabelRef labels = 1 [(gogoproto.nullable) = false]; - double value = 2; - // timestamp is in ms format, see model/timestamp/timestamp.go for - // conversion from time.Time to Prometheus timestamp. - int64 timestamp = 3; -} // A native histogram, also known as a sparse histogram. // Original design doc: @@ -156,17 +130,6 @@ message TimeSeries { repeated Histogram histograms = 4 [(gogoproto.nullable) = false]; } -// TimeSeries represents samples and labels for a single time series. -message ReducedTimeSeries { - // For a timeseries to be valid, and for the samples and exemplars - // to be ingested by the remote system properly, the labels field is required. - repeated LabelRef labels = 1 [(gogoproto.nullable) = false]; - repeated Sample samples = 2 [(gogoproto.nullable) = false]; - repeated ExemplarRef exemplars = 3 [(gogoproto.nullable) = false]; - repeated Histogram histograms = 4 [(gogoproto.nullable) = false]; - MetricMetadataRef metadata = 5 [(gogoproto.nullable) = false]; -} - // based on an experiment by marco message MinimizedTimeSeries { // Sorted list of label name-value pair references. This list's len is always multiple of 4, @@ -178,11 +141,7 @@ message MinimizedTimeSeries { repeated Sample samples = 2 [(gogoproto.nullable) = false]; repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false]; repeated Histogram histograms = 4 [(gogoproto.nullable) = false]; -} - -message LabelRef { - uint64 name_ref = 1; - uint64 value_ref = 2; + // TODO: add metadata } message Label { diff --git a/scripts/remotewrite11-bench/run.sh b/scripts/remotewrite11-bench/run.sh index 60dd1fadf..235c40f40 100755 --- a/scripts/remotewrite11-bench/run.sh +++ b/scripts/remotewrite11-bench/run.sh @@ -8,7 +8,6 @@ declare -a INSTANCES # (sender,receiver) pairs to run: (sender_name; sender_flags; receiver_name; receiver_flags) INSTANCES+=('sender-v1;;receiver-v1;') INSTANCES+=('sender-v11;--enable-feature rw-1-1-sender;receiver-v11;--enable-feature rw-1-1-receiver') -INSTANCES+=('sender-v11-min;--enable-feature rw-1-1-sender-min;receiver-v11-min;--enable-feature rw-1-1-receiver-min') # ~~~~~~~~~~~~~ diff --git a/storage/remote/codec.go b/storage/remote/codec.go index 16a9c5f14..770a795c6 100644 --- a/storage/remote/codec.go +++ b/storage/remote/codec.go @@ -770,26 +770,6 @@ func labelProtosToLabels(labelPairs []prompb.Label) labels.Labels { return b.Labels() } -func labelRefProtosToLabels(st map[uint64]string, lbls []prompb.LabelRef) labels.Labels { - b := labels.NewScratchBuilder(len(lbls)) - for _, l := range lbls { - b.Add(st[l.NameRef], st[l.ValueRef]) - } - b.Sort() - return b.Labels() -} - -func exemplarRefProtoToExemplar(st map[uint64]string, ep prompb.ExemplarRef) exemplar.Exemplar { - timestamp := ep.Timestamp - - return exemplar.Exemplar{ - Labels: labelRefProtosToLabels(st, ep.Labels), - Value: ep.Value, - Ts: timestamp, - HasTs: timestamp != 0, - } -} - // labelsToLabelsProto transforms labels into prompb labels. The buffer slice // will be used to avoid allocations if it is big enough to store the labels. func labelsToLabelsProto(lbls labels.Labels, buf []prompb.Label) []prompb.Label { @@ -803,20 +783,6 @@ func labelsToLabelsProto(lbls labels.Labels, buf []prompb.Label) []prompb.Label return result } -// labelsToLabelsRefProto transforms labels into prompb LabelRefs. The buffer slice -// will be used to avoid allocations if it is big enough to store the labels. -func labelsToLabelRefsProto(lbls labels.Labels, pool *lookupPool, buf []prompb.LabelRef) []prompb.LabelRef { - result := buf[:0] - lbls.Range(func(l labels.Label) { - result = append(result, prompb.LabelRef{ - NameRef: pool.intern(l.Name), - ValueRef: pool.intern(l.Value), - }) - }) - - return result -} - func labelsToUint32Slice(lbls labels.Labels, symbolTable *rwSymbolTable, buf []uint32) []uint32 { result := buf[:0] lbls.Range(func(l labels.Label) { @@ -936,27 +902,6 @@ func DecodeOTLPWriteRequest(r *http.Request) (pmetricotlp.ExportRequest, error) return otlpReq, nil } -// DecodeWriteRequest from an io.Reader into a prompb.WriteRequest, handling -// snappy decompression. -func DecodeReducedWriteRequest(r io.Reader) (*prompb.WriteRequestWithRefs, error) { - compressed, err := io.ReadAll(r) - if err != nil { - return nil, err - } - - reqBuf, err := snappy.Decode(nil, compressed) - if err != nil { - return nil, err - } - - var req prompb.WriteRequestWithRefs - if err := proto.Unmarshal(reqBuf, &req); err != nil { - return nil, err - } - - return &req, nil -} - // DecodeMinimizedWriteRequest from an io.Reader into a prompb.WriteRequest, handling // snappy decompression. func DecodeMinimizedWriteRequest(r io.Reader) (*prompb.MinimizedWriteRequest, error) { @@ -978,33 +923,27 @@ func DecodeMinimizedWriteRequest(r io.Reader) (*prompb.MinimizedWriteRequest, er return &req, nil } -func ReducedWriteRequestToWriteRequest(redReq *prompb.WriteRequestWithRefs) (*prompb.WriteRequest, error) { +func MinimizedWriteRequestToWriteRequest(redReq *prompb.MinimizedWriteRequest) (*prompb.WriteRequest, error) { req := &prompb.WriteRequest{ Timeseries: make([]prompb.TimeSeries, len(redReq.Timeseries)), //Metadata: redReq.Metadata, } for i, rts := range redReq.Timeseries { - - lbls := make([]prompb.Label, len(rts.Labels)) - for j, l := range rts.Labels { - lbls[j].Name = redReq.StringSymbolTable[l.NameRef] - lbls[j].Value = redReq.StringSymbolTable[l.ValueRef] - } + Uint32RefToLabels(redReq.Symbols, rts.LabelSymbols).Range(func(l labels.Label) { + req.Timeseries[i].Labels = append(req.Timeseries[i].Labels, prompb.Label{ + Name: l.Name, + Value: l.Value, + }) + }) exemplars := make([]prompb.Exemplar, len(rts.Exemplars)) for j, e := range rts.Exemplars { exemplars[j].Value = e.Value exemplars[j].Timestamp = e.Timestamp - exemplars[j].Labels = make([]prompb.Label, len(e.Labels)) - - for k, l := range e.Labels { - exemplars[j].Labels[k].Name = redReq.StringSymbolTable[l.NameRef] - exemplars[j].Labels[k].Value = redReq.StringSymbolTable[l.ValueRef] - } + exemplars[j].Labels = e.Labels } - req.Timeseries[i].Labels = lbls req.Timeseries[i].Samples = rts.Samples req.Timeseries[i].Exemplars = exemplars req.Timeseries[i].Histograms = rts.Histograms diff --git a/storage/remote/codec_test.go b/storage/remote/codec_test.go index 6faff945c..e9ee7c4a8 100644 --- a/storage/remote/codec_test.go +++ b/storage/remote/codec_test.go @@ -74,59 +74,6 @@ var writeRequestFixture = &prompb.WriteRequest{ }, } -// writeRequestWithRefsFixture represents the same request as writeRequestFixture, but using the reduced representation. -var writeRequestWithRefsFixture = &prompb.WriteRequestWithRefs{ - StringSymbolTable: map[uint64]string{ - // Names - 0: "__name__", - 2: "b", - 4: "baz", - 6: "d", - 8: "foo", - 10: "f", - 12: "h", - // Values - 1: "test_metric1", - 3: "c", - 5: "qux", - 7: "e", - 9: "bar", - 11: "g", - 13: "i", - }, - - Timeseries: []prompb.ReducedTimeSeries{ - { - Labels: []prompb.LabelRef{ - {NameRef: 0, ValueRef: 1}, - {NameRef: 2, ValueRef: 3}, - {NameRef: 4, ValueRef: 5}, - {NameRef: 6, ValueRef: 7}, - {NameRef: 8, ValueRef: 9}, - }, - Samples: []prompb.Sample{{Value: 1, Timestamp: 0}}, - Exemplars: []prompb.ExemplarRef{{Labels: []prompb.LabelRef{ - {NameRef: 10, ValueRef: 11}, - }, Value: 1, Timestamp: 0}}, - Histograms: []prompb.Histogram{HistogramToHistogramProto(0, &testHistogram), FloatHistogramToHistogramProto(1, testHistogram.ToFloat())}, - }, - { - Labels: []prompb.LabelRef{ - {NameRef: 0, ValueRef: 1}, - {NameRef: 2, ValueRef: 3}, - {NameRef: 4, ValueRef: 5}, - {NameRef: 6, ValueRef: 7}, - {NameRef: 8, ValueRef: 9}, - }, - Samples: []prompb.Sample{{Value: 2, Timestamp: 1}}, - Exemplars: []prompb.ExemplarRef{{Labels: []prompb.LabelRef{ - {NameRef: 12, ValueRef: 13}, - }, Value: 2, Timestamp: 1}}, - Histograms: []prompb.Histogram{HistogramToHistogramProto(2, &testHistogram), FloatHistogramToHistogramProto(3, testHistogram.ToFloat())}, - }, - }, -} - // writeRequestMinimizedFixture represents the same request as writeRequestFixture, but using the minimized representation. var writeRequestMinimizedFixture = func() *prompb.MinimizedWriteRequest { st := newRwSymbolTable() @@ -611,16 +558,6 @@ func TestDecodeWriteRequest(t *testing.T) { require.Equal(t, writeRequestFixture, actual) } -func TestDecodeReducedWriteRequest(t *testing.T) { - buf, _, err := buildReducedWriteRequest(writeRequestWithRefsFixture.Timeseries, writeRequestWithRefsFixture.StringSymbolTable, nil, nil) - - require.NoError(t, err) - - actual, err := DecodeReducedWriteRequest(bytes.NewReader(buf)) - require.NoError(t, err) - require.Equal(t, writeRequestWithRefsFixture, actual) -} - func TestDecodeMinWriteRequest(t *testing.T) { buf, _, err := buildMinimizedWriteRequest(writeRequestMinimizedFixture.Timeseries, writeRequestMinimizedFixture.Symbols, nil, nil) @@ -631,8 +568,8 @@ func TestDecodeMinWriteRequest(t *testing.T) { require.Equal(t, writeRequestMinimizedFixture, actual) } -func TestReducedWriteRequestToWriteRequest(t *testing.T) { - actual, err := ReducedWriteRequestToWriteRequest(writeRequestWithRefsFixture) +func TestMinimizedWriteRequestToWriteRequest(t *testing.T) { + actual, err := MinimizedWriteRequestToWriteRequest(writeRequestMinimizedFixture) require.NoError(t, err) require.Equal(t, writeRequestFixture, actual) diff --git a/storage/remote/intern.go b/storage/remote/intern.go index 3968ca307..23047acd9 100644 --- a/storage/remote/intern.go +++ b/storage/remote/intern.go @@ -100,44 +100,3 @@ func (p *pool) release(s string) { } delete(p.pool, s) } - -// used to create a lookup table for a new remote write request, should not be used concurrently -type lookupPool struct { - nextRef uint64 - table map[uint64]string - reverseTable map[string]uint64 -} - -func newLookupPool() *lookupPool { - return &lookupPool{ - table: map[uint64]string{}, - reverseTable: map[string]uint64{}, - } -} - -func (p *lookupPool) intern(s string) uint64 { - if ref, ok := p.reverseTable[s]; ok { - return ref - } - - ref := p.nextRef - p.reverseTable[s] = ref - p.table[ref] = s - p.nextRef++ - - return ref -} - -func (p *lookupPool) getTable() map[uint64]string { - return p.table -} - -func (p *lookupPool) clear() { - for k := range p.table { - delete(p.table, k) - } - for k := range p.reverseTable { - delete(p.reverseTable, k) - } - p.nextRef = 0 -} diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index e44ad48e5..43c83b4ce 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -406,8 +406,7 @@ type QueueManager struct { watcher *wlog.Watcher metadataWatcher *MetadataWatcher // experimental feature, new remote write proto format - internFormat bool - secondInternFormat bool + internFormat bool clientMtx sync.RWMutex storeClient WriteClient @@ -456,7 +455,6 @@ func NewQueueManager( enableExemplarRemoteWrite bool, enableNativeHistogramRemoteWrite bool, internFormat bool, - secondInternFormat bool, ) *QueueManager { if logger == nil { logger = log.NewNopLogger() @@ -480,7 +478,6 @@ func NewQueueManager( sendExemplars: enableExemplarRemoteWrite, sendNativeHistograms: enableNativeHistogramRemoteWrite, internFormat: internFormat, - secondInternFormat: secondInternFormat, seriesLabels: make(map[chunks.HeadSeriesRef]labels.Labels), seriesSegmentIndexes: make(map[chunks.HeadSeriesRef]int), @@ -1351,7 +1348,6 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) { }() shardNum := strconv.Itoa(shardID) - pool := newLookupPool() symbolTable := newRwSymbolTable() // Send batches of at most MaxSamplesPerSend samples to the remote storage. @@ -1376,14 +1372,6 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) { } } - pendingReducedData := make([]prompb.ReducedTimeSeries, max) - for i := range pendingReducedData { - pendingReducedData[i].Samples = []prompb.Sample{{}} - if s.qm.sendExemplars { - pendingReducedData[i].Exemplars = []prompb.ExemplarRef{{}} - } - } - pendingMinimizedData := make([]prompb.MinimizedTimeSeries, max) for i := range pendingMinimizedData { pendingMinimizedData[i].Samples = []prompb.Sample{{}} @@ -1423,18 +1411,12 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) { if !ok { return } - if s.qm.secondInternFormat { + if s.qm.internFormat { nPendingSamples, nPendingExemplars, nPendingHistograms := populateMinimizedTimeSeries(&symbolTable, batch, pendingMinimizedData, s.qm.sendExemplars, s.qm.sendNativeHistograms) n := nPendingSamples + nPendingExemplars + nPendingHistograms s.sendMinSamples(ctx, pendingMinimizedData[:n], symbolTable.LabelsString(), nPendingSamples, nPendingExemplars, nPendingHistograms, &pBufRaw, &buf) symbolTable.clear() - } else if s.qm.internFormat && !s.qm.secondInternFormat { - // the new internFormat feature flag is be set - nPendingSamples, nPendingExemplars, nPendingHistograms := populateReducedTimeSeries(pool, batch, pendingReducedData, s.qm.sendExemplars, s.qm.sendNativeHistograms) - n := nPendingSamples + nPendingExemplars + nPendingHistograms - s.sendReducedSamples(ctx, pendingReducedData[:n], pool.table, nPendingSamples, nPendingExemplars, nPendingHistograms, pBuf, &buf) - pool.clear() } else { nPendingSamples, nPendingExemplars, nPendingHistograms := populateTimeSeries(batch, pendingData, s.qm.sendExemplars, s.qm.sendNativeHistograms) n := nPendingSamples + nPendingExemplars + nPendingHistograms @@ -1449,14 +1431,11 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) { batch := queue.Batch() if len(batch) > 0 { if s.qm.internFormat { - // the new internFormat feature flag is set - nPendingSamples, nPendingExemplars, nPendingHistograms := populateReducedTimeSeries(pool, batch, pendingReducedData, s.qm.sendExemplars, s.qm.sendNativeHistograms) - n := nPendingSamples + nPendingExemplars + nPendingHistograms - level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending buffered data", "samples", nPendingSamples, - "exemplars", nPendingExemplars, "shard", shardNum, "histograms", nPendingHistograms) - s.sendReducedSamples(ctx, pendingReducedData[:n], pool.table, nPendingSamples, nPendingExemplars, nPendingHistograms, pBuf, &buf) - pool.clear() + nPendingSamples, nPendingExemplars, nPendingHistograms := populateMinimizedTimeSeries(&symbolTable, batch, pendingMinimizedData, s.qm.sendExemplars, s.qm.sendNativeHistograms) + n := nPendingSamples + nPendingExemplars + nPendingHistograms + s.sendMinSamples(ctx, pendingMinimizedData[:n], symbolTable.LabelsString(), nPendingSamples, nPendingExemplars, nPendingHistograms, &pBufRaw, &buf) + symbolTable.clear() } else { nPendingSamples, nPendingExemplars, nPendingHistograms := populateTimeSeries(batch, pendingData, s.qm.sendExemplars, s.qm.sendNativeHistograms) n := nPendingSamples + nPendingExemplars + nPendingHistograms @@ -1523,18 +1502,6 @@ func (s *shards) sendSamples(ctx context.Context, samples []prompb.TimeSeries, s s.updateMetrics(ctx, err, sampleCount, exemplarCount, histogramCount, time.Since(begin)) } -func (s *shards) sendReducedSamples(ctx context.Context, samples []prompb.ReducedTimeSeries, labels map[uint64]string, sampleCount, exemplarCount, histogramCount int, pBuf *proto.Buffer, buf *[]byte) { - begin := time.Now() - // Build the ReducedWriteRequest with no metadata. - // Failing to build the write request is non-recoverable, since it will - // only error if marshaling the proto to bytes fails. - req, highest, err := buildReducedWriteRequest(samples, labels, pBuf, buf) - if err == nil { - err = s.sendSamplesWithBackoff(ctx, req, sampleCount, exemplarCount, histogramCount, highest) - } - s.updateMetrics(ctx, err, sampleCount, exemplarCount, histogramCount, time.Since(begin)) -} - func (s *shards) sendMinSamples(ctx context.Context, samples []prompb.MinimizedTimeSeries, labels string, sampleCount, exemplarCount, histogramCount int, pBuf *[]byte, buf *[]byte) { begin := time.Now() // Build the ReducedWriteRequest with no metadata. @@ -1629,54 +1596,6 @@ func (s *shards) sendSamplesWithBackoff(ctx context.Context, rawReq []byte, samp return err } -func populateReducedTimeSeries(pool *lookupPool, batch []timeSeries, pendingData []prompb.ReducedTimeSeries, sendExemplars, sendNativeHistograms bool) (int, int, int) { - var nPendingSamples, nPendingExemplars, nPendingHistograms int - for nPending, d := range batch { - pendingData[nPending].Samples = pendingData[nPending].Samples[:0] - if sendExemplars { - pendingData[nPending].Exemplars = pendingData[nPending].Exemplars[:0] - } - if sendNativeHistograms { - pendingData[nPending].Histograms = pendingData[nPending].Histograms[:0] - } - - // Number of pending samples is limited by the fact that sendSamples (via sendSamplesWithBackoff) - // retries endlessly, so once we reach max samples, if we can never send to the endpoint we'll - // stop reading from the queue. This makes it safe to reference pendingSamples by index. - // pendingData[nPending].Labels = labelsToLabelsProto(d.seriesLabels, pendingData[nPending].Labels) - pendingData[nPending].Labels = labelsToLabelRefsProto(d.seriesLabels, pool, pendingData[nPending].Labels) - switch d.sType { - case tSample: - pendingData[nPending].Samples = append(pendingData[nPending].Samples, prompb.Sample{ - Value: d.value, - Timestamp: d.timestamp, - }) - nPendingSamples++ - case tExemplar: - // TODO(npazosmendez) optimize? - l := make([]prompb.LabelRef, 0, d.exemplarLabels.Len()) - d.exemplarLabels.Range(func(el labels.Label) { - nRef := pool.intern(el.Name) - vRef := pool.intern(el.Value) - l = append(l, prompb.LabelRef{NameRef: nRef, ValueRef: vRef}) - }) - pendingData[nPending].Exemplars = append(pendingData[nPending].Exemplars, prompb.ExemplarRef{ - Labels: l, - Value: d.value, - Timestamp: d.timestamp, - }) - nPendingExemplars++ - case tHistogram: - pendingData[nPending].Histograms = append(pendingData[nPending].Histograms, HistogramToHistogramProto(d.timestamp, d.histogram)) - nPendingHistograms++ - case tFloatHistogram: - pendingData[nPending].Histograms = append(pendingData[nPending].Histograms, FloatHistogramToHistogramProto(d.timestamp, d.floatHistogram)) - nPendingHistograms++ - } - } - return nPendingSamples, nPendingExemplars, nPendingHistograms -} - func populateMinimizedTimeSeries(symbolTable *rwSymbolTable, batch []timeSeries, pendingData []prompb.MinimizedTimeSeries, sendExemplars, sendNativeHistograms bool) (int, int, int) { var nPendingSamples, nPendingExemplars, nPendingHistograms int for nPending, d := range batch { @@ -1825,52 +1744,6 @@ func buildWriteRequest(samples []prompb.TimeSeries, metadata []prompb.MetricMeta return compressed, highest, nil } -func buildReducedWriteRequest(samples []prompb.ReducedTimeSeries, labels map[uint64]string, pBuf *proto.Buffer, buf *[]byte) ([]byte, int64, error) { - var highest int64 - for _, ts := range samples { - // At the moment we only ever append a TimeSeries with a single sample or exemplar in it. - if len(ts.Samples) > 0 && ts.Samples[0].Timestamp > highest { - highest = ts.Samples[0].Timestamp - } - if len(ts.Exemplars) > 0 && ts.Exemplars[0].Timestamp > highest { - highest = ts.Exemplars[0].Timestamp - } - if len(ts.Histograms) > 0 && ts.Histograms[0].Timestamp > highest { - highest = ts.Histograms[0].Timestamp - } - } - - req := &prompb.WriteRequestWithRefs{ - StringSymbolTable: labels, - Timeseries: samples, - } - - if pBuf == nil { - pBuf = proto.NewBuffer(nil) // For convenience in tests. Not efficient. - } else { - pBuf.Reset() - } - err := pBuf.Marshal(req) - if err != nil { - return nil, 0, err - } - - // snappy uses len() to see if it needs to allocate a new slice. Make the - // buffer as long as possible. - if buf != nil { - *buf = (*buf)[0:cap(*buf)] - } else { - buf = &[]byte{} - } - - compressed := snappy.Encode(*buf, pBuf.Bytes()) - if n := snappy.MaxEncodedLen(len(pBuf.Bytes())); buf != nil && n > len(*buf) { - // grow the buffer for the next time - *buf = make([]byte, n) - } - return compressed, highest, nil -} - type offLenPair struct { Off uint32 Len uint32 diff --git a/storage/remote/queue_manager_test.go b/storage/remote/queue_manager_test.go index de426d6a4..a05a35d16 100644 --- a/storage/remote/queue_manager_test.go +++ b/storage/remote/queue_manager_test.go @@ -62,13 +62,12 @@ func newHighestTimestampMetric() *maxTimestamp { func TestSampleDelivery(t *testing.T) { testcases := []struct { - name string - samples bool - exemplars bool - histograms bool - floatHistograms bool - remoteWrite11 bool - remoteWrite11Min bool + name string + samples bool + exemplars bool + histograms bool + floatHistograms bool + remoteWrite11 bool }{ {samples: true, exemplars: false, histograms: false, floatHistograms: false, name: "samples only"}, {samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "samples, exemplars, and histograms"}, @@ -81,12 +80,6 @@ func TestSampleDelivery(t *testing.T) { {remoteWrite11: true, samples: false, exemplars: true, histograms: false, name: "interned exemplars only"}, {remoteWrite11: true, samples: false, exemplars: false, histograms: true, name: "interned histograms only"}, {remoteWrite11: true, samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "interned float histograms only"}, - - {remoteWrite11Min: true, samples: true, exemplars: false, histograms: false, name: "interned samples only"}, - {remoteWrite11Min: true, samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "interned samples, exemplars, and histograms"}, - {remoteWrite11Min: true, samples: false, exemplars: true, histograms: false, name: "interned exemplars only"}, - {remoteWrite11Min: true, samples: false, exemplars: false, histograms: true, name: "interned histograms only"}, - {remoteWrite11Min: true, samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "interned float histograms only"}, } // Let's create an even number of send batches so we don't run into the @@ -113,7 +106,7 @@ func TestSampleDelivery(t *testing.T) { for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { dir := t.TempDir() - s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, tc.remoteWrite11, tc.remoteWrite11Min) + s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, tc.remoteWrite11) defer s.Close() var ( @@ -185,7 +178,7 @@ func TestMetadataDelivery(t *testing.T) { mcfg := config.DefaultMetadataConfig metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) m.Start() defer m.Stop() @@ -227,7 +220,7 @@ func TestSampleDeliveryTimeout(t *testing.T) { dir := t.TempDir() metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.StoreSeries(series, 0) m.Start() defer m.Stop() @@ -274,7 +267,7 @@ func TestSampleDeliveryOrder(t *testing.T) { mcfg := config.DefaultMetadataConfig metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.StoreSeries(series, 0) m.Start() @@ -296,7 +289,7 @@ func TestShutdown(t *testing.T) { mcfg := config.DefaultMetadataConfig metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, deadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, deadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) n := 2 * config.DefaultQueueConfig.MaxSamplesPerSend samples, series := createTimeseries(n, n) m.StoreSeries(series, 0) @@ -334,7 +327,7 @@ func TestSeriesReset(t *testing.T) { cfg := config.DefaultQueueConfig mcfg := config.DefaultMetadataConfig metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, deadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, deadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) for i := 0; i < numSegments; i++ { series := []record.RefSeries{} for j := 0; j < numSeries; j++ { @@ -366,7 +359,7 @@ func TestReshard(t *testing.T) { dir := t.TempDir() metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.StoreSeries(series, 0) m.Start() @@ -407,7 +400,7 @@ func TestReshardRaceWithStop(t *testing.T) { go func() { for { metrics := newQueueManagerMetrics(nil, "", "") - m = NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m = NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.Start() h.Unlock() h.Lock() @@ -447,7 +440,7 @@ func TestReshardPartialBatch(t *testing.T) { cfg.BatchSendDeadline = model.Duration(batchSendDeadline) metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, t.TempDir(), newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, flushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m := NewQueueManager(metrics, nil, nil, nil, t.TempDir(), newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, flushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.StoreSeries(series, 0) m.Start() @@ -497,7 +490,7 @@ func TestQueueFilledDeadlock(t *testing.T) { metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, t.TempDir(), newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, flushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m := NewQueueManager(metrics, nil, nil, nil, t.TempDir(), newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, flushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.StoreSeries(series, 0) m.Start() defer m.Stop() @@ -529,7 +522,7 @@ func TestReleaseNoninternedString(t *testing.T) { mcfg := config.DefaultMetadataConfig metrics := newQueueManagerMetrics(nil, "", "") c := NewTestWriteClient(remoteWrite11) - m := NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11, false) + m := NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, remoteWrite11) m.Start() defer m.Stop() @@ -578,7 +571,7 @@ func TestShouldReshard(t *testing.T) { for _, c := range cases { metrics := newQueueManagerMetrics(nil, "", "") client := NewTestWriteClient(false) - m := NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, client, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, "", newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, client, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) m.numShards = c.startingShards m.dataIn.incr(c.samplesIn) m.dataOut.incr(c.samplesOut) @@ -839,10 +832,10 @@ func (c *TestWriteClient) Store(_ context.Context, req []byte, _ int) error { var reqProto *prompb.WriteRequest if c.expectRemoteWrite11 { - var reqReduced prompb.WriteRequestWithRefs + var reqReduced prompb.MinimizedWriteRequest err = proto.Unmarshal(reqBuf, &reqReduced) if err == nil { - reqProto, err = ReducedWriteRequestToWriteRequest(&reqReduced) + reqProto, err = MinimizedWriteRequestToWriteRequest(&reqReduced) } } else { reqProto = &prompb.WriteRequest{} @@ -972,7 +965,7 @@ func BenchmarkSampleSend(b *testing.B) { dir := b.TempDir() metrics := newQueueManagerMetrics(nil, "", "") - m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, newEWMARate(ewmaWeight, shardUpdateDuration), cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) m.StoreSeries(series, 0) // These should be received by the client. @@ -1018,7 +1011,7 @@ func BenchmarkStartup(b *testing.B) { c := NewTestBlockedWriteClient() m := NewQueueManager(metrics, nil, nil, logger, dir, newEWMARate(ewmaWeight, shardUpdateDuration), - cfg, mcfg, labels.EmptyLabels(), nil, c, 1*time.Minute, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + cfg, mcfg, labels.EmptyLabels(), nil, c, 1*time.Minute, newPool(), newHighestTimestampMetric(), nil, false, false, false) m.watcher.SetStartTime(timestamp.Time(math.MaxInt64)) m.watcher.MaxSegment = segments[len(segments)-2] err := m.watcher.Run() @@ -1101,7 +1094,7 @@ func TestCalculateDesiredShards(t *testing.T) { metrics := newQueueManagerMetrics(nil, "", "") samplesIn := newEWMARate(ewmaWeight, shardUpdateDuration) - m := NewQueueManager(metrics, nil, nil, nil, dir, samplesIn, cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, samplesIn, cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) // Need to start the queue manager so the proper metrics are initialized. // However we can stop it right away since we don't need to do any actual @@ -1178,7 +1171,7 @@ func TestCalculateDesiredShardsDetail(t *testing.T) { metrics := newQueueManagerMetrics(nil, "", "") samplesIn := newEWMARate(ewmaWeight, shardUpdateDuration) - m := NewQueueManager(metrics, nil, nil, nil, dir, samplesIn, cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false, false) + m := NewQueueManager(metrics, nil, nil, nil, dir, samplesIn, cfg, mcfg, labels.EmptyLabels(), nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false, false, false) for _, tc := range []struct { name string @@ -1497,54 +1490,6 @@ func BenchmarkBuildWriteRequest(b *testing.B) { }) } -func BenchmarkBuildReducedWriteRequest(b *testing.B) { - bench := func(b *testing.B, batch []timeSeries) { - pool := newLookupPool() - pBuf := proto.NewBuffer(nil) - buff := make([]byte, 0) - seriesBuff := make([]prompb.ReducedTimeSeries, len(batch)) - for i := range seriesBuff { - seriesBuff[i].Samples = []prompb.Sample{{}} - seriesBuff[i].Exemplars = []prompb.ExemplarRef{{}} - } - - // Warmup buffers - for i := 0; i < 10; i++ { - populateReducedTimeSeries(pool, batch, seriesBuff, true, true) - buildReducedWriteRequest(seriesBuff, pool.getTable(), pBuf, &buff) - } - - b.ResetTimer() - totalSize := 0 - for i := 0; i < b.N; i++ { - populateReducedTimeSeries(pool, batch, seriesBuff, true, true) - req, _, err := buildReducedWriteRequest(seriesBuff, pool.getTable(), pBuf, &buff) - if err != nil { - b.Fatal(err) - } - pool.clear() - totalSize += len(req) - b.ReportMetric(float64(totalSize)/float64(b.N), "compressedSize/op") - } - } - - two_batch := createDummyTimeSeries(2) - ten_batch := createDummyTimeSeries(10) - hundred_batch := createDummyTimeSeries(100) - - b.Run("2 instances", func(b *testing.B) { - bench(b, two_batch) - }) - - b.Run("10 instances", func(b *testing.B) { - bench(b, ten_batch) - }) - - b.Run("1k instances", func(b *testing.B) { - bench(b, hundred_batch) - }) -} - func BenchmarkBuildMinimizedWriteRequest(b *testing.B) { type testcase struct { batch []timeSeries diff --git a/storage/remote/read_test.go b/storage/remote/read_test.go index 200b047cc..75321bd9c 100644 --- a/storage/remote/read_test.go +++ b/storage/remote/read_test.go @@ -91,7 +91,7 @@ func TestNoDuplicateReadConfigs(t *testing.T) { for _, tc := range cases { t.Run("", func(t *testing.T) { - s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.DefaultGlobalConfig, RemoteReadConfigs: tc.cfgs, diff --git a/storage/remote/storage.go b/storage/remote/storage.go index b1b51e249..b5dc607db 100644 --- a/storage/remote/storage.go +++ b/storage/remote/storage.go @@ -62,7 +62,7 @@ type Storage struct { } // NewStorage returns a remote.Storage. -func NewStorage(l log.Logger, reg prometheus.Registerer, stCallback startTimeCallback, walDir string, flushDeadline time.Duration, sm ReadyScrapeManager, remoteWrite11 bool, remoteWrite11Minimized bool) *Storage { +func NewStorage(l log.Logger, reg prometheus.Registerer, stCallback startTimeCallback, walDir string, flushDeadline time.Duration, sm ReadyScrapeManager, remoteWrite11 bool) *Storage { if l == nil { l = log.NewNopLogger() } @@ -72,7 +72,7 @@ func NewStorage(l log.Logger, reg prometheus.Registerer, stCallback startTimeCal logger: logger, localStartTimeCallback: stCallback, } - s.rws = NewWriteStorage(s.logger, reg, walDir, flushDeadline, sm, remoteWrite11, remoteWrite11Minimized) + s.rws = NewWriteStorage(s.logger, reg, walDir, flushDeadline, sm, remoteWrite11) return s } diff --git a/storage/remote/storage_test.go b/storage/remote/storage_test.go index 9a395455c..d0f9322c7 100644 --- a/storage/remote/storage_test.go +++ b/storage/remote/storage_test.go @@ -29,7 +29,7 @@ import ( func TestStorageLifecycle(t *testing.T) { dir := t.TempDir() - s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.DefaultGlobalConfig, RemoteWriteConfigs: []*config.RemoteWriteConfig{ @@ -56,7 +56,7 @@ func TestStorageLifecycle(t *testing.T) { func TestUpdateRemoteReadConfigs(t *testing.T) { dir := t.TempDir() - s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.GlobalConfig{}, @@ -77,7 +77,7 @@ func TestUpdateRemoteReadConfigs(t *testing.T) { func TestFilterExternalLabels(t *testing.T) { dir := t.TempDir() - s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.GlobalConfig{ @@ -102,7 +102,7 @@ func TestFilterExternalLabels(t *testing.T) { func TestIgnoreExternalLabels(t *testing.T) { dir := t.TempDir() - s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewStorage(nil, nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.GlobalConfig{ diff --git a/storage/remote/write.go b/storage/remote/write.go index 196cbc59f..d6ac9d23c 100644 --- a/storage/remote/write.go +++ b/storage/remote/write.go @@ -60,42 +60,40 @@ type WriteStorage struct { reg prometheus.Registerer mtx sync.Mutex - watcherMetrics *wlog.WatcherMetrics - liveReaderMetrics *wlog.LiveReaderMetrics - externalLabels labels.Labels - dir string - queues map[string]*QueueManager - remoteWrite11 bool - remoteWrite11Minimized bool - samplesIn *ewmaRate - flushDeadline time.Duration - interner *pool - scraper ReadyScrapeManager - quit chan struct{} + watcherMetrics *wlog.WatcherMetrics + liveReaderMetrics *wlog.LiveReaderMetrics + externalLabels labels.Labels + dir string + queues map[string]*QueueManager + remoteWrite11 bool + samplesIn *ewmaRate + flushDeadline time.Duration + interner *pool + scraper ReadyScrapeManager + quit chan struct{} // For timestampTracker. highestTimestamp *maxTimestamp } // NewWriteStorage creates and runs a WriteStorage. -func NewWriteStorage(logger log.Logger, reg prometheus.Registerer, dir string, flushDeadline time.Duration, sm ReadyScrapeManager, remoteWrite11 bool, remoteWrite11Minimized bool) *WriteStorage { +func NewWriteStorage(logger log.Logger, reg prometheus.Registerer, dir string, flushDeadline time.Duration, sm ReadyScrapeManager, remoteWrite11 bool) *WriteStorage { if logger == nil { logger = log.NewNopLogger() } rws := &WriteStorage{ - queues: make(map[string]*QueueManager), - remoteWrite11: remoteWrite11, - remoteWrite11Minimized: remoteWrite11Minimized, - watcherMetrics: wlog.NewWatcherMetrics(reg), - liveReaderMetrics: wlog.NewLiveReaderMetrics(reg), - logger: logger, - reg: reg, - flushDeadline: flushDeadline, - samplesIn: newEWMARate(ewmaWeight, shardUpdateDuration), - dir: dir, - interner: newPool(), - scraper: sm, - quit: make(chan struct{}), + queues: make(map[string]*QueueManager), + remoteWrite11: remoteWrite11, + watcherMetrics: wlog.NewWatcherMetrics(reg), + liveReaderMetrics: wlog.NewLiveReaderMetrics(reg), + logger: logger, + reg: reg, + flushDeadline: flushDeadline, + samplesIn: newEWMARate(ewmaWeight, shardUpdateDuration), + dir: dir, + interner: newPool(), + scraper: sm, + quit: make(chan struct{}), highestTimestamp: &maxTimestamp{ Gauge: prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: namespace, @@ -213,7 +211,6 @@ func (rws *WriteStorage) ApplyConfig(conf *config.Config) error { rwConf.SendExemplars, rwConf.SendNativeHistograms, rws.remoteWrite11, - rws.remoteWrite11Minimized, ) // Keep track of which queues are new so we know which to start. newHashes = append(newHashes, hash) diff --git a/storage/remote/write_handler.go b/storage/remote/write_handler.go index ce7048803..40afc73fa 100644 --- a/storage/remote/write_handler.go +++ b/storage/remote/write_handler.go @@ -47,18 +47,15 @@ type writeHandler struct { // Experimental feature, new remote write proto format // The handler will accept the new format, but it can still accept the old one enableRemoteWrite11 bool - - enableRemoteWrite11Minimized bool } // NewWriteHandler creates a http.Handler that accepts remote write requests and // writes them to the provided appendable. -func NewWriteHandler(logger log.Logger, reg prometheus.Registerer, appendable storage.Appendable, enableRemoteWrite11 bool, enableRemoteWrite11Minimized bool) http.Handler { +func NewWriteHandler(logger log.Logger, reg prometheus.Registerer, appendable storage.Appendable, enableRemoteWrite11 bool) http.Handler { h := &writeHandler{ - logger: logger, - appendable: appendable, - enableRemoteWrite11: enableRemoteWrite11, - enableRemoteWrite11Minimized: enableRemoteWrite11Minimized, + logger: logger, + appendable: appendable, + enableRemoteWrite11: enableRemoteWrite11, samplesWithInvalidLabelsTotal: prometheus.NewCounter(prometheus.CounterOpts{ Namespace: "prometheus", @@ -76,13 +73,10 @@ func NewWriteHandler(logger log.Logger, reg prometheus.Registerer, appendable st func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { var err error var req *prompb.WriteRequest - var reqWithRefs *prompb.WriteRequestWithRefs var reqMin *prompb.MinimizedWriteRequest - if h.enableRemoteWrite11Minimized { + if h.enableRemoteWrite11 && r.Header.Get(RemoteWriteVersionHeader) == RemoteWriteVersion11HeaderValue { reqMin, err = DecodeMinimizedWriteRequest(r.Body) - } else if !h.enableRemoteWrite11Minimized && h.enableRemoteWrite11 && r.Header.Get(RemoteWriteVersionHeader) == RemoteWriteVersion11HeaderValue { - reqWithRefs, err = DecodeReducedWriteRequest(r.Body) } else { req, err = DecodeWriteRequest(r.Body) } @@ -93,10 +87,8 @@ func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - if h.enableRemoteWrite11Minimized { + if h.enableRemoteWrite11 && r.Header.Get(RemoteWriteVersionHeader) == RemoteWriteVersion11HeaderValue { err = h.writeMin(r.Context(), reqMin) - } else if h.enableRemoteWrite11 { - err = h.writeReduced(r.Context(), reqWithRefs) } else { err = h.write(r.Context(), req) } @@ -294,50 +286,6 @@ func (h *otlpWriteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } -func (h *writeHandler) writeReduced(ctx context.Context, req *prompb.WriteRequestWithRefs) (err error) { - outOfOrderExemplarErrs := 0 - - app := h.appendable.Appender(ctx) - defer func() { - if err != nil { - _ = app.Rollback() - return - } - err = app.Commit() - }() - - for _, ts := range req.Timeseries { - labels := labelRefProtosToLabels(req.StringSymbolTable, ts.Labels) - // TODO(npazosmendez): ? - // if !labels.IsValid() { - // level.Warn(h.logger).Log("msg", "Invalid metric names or labels", "got", labels.String()) - // samplesWithInvalidLabels++ - // continue - // } - - err := h.appendSamples(app, ts.Samples, labels) - if err != nil { - return err - } - - for _, ep := range ts.Exemplars { - e := exemplarRefProtoToExemplar(req.StringSymbolTable, ep) - h.appendExemplar(app, e, labels, &outOfOrderExemplarErrs) - } - - err = h.appendHistograms(app, ts.Histograms, labels) - if err != nil { - return err - } - } - - if outOfOrderExemplarErrs > 0 { - _ = level.Warn(h.logger).Log("msg", "Error on ingesting out-of-order exemplars", "num_dropped", outOfOrderExemplarErrs) - } - - return nil -} - func (h *writeHandler) writeMin(ctx context.Context, req *prompb.MinimizedWriteRequest) (err error) { outOfOrderExemplarErrs := 0 diff --git a/storage/remote/write_handler_test.go b/storage/remote/write_handler_test.go index 10bc56b01..752c68640 100644 --- a/storage/remote/write_handler_test.go +++ b/storage/remote/write_handler_test.go @@ -45,7 +45,7 @@ func TestRemoteWriteHandler(t *testing.T) { require.NoError(t, err) appendable := &mockAppendable{} - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false) recorder := httptest.NewRecorder() handler.ServeHTTP(recorder, req) @@ -83,55 +83,6 @@ func TestRemoteWriteHandler(t *testing.T) { } } -func TestRemoteWriteHandlerReducedFormat(t *testing.T) { - buf, _, err := buildReducedWriteRequest(writeRequestWithRefsFixture.Timeseries, writeRequestWithRefsFixture.StringSymbolTable, nil, nil) - require.NoError(t, err) - - req, err := http.NewRequest("", "", bytes.NewReader(buf)) - req.Header.Set(RemoteWriteVersionHeader, RemoteWriteVersion11HeaderValue) - require.NoError(t, err) - - appendable := &mockAppendable{} - handler := NewWriteHandler(nil, nil, appendable, true, false) - - recorder := httptest.NewRecorder() - handler.ServeHTTP(recorder, req) - - resp := recorder.Result() - require.Equal(t, http.StatusNoContent, resp.StatusCode) - - i := 0 - j := 0 - k := 0 - // the reduced write request is equivalent to the write request fixture. - // we can use it for - for _, ts := range writeRequestFixture.Timeseries { - labels := labelProtosToLabels(ts.Labels) - for _, s := range ts.Samples { - require.Equal(t, mockSample{labels, s.Timestamp, s.Value}, appendable.samples[i]) - i++ - } - - for _, e := range ts.Exemplars { - exemplarLabels := labelProtosToLabels(e.Labels) - require.Equal(t, mockExemplar{labels, exemplarLabels, e.Timestamp, e.Value}, appendable.exemplars[j]) - j++ - } - - for _, hp := range ts.Histograms { - if hp.IsFloatHistogram() { - fh := FloatHistogramProtoToFloatHistogram(hp) - require.Equal(t, mockHistogram{labels, hp.Timestamp, nil, fh}, appendable.histograms[k]) - } else { - h := HistogramProtoToHistogram(hp) - require.Equal(t, mockHistogram{labels, hp.Timestamp, h, nil}, appendable.histograms[k]) - } - - k++ - } - } -} - func TestRemoteWriteHandlerMinimizedFormat(t *testing.T) { buf, _, err := buildMinimizedWriteRequest(writeRequestMinimizedFixture.Timeseries, writeRequestMinimizedFixture.Symbols, nil, nil) require.NoError(t, err) @@ -141,7 +92,7 @@ func TestRemoteWriteHandlerMinimizedFormat(t *testing.T) { require.NoError(t, err) appendable := &mockAppendable{} - handler := NewWriteHandler(nil, nil, appendable, false, true) + handler := NewWriteHandler(nil, nil, appendable, true) recorder := httptest.NewRecorder() handler.ServeHTTP(recorder, req) @@ -194,7 +145,7 @@ func TestOutOfOrderSample(t *testing.T) { appendable := &mockAppendable{ latestSample: 100, } - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false) recorder := httptest.NewRecorder() handler.ServeHTTP(recorder, req) @@ -219,7 +170,7 @@ func TestOutOfOrderExemplar(t *testing.T) { appendable := &mockAppendable{ latestExemplar: 100, } - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false) recorder := httptest.NewRecorder() handler.ServeHTTP(recorder, req) @@ -243,7 +194,7 @@ func TestOutOfOrderHistogram(t *testing.T) { latestHistogram: 100, } - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false) recorder := httptest.NewRecorder() handler.ServeHTTP(recorder, req) @@ -271,7 +222,7 @@ func BenchmarkRemoteWritehandler(b *testing.B) { } appendable := &mockAppendable{} - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false) recorder := httptest.NewRecorder() b.ResetTimer() @@ -280,36 +231,36 @@ func BenchmarkRemoteWritehandler(b *testing.B) { } } -// TODO(npazosmendez): add benchmarks with realistic scenarios -func BenchmarkReducedRemoteWriteHandler(b *testing.B) { - const labelValue = "abcdefg'hijlmn234!@#$%^&*()_+~`\"{}[],./<>?hello0123hiOlá你好Dzieńdobry9Zd8ra765v4stvuyte" - reqs := []*http.Request{} - for i := 0; i < b.N; i++ { - pool := newLookupPool() - num := strings.Repeat(strconv.Itoa(i), 16) - buf, _, err := buildReducedWriteRequest([]prompb.ReducedTimeSeries{{ - Labels: []prompb.LabelRef{ - {NameRef: pool.intern("__name__"), ValueRef: pool.intern("test_metric")}, - {NameRef: pool.intern("test_label_name_" + num), ValueRef: pool.intern(labelValue + num)}, - }, - Histograms: []prompb.Histogram{HistogramToHistogramProto(0, &testHistogram)}, - }}, pool.getTable(), nil, nil) - require.NoError(b, err) - req, err := http.NewRequest("", "", bytes.NewReader(buf)) - require.NoError(b, err) - req.Header.Set(RemoteWriteVersionHeader, RemoteWriteVersion11HeaderValue) - reqs = append(reqs, req) - } +// TODO(npazosmendez): adapt to minimized version +// func BenchmarkReducedRemoteWriteHandler(b *testing.B) { +// const labelValue = "abcdefg'hijlmn234!@#$%^&*()_+~`\"{}[],./<>?hello0123hiOlá你好Dzieńdobry9Zd8ra765v4stvuyte" +// reqs := []*http.Request{} +// for i := 0; i < b.N; i++ { +// pool := newLookupPool() +// num := strings.Repeat(strconv.Itoa(i), 16) +// buf, _, err := buildReducedWriteRequest([]prompb.ReducedTimeSeries{{ +// Labels: []prompb.LabelRef{ +// {NameRef: pool.intern("__name__"), ValueRef: pool.intern("test_metric")}, +// {NameRef: pool.intern("test_label_name_" + num), ValueRef: pool.intern(labelValue + num)}, +// }, +// Histograms: []prompb.Histogram{HistogramToHistogramProto(0, &testHistogram)}, +// }}, pool.getTable(), nil, nil) +// require.NoError(b, err) +// req, err := http.NewRequest("", "", bytes.NewReader(buf)) +// require.NoError(b, err) +// req.Header.Set(RemoteWriteVersionHeader, RemoteWriteVersion11HeaderValue) +// reqs = append(reqs, req) +// } - appendable := &mockAppendable{} - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, true, false) - recorder := httptest.NewRecorder() +// appendable := &mockAppendable{} +// handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, true, false) +// recorder := httptest.NewRecorder() - b.ResetTimer() - for _, req := range reqs { - handler.ServeHTTP(recorder, req) - } -} +// b.ResetTimer() +// for _, req := range reqs { +// handler.ServeHTTP(recorder, req) +// } +// } func TestCommitErr(t *testing.T) { buf, _, err := buildWriteRequest(writeRequestFixture.Timeseries, nil, nil, nil) @@ -321,7 +272,7 @@ func TestCommitErr(t *testing.T) { appendable := &mockAppendable{ commitErr: fmt.Errorf("commit error"), } - handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, appendable, false) recorder := httptest.NewRecorder() handler.ServeHTTP(recorder, req) @@ -347,7 +298,7 @@ func BenchmarkRemoteWriteOOOSamples(b *testing.B) { require.NoError(b, db.Close()) }) - handler := NewWriteHandler(log.NewNopLogger(), nil, db.Head(), false, false) + handler := NewWriteHandler(log.NewNopLogger(), nil, db.Head(), false) buf, _, err := buildWriteRequest(genSeriesWithSample(1000, 200*time.Minute.Milliseconds()), nil, nil, nil) require.NoError(b, err) diff --git a/storage/remote/write_test.go b/storage/remote/write_test.go index 19470001f..14ff466a9 100644 --- a/storage/remote/write_test.go +++ b/storage/remote/write_test.go @@ -117,7 +117,7 @@ func TestNoDuplicateWriteConfigs(t *testing.T) { } for _, tc := range cases { - s := NewWriteStorage(nil, nil, dir, time.Millisecond, nil, false, false) + s := NewWriteStorage(nil, nil, dir, time.Millisecond, nil, false) conf := &config.Config{ GlobalConfig: config.DefaultGlobalConfig, RemoteWriteConfigs: tc.cfgs, @@ -139,7 +139,7 @@ func TestRestartOnNameChange(t *testing.T) { hash, err := toHash(cfg) require.NoError(t, err) - s := NewWriteStorage(nil, nil, dir, time.Millisecond, nil, false, false) + s := NewWriteStorage(nil, nil, dir, time.Millisecond, nil, false) conf := &config.Config{ GlobalConfig: config.DefaultGlobalConfig, @@ -164,7 +164,7 @@ func TestRestartOnNameChange(t *testing.T) { func TestUpdateWithRegisterer(t *testing.T) { dir := t.TempDir() - s := NewWriteStorage(nil, prometheus.NewRegistry(), dir, time.Millisecond, nil, false, false) + s := NewWriteStorage(nil, prometheus.NewRegistry(), dir, time.Millisecond, nil, false) c1 := &config.RemoteWriteConfig{ Name: "named", URL: &common_config.URL{ @@ -204,7 +204,7 @@ func TestUpdateWithRegisterer(t *testing.T) { func TestWriteStorageLifecycle(t *testing.T) { dir := t.TempDir() - s := NewWriteStorage(nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewWriteStorage(nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.DefaultGlobalConfig, RemoteWriteConfigs: []*config.RemoteWriteConfig{ @@ -221,7 +221,7 @@ func TestWriteStorageLifecycle(t *testing.T) { func TestUpdateExternalLabels(t *testing.T) { dir := t.TempDir() - s := NewWriteStorage(nil, prometheus.NewRegistry(), dir, time.Second, nil, false, false) + s := NewWriteStorage(nil, prometheus.NewRegistry(), dir, time.Second, nil, false) externalLabels := labels.FromStrings("external", "true") conf := &config.Config{ @@ -250,7 +250,7 @@ func TestUpdateExternalLabels(t *testing.T) { func TestWriteStorageApplyConfigsIdempotent(t *testing.T) { dir := t.TempDir() - s := NewWriteStorage(nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewWriteStorage(nil, nil, dir, defaultFlushDeadline, nil, false) conf := &config.Config{ GlobalConfig: config.GlobalConfig{}, @@ -276,7 +276,7 @@ func TestWriteStorageApplyConfigsIdempotent(t *testing.T) { func TestWriteStorageApplyConfigsPartialUpdate(t *testing.T) { dir := t.TempDir() - s := NewWriteStorage(nil, nil, dir, defaultFlushDeadline, nil, false, false) + s := NewWriteStorage(nil, nil, dir, defaultFlushDeadline, nil, false) c0 := &config.RemoteWriteConfig{ RemoteTimeout: model.Duration(10 * time.Second), diff --git a/web/api/v1/api.go b/web/api/v1/api.go index b18061263..9e3873aef 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -255,7 +255,6 @@ func NewAPI( rwEnabled bool, otlpEnabled bool, enableRemoteWrite11 bool, - enableRemoteWrite11Min bool, ) *API { a := &API{ QueryEngine: qe, @@ -297,7 +296,7 @@ func NewAPI( } if rwEnabled { - a.remoteWriteHandler = remote.NewWriteHandler(logger, registerer, ap, enableRemoteWrite11, enableRemoteWrite11Min) + a.remoteWriteHandler = remote.NewWriteHandler(logger, registerer, ap, enableRemoteWrite11) } if otlpEnabled { a.otlpWriteHandler = remote.NewOTLPWriteHandler(logger, ap) diff --git a/web/web.go b/web/web.go index 2317c9d0d..0e067f2db 100644 --- a/web/web.go +++ b/web/web.go @@ -241,28 +241,27 @@ type Options struct { Version *PrometheusVersion Flags map[string]string - ListenAddress string - CORSOrigin *regexp.Regexp - ReadTimeout time.Duration - MaxConnections int - ExternalURL *url.URL - RoutePrefix string - UseLocalAssets bool - UserAssetsPath string - ConsoleTemplatesPath string - ConsoleLibrariesPath string - EnableLifecycle bool - EnableAdminAPI bool - PageTitle string - RemoteReadSampleLimit int - RemoteReadConcurrencyLimit int - RemoteReadBytesInFrame int - EnableRemoteWriteReceiver bool - EnableOTLPWriteReceiver bool - IsAgent bool - AppName string - EnableReceiverRemoteWrite11 bool - EnableReceiverRemoteWrite11Min bool + ListenAddress string + CORSOrigin *regexp.Regexp + ReadTimeout time.Duration + MaxConnections int + ExternalURL *url.URL + RoutePrefix string + UseLocalAssets bool + UserAssetsPath string + ConsoleTemplatesPath string + ConsoleLibrariesPath string + EnableLifecycle bool + EnableAdminAPI bool + PageTitle string + RemoteReadSampleLimit int + RemoteReadConcurrencyLimit int + RemoteReadBytesInFrame int + EnableRemoteWriteReceiver bool + EnableOTLPWriteReceiver bool + IsAgent bool + AppName string + EnableReceiverRemoteWrite11 bool Gatherer prometheus.Gatherer Registerer prometheus.Registerer @@ -354,7 +353,6 @@ func New(logger log.Logger, o *Options) *Handler { o.EnableRemoteWriteReceiver, o.EnableOTLPWriteReceiver, o.EnableReceiverRemoteWrite11, - o.EnableReceiverRemoteWrite11Min, ) if o.RoutePrefix != "/" {