Add bytes slice (instead of slice of 32bit vars) format for testing

Co-authored-by: Nicolás Pazos <npazosmendez@gmail.com>
Signed-off-by: Callum Styan <callumstyan@gmail.com>
Signed-off-by: Nicolás Pazos <npazosmendez@gmail.com>
This commit is contained in:
Callum Styan 2023-11-13 21:53:44 -08:00 committed by Nicolás Pazos
parent fbb81cbacc
commit 8b0cda8bb3
9 changed files with 1072 additions and 201 deletions

View file

@ -60,7 +60,7 @@ func (x ReadRequest_ResponseType) String() string {
}
func (ReadRequest_ResponseType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_eefc82927d57d89b, []int{5, 0}
return fileDescriptor_eefc82927d57d89b, []int{6, 0}
}
type WriteRequest struct {
@ -232,6 +232,63 @@ func (m *MinimizedWriteRequest) GetSymbols() string {
return ""
}
type MinimizedWriteRequestBytes struct {
Timeseries []MinimizedTimeSeriesBytes `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
// to know the offset:length range of the actual symbol to read from this string.
Symbols string `protobuf:"bytes,4,opt,name=symbols,proto3" json:"symbols,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MinimizedWriteRequestBytes) Reset() { *m = MinimizedWriteRequestBytes{} }
func (m *MinimizedWriteRequestBytes) String() string { return proto.CompactTextString(m) }
func (*MinimizedWriteRequestBytes) ProtoMessage() {}
func (*MinimizedWriteRequestBytes) Descriptor() ([]byte, []int) {
return fileDescriptor_eefc82927d57d89b, []int{3}
}
func (m *MinimizedWriteRequestBytes) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MinimizedWriteRequestBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MinimizedWriteRequestBytes.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 *MinimizedWriteRequestBytes) XXX_Merge(src proto.Message) {
xxx_messageInfo_MinimizedWriteRequestBytes.Merge(m, src)
}
func (m *MinimizedWriteRequestBytes) XXX_Size() int {
return m.Size()
}
func (m *MinimizedWriteRequestBytes) XXX_DiscardUnknown() {
xxx_messageInfo_MinimizedWriteRequestBytes.DiscardUnknown(m)
}
var xxx_messageInfo_MinimizedWriteRequestBytes proto.InternalMessageInfo
func (m *MinimizedWriteRequestBytes) GetTimeseries() []MinimizedTimeSeriesBytes {
if m != nil {
return m.Timeseries
}
return nil
}
func (m *MinimizedWriteRequestBytes) GetSymbols() string {
if m != nil {
return m.Symbols
}
return ""
}
type MinimizedWriteRequestFixed32 struct {
Timeseries []MinimizedTimeSeriesFixed32 `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
@ -246,7 +303,7 @@ func (m *MinimizedWriteRequestFixed32) Reset() { *m = MinimizedWriteRequ
func (m *MinimizedWriteRequestFixed32) String() string { return proto.CompactTextString(m) }
func (*MinimizedWriteRequestFixed32) ProtoMessage() {}
func (*MinimizedWriteRequestFixed32) Descriptor() ([]byte, []int) {
return fileDescriptor_eefc82927d57d89b, []int{3}
return fileDescriptor_eefc82927d57d89b, []int{4}
}
func (m *MinimizedWriteRequestFixed32) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -303,7 +360,7 @@ func (m *MinimizedWriteRequestFixed64) Reset() { *m = MinimizedWriteRequ
func (m *MinimizedWriteRequestFixed64) String() string { return proto.CompactTextString(m) }
func (*MinimizedWriteRequestFixed64) ProtoMessage() {}
func (*MinimizedWriteRequestFixed64) Descriptor() ([]byte, []int) {
return fileDescriptor_eefc82927d57d89b, []int{4}
return fileDescriptor_eefc82927d57d89b, []int{5}
}
func (m *MinimizedWriteRequestFixed64) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -364,7 +421,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{5}
return fileDescriptor_eefc82927d57d89b, []int{6}
}
func (m *ReadRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -420,7 +477,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{6}
return fileDescriptor_eefc82927d57d89b, []int{7}
}
func (m *ReadResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -470,7 +527,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{7}
return fileDescriptor_eefc82927d57d89b, []int{8}
}
func (m *Query) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -539,7 +596,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{8}
return fileDescriptor_eefc82927d57d89b, []int{9}
}
func (m *QueryResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -592,7 +649,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{9}
return fileDescriptor_eefc82927d57d89b, []int{10}
}
func (m *ChunkedReadResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -640,6 +697,7 @@ func init() {
proto.RegisterType((*WriteRequest)(nil), "prometheus.WriteRequest")
proto.RegisterType((*MinimizedWriteRequestPacking)(nil), "prometheus.MinimizedWriteRequestPacking")
proto.RegisterType((*MinimizedWriteRequest)(nil), "prometheus.MinimizedWriteRequest")
proto.RegisterType((*MinimizedWriteRequestBytes)(nil), "prometheus.MinimizedWriteRequestBytes")
proto.RegisterType((*MinimizedWriteRequestFixed32)(nil), "prometheus.MinimizedWriteRequestFixed32")
proto.RegisterType((*MinimizedWriteRequestFixed64)(nil), "prometheus.MinimizedWriteRequestFixed64")
proto.RegisterType((*ReadRequest)(nil), "prometheus.ReadRequest")
@ -652,45 +710,46 @@ func init() {
func init() { proto.RegisterFile("remote.proto", fileDescriptor_eefc82927d57d89b) }
var fileDescriptor_eefc82927d57d89b = []byte{
// 601 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xdf, 0x4e, 0x13, 0x41,
0x14, 0xc6, 0x19, 0x5a, 0x68, 0x3d, 0x8b, 0x64, 0x1d, 0x40, 0x56, 0x62, 0x80, 0x6c, 0x8c, 0x69,
0x82, 0xa9, 0xb1, 0x34, 0x5c, 0x71, 0x21, 0x60, 0x0d, 0x22, 0xab, 0x38, 0xad, 0xd1, 0x18, 0x93,
0xcd, 0x76, 0xf7, 0x84, 0x4e, 0x60, 0xff, 0xb0, 0x33, 0x9b, 0x50, 0xaf, 0x7d, 0x00, 0xe3, 0x23,
0x79, 0xc5, 0x95, 0xf1, 0x09, 0x8c, 0xe1, 0x49, 0xcc, 0xfe, 0x83, 0xa9, 0xd6, 0x68, 0x9a, 0x78,
0xb7, 0x7b, 0xce, 0xf7, 0x7d, 0xfb, 0x9b, 0x33, 0x3b, 0x03, 0x73, 0x31, 0xfa, 0xa1, 0xc4, 0x66,
0x14, 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
0x43, 0xdd, 0x77, 0xa4, 0x3b, 0xc0, 0x58, 0x14, 0xe7, 0xdf, 0x50, 0xa9, 0x0e, 0x9d, 0x3e, 0x9e,
0x5a, 0xb9, 0x80, 0x5d, 0x29, 0xe9, 0x06, 0xcc, 0x0c, 0x78, 0x20, 0xf3, 0xfd, 0xd4, 0x5a, 0x4b,
0xbf, 0x0e, 0x77, 0x3f, 0x6d, 0xb2, 0x5c, 0x63, 0x76, 0x40, 0x53, 0x16, 0x47, 0xb7, 0xfe, 0xfd,
0xbe, 0x52, 0xff, 0x22, 0xf3, 0x1c, 0x16, 0xf6, 0x06, 0x49, 0x70, 0x92, 0x6e, 0x8e, 0x32, 0xd5,
0xc7, 0x30, 0xef, 0xe6, 0x65, 0x7b, 0x24, 0xf2, 0x8e, 0x1a, 0x59, 0x18, 0x8b, 0xd4, 0x9b, 0xae,
0xfa, 0x4a, 0xd7, 0x40, 0x4b, 0x7f, 0xa3, 0xa1, 0xcd, 0x03, 0x0f, 0xcf, 0x8b, 0x39, 0x41, 0x56,
0x7a, 0x96, 0x56, 0x76, 0x17, 0x2f, 0x2e, 0x57, 0xc9, 0xb7, 0xcb, 0x55, 0xf2, 0xe3, 0x72, 0x95,
0xbc, 0x9b, 0x4d, 0x73, 0xa3, 0x7e, 0x7f, 0x36, 0xbb, 0x8f, 0x37, 0x7f, 0x06, 0x00, 0x00, 0xff,
0xff, 0x13, 0xe9, 0xfd, 0x50, 0xce, 0x05, 0x00, 0x00,
// 621 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xdf, 0x4e, 0x13, 0x41,
0x14, 0xc6, 0x19, 0x5a, 0x68, 0x3d, 0x8b, 0xa4, 0x0e, 0x20, 0xb5, 0x31, 0x40, 0x36, 0xc6, 0x34,
0xc1, 0xd4, 0x08, 0x0d, 0x57, 0x5c, 0x08, 0x58, 0x83, 0xc8, 0x2a, 0x4e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3, 0xdc, 0xa0, 0xdf, 0x9f, 0x4d, 0xfe, 0x20, 0x36, 0x7f,
0x05, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x0a, 0xf4, 0xd7, 0x5f, 0x06, 0x00, 0x00,
}
func (m *WriteRequest) Marshal() (dAtA []byte, err error) {
@ -844,6 +903,54 @@ func (m *MinimizedWriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *MinimizedWriteRequestBytes) 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 *MinimizedWriteRequestBytes) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *MinimizedWriteRequestBytes) 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.Symbols) > 0 {
i -= len(m.Symbols)
copy(dAtA[i:], m.Symbols)
i = encodeVarintRemote(dAtA, i, uint64(len(m.Symbols)))
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 *MinimizedWriteRequestFixed32) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -1269,6 +1376,28 @@ func (m *MinimizedWriteRequest) Size() (n int) {
return n
}
func (m *MinimizedWriteRequestBytes) 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))
}
}
l = len(m.Symbols)
if l > 0 {
n += 1 + l + sovRemote(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *MinimizedWriteRequestFixed32) Size() (n int) {
if m == nil {
return 0
@ -1782,6 +1911,123 @@ func (m *MinimizedWriteRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *MinimizedWriteRequestBytes) 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: MinimizedWriteRequestBytes: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: MinimizedWriteRequestBytes: 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, MinimizedTimeSeriesBytes{})
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 Symbols", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRemote
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthRemote
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthRemote
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Symbols = string(dAtA[iNdEx:postIndex])
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 *MinimizedWriteRequestFixed32) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0

View file

@ -51,6 +51,18 @@ message MinimizedWriteRequest {
string symbols = 4;
}
message MinimizedWriteRequestBytes {
repeated MinimizedTimeSeriesBytes 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;
// The symbols table. All symbols are concatenated strings. To read the symbols table, it's required
// to know the offset:length range of the actual symbol to read from this string.
string symbols = 4;
}
message MinimizedWriteRequestFixed32 {
repeated MinimizedTimeSeriesFixed32 timeseries = 1 [(gogoproto.nullable) = false];
// Cortex uses this field to determine the source of the write request.

View file

@ -127,7 +127,7 @@ func (x LabelMatcher_Type) String() string {
}
func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_d938547f84707355, []int{12, 0}
return fileDescriptor_d938547f84707355, []int{13, 0}
}
// We require this to match chunkenc.Encoding.
@ -159,7 +159,7 @@ func (x Chunk_Encoding) String() string {
}
func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_d938547f84707355, []int{14, 0}
return fileDescriptor_d938547f84707355, []int{15, 0}
}
type MetricMetadata struct {
@ -1034,6 +1034,82 @@ func (m *MinimizedTimeSeriesPacking) GetHistograms() []Histogram {
return nil
}
type MinimizedTimeSeriesBytes struct {
// Sorted list of label name-value pair references, encoded as varints. This
// list's real len is always multiple of 4, packing tuples of (label name offset,
// label name length, label value offset, label value length).
LabelSymbols []byte `protobuf:"bytes,1,opt,name=label_symbols,json=labelSymbols,proto3" json:"label_symbols,omitempty"`
// Sorted by time, oldest sample first.
// TODO: support references for other types
Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"`
Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"`
Histograms []Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MinimizedTimeSeriesBytes) Reset() { *m = MinimizedTimeSeriesBytes{} }
func (m *MinimizedTimeSeriesBytes) String() string { return proto.CompactTextString(m) }
func (*MinimizedTimeSeriesBytes) ProtoMessage() {}
func (*MinimizedTimeSeriesBytes) Descriptor() ([]byte, []int) {
return fileDescriptor_d938547f84707355, []int{10}
}
func (m *MinimizedTimeSeriesBytes) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MinimizedTimeSeriesBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MinimizedTimeSeriesBytes.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 *MinimizedTimeSeriesBytes) XXX_Merge(src proto.Message) {
xxx_messageInfo_MinimizedTimeSeriesBytes.Merge(m, src)
}
func (m *MinimizedTimeSeriesBytes) XXX_Size() int {
return m.Size()
}
func (m *MinimizedTimeSeriesBytes) XXX_DiscardUnknown() {
xxx_messageInfo_MinimizedTimeSeriesBytes.DiscardUnknown(m)
}
var xxx_messageInfo_MinimizedTimeSeriesBytes proto.InternalMessageInfo
func (m *MinimizedTimeSeriesBytes) GetLabelSymbols() []byte {
if m != nil {
return m.LabelSymbols
}
return nil
}
func (m *MinimizedTimeSeriesBytes) GetSamples() []Sample {
if m != nil {
return m.Samples
}
return nil
}
func (m *MinimizedTimeSeriesBytes) GetExemplars() []Exemplar {
if m != nil {
return m.Exemplars
}
return nil
}
func (m *MinimizedTimeSeriesBytes) GetHistograms() []Histogram {
if m != nil {
return m.Histograms
}
return nil
}
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"`
@ -1046,7 +1122,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{10}
return fileDescriptor_d938547f84707355, []int{11}
}
func (m *Label) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1100,7 +1176,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{11}
return fileDescriptor_d938547f84707355, []int{12}
}
func (m *Labels) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1150,7 +1226,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{12}
return fileDescriptor_d938547f84707355, []int{13}
}
func (m *LabelMatcher) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1217,7 +1293,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{13}
return fileDescriptor_d938547f84707355, []int{14}
}
func (m *ReadHints) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1311,7 +1387,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{14}
return fileDescriptor_d938547f84707355, []int{15}
}
func (m *Chunk) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1383,7 +1459,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{15}
return fileDescriptor_d938547f84707355, []int{16}
}
func (m *ChunkedSeries) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1441,6 +1517,7 @@ func init() {
proto.RegisterType((*MinimizedTimeSeriesFixed32)(nil), "prometheus.MinimizedTimeSeriesFixed32")
proto.RegisterType((*MinimizedTimeSeriesFixed64)(nil), "prometheus.MinimizedTimeSeriesFixed64")
proto.RegisterType((*MinimizedTimeSeriesPacking)(nil), "prometheus.MinimizedTimeSeriesPacking")
proto.RegisterType((*MinimizedTimeSeriesBytes)(nil), "prometheus.MinimizedTimeSeriesBytes")
proto.RegisterType((*Label)(nil), "prometheus.Label")
proto.RegisterType((*Labels)(nil), "prometheus.Labels")
proto.RegisterType((*LabelMatcher)(nil), "prometheus.LabelMatcher")
@ -1452,81 +1529,82 @@ func init() {
func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) }
var fileDescriptor_d938547f84707355 = []byte{
// 1174 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xcb, 0x6e, 0xdb, 0x46,
0x17, 0x36, 0x49, 0x89, 0x12, 0x8f, 0x2e, 0xa6, 0x27, 0x4e, 0x7e, 0xfe, 0x46, 0xe3, 0xa8, 0x04,
0xd2, 0xaa, 0x45, 0x21, 0x23, 0x4e, 0x50, 0x34, 0x68, 0x50, 0xc0, 0x76, 0xe4, 0x0b, 0x6a, 0x4a,
0xcd, 0x48, 0x46, 0x9b, 0x6e, 0x84, 0x91, 0x34, 0x96, 0x08, 0x8b, 0x97, 0x72, 0x46, 0x81, 0x95,
0xf7, 0xe8, 0xae, 0x2f, 0xd1, 0xb7, 0x08, 0xd0, 0x4d, 0xfb, 0x02, 0x45, 0xe1, 0x55, 0x81, 0xee,
0xfa, 0x04, 0xc5, 0x0c, 0x49, 0x91, 0x8a, 0x5d, 0xa0, 0xe9, 0xae, 0xde, 0xcd, 0xf9, 0xce, 0xed,
0x3b, 0x73, 0x66, 0x38, 0x87, 0x50, 0xe1, 0x8b, 0x90, 0xb2, 0x56, 0x18, 0x05, 0x3c, 0x40, 0x10,
0x46, 0x81, 0x47, 0xf9, 0x94, 0xce, 0xd9, 0xd6, 0xe6, 0x24, 0x98, 0x04, 0x12, 0xde, 0x11, 0xab,
0xd8, 0xc2, 0xfe, 0x41, 0x85, 0xba, 0x43, 0x79, 0xe4, 0x8e, 0x1c, 0xca, 0xc9, 0x98, 0x70, 0x82,
0x9e, 0x42, 0x41, 0xc4, 0xb0, 0x94, 0x86, 0xd2, 0xac, 0xef, 0x3e, 0x6c, 0x65, 0x31, 0x5a, 0xab,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62, 0xb9, 0xb6, 0x9f, 0x43, 0x39,
0xb5, 0xba, 0xf6, 0x12, 0x7f, 0xd3, 0x15, 0xf3, 0xf2, 0xca, 0x90, 0xac, 0xa2, 0x3b, 0xb0, 0x7e,
0x78, 0xda, 0xdd, 0xeb, 0x0f, 0x72, 0x93, 0xb3, 0xfd, 0x1d, 0xd4, 0x64, 0x46, 0x3a, 0xfe, 0xb7,
0xef, 0xe8, 0x0e, 0xe8, 0x23, 0x11, 0x21, 0xbd, 0x79, 0x1b, 0xd7, 0xaa, 0x49, 0x1d, 0x62, 0xb3,
0xfd, 0xcd, 0x37, 0x57, 0xdb, 0xca, 0xcf, 0x57, 0xdb, 0xca, 0x6f, 0x57, 0xdb, 0xca, 0xb7, 0xba,
0xb0, 0x0e, 0x87, 0x43, 0x5d, 0xfe, 0xaf, 0x3c, 0xfe, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x59,
0x21, 0x0f, 0xe0, 0x0c, 0x00, 0x00,
// 1193 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xdd, 0x8e, 0xdb, 0x44,
0x14, 0xde, 0xb1, 0x13, 0x27, 0x3e, 0x9b, 0xa4, 0xde, 0xe9, 0xb6, 0x98, 0x15, 0xdd, 0x2e, 0x46,
0x85, 0x80, 0x50, 0xaa, 0x6e, 0x2b, 0x44, 0x45, 0x85, 0xb4, 0xbb, 0xcd, 0x76, 0x2b, 0xea, 0x84,
0x4e, 0xb2, 0x82, 0x72, 0x13, 0x4d, 0x92, 0xd9, 0xc4, 0x6a, 0xfc, 0x83, 0x67, 0x52, 0x6d, 0xfa,
0x1e, 0xdc, 0xf1, 0x12, 0xbc, 0x45, 0x25, 0x6e, 0xe0, 0x05, 0x10, 0xea, 0x15, 0x82, 0x3b, 0x9e,
0x00, 0xcd, 0xd8, 0x8e, 0x9d, 0x6e, 0x90, 0x28, 0x77, 0x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tA []byte, err error) {
@ -2321,6 +2399,82 @@ func (m *MinimizedTimeSeriesPacking) MarshalToSizedBuffer(dAtA []byte) (int, err
return len(dAtA) - i, nil
}
func (m *MinimizedTimeSeriesBytes) 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 *MinimizedTimeSeriesBytes) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *MinimizedTimeSeriesBytes) 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.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.LabelSymbols) > 0 {
i -= len(m.LabelSymbols)
copy(dAtA[i:], m.LabelSymbols)
i = encodeVarintTypes(dAtA, i, uint64(len(m.LabelSymbols)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Label) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -2997,6 +3151,40 @@ func (m *MinimizedTimeSeriesPacking) Size() (n int) {
return n
}
func (m *MinimizedTimeSeriesBytes) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.LabelSymbols)
if l > 0 {
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))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Label) Size() (n int) {
if m == nil {
return 0
@ -5160,6 +5348,193 @@ func (m *MinimizedTimeSeriesPacking) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *MinimizedTimeSeriesBytes) 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: MinimizedTimeSeriesBytes: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: MinimizedTimeSeriesBytes: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field LabelSymbols", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTypes
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTypes
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTypes
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.LabelSymbols = append(m.LabelSymbols[:0], dAtA[iNdEx:postIndex]...)
if m.LabelSymbols == nil {
m.LabelSymbols = []byte{}
}
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, Exemplar{})
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
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

View file

@ -181,6 +181,20 @@ message MinimizedTimeSeriesPacking {
repeated Histogram histograms = 4 [(gogoproto.nullable) = false];
}
message MinimizedTimeSeriesBytes {
// Sorted list of label name-value pair references, encoded as varints. This
// list's real len is always multiple of 4, packing tuples of (label name offset,
// label name length, label value offset, label value length).
bytes label_symbols = 1;
// Sorted by time, oldest sample first.
// TODO: support references for other types
repeated Sample samples = 2 [(gogoproto.nullable) = false];
repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false];
repeated Histogram histograms = 4 [(gogoproto.nullable) = false];
// TODO: add metadata
}
message Label {
string name = 1;
string value = 2;

View file

@ -7,10 +7,11 @@ trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
declare -a INSTANCES
# (sender,receiver) pairs to run: (sender_name; sender_flags; receiver_name; receiver_flags)
INSTANCES+=('sender-v1;;receiver-v1;')
INSTANCES+=('sender-v11;--remote-write-format 1;receiver-v11;--remote-write-format 1')
INSTANCES+=('sender-v11-min32-optimized-varint;--remote-write-format 2;receiver-v11-min32-optimized-varint;--remote-write-format 2')
INSTANCES+=('sender-v11-min64-fixed;--remote-write-format 3;receiver-v11-min64-fixed;--remote-write-format 3')
INSTANCES+=('sender-v11-min32-fixed;--remote-write-format 4;receiver-v11-min32-fixed;--remote-write-format 4')
INSTANCES+=('sender-v11-min32-optimized-varint;--remote-write-format 1;receiver-v11-min32-optimized-varint;--remote-write-format 1')
INSTANCES+=('sender-v11-min64-fixed;--remote-write-format 2;receiver-v11-min64-fixed;--remote-write-format 2')
INSTANCES+=('sender-v11-min32-fixed;--remote-write-format 3;receiver-v11-min32-fixed;--remote-write-format 3')
INSTANCES+=('sender-v11-min-bytes;--remote-write-format 4;receiver-v11-min-bytes;--remote-write-format 4')
# ~~~~~~~~~~~~~
# append two ports to all instances

View file

@ -15,6 +15,7 @@ package remote
import (
"compress/gzip"
"encoding/binary"
"errors"
"fmt"
"io"
@ -812,6 +813,19 @@ func labelsToUint32Packed(lbls labels.Labels, symbolTable *rwSymbolTable, buf []
return result
}
func labelsToByteSlice(lbls labels.Labels, symbolTable *rwSymbolTable, buf []byte) []byte {
result := buf[:0]
lbls.Range(func(l labels.Label) {
off, leng := symbolTable.Ref(l.Name)
result = binary.AppendUvarint(result, uint64(off))
result = binary.AppendUvarint(result, uint64(leng))
off, leng = symbolTable.Ref(l.Value)
result = binary.AppendUvarint(result, uint64(off))
result = binary.AppendUvarint(result, uint64(leng))
})
return result
}
func Uint32RefToLabels(symbols string, minLabels []uint32) labels.Labels {
ls := labels.NewScratchBuilder(len(minLabels) / 2)
@ -835,6 +849,45 @@ func Uint32RefToLabels(symbols string, minLabels []uint32) labels.Labels {
return ls.Labels()
}
func ByteSliceToLabels(symbols string, minLabels []byte) labels.Labels {
ls := labels.NewScratchBuilder(len(minLabels) / 2)
for len(minLabels) > 0 {
// todo, check for overflow?
offset, n := binary.Uvarint(minLabels)
minLabels = minLabels[n:]
length, n := binary.Uvarint(minLabels)
minLabels = minLabels[n:]
name := symbols[offset : offset+length]
// todo, check for overflow?
offset, n = binary.Uvarint(minLabels)
minLabels = minLabels[n:]
length, n = binary.Uvarint(minLabels)
minLabels = minLabels[n:]
value := symbols[offset : offset+length]
ls.Add(name, value)
}
// labelIdx := 0
// for labelIdx < len(minLabels) {
// // todo, check for overflow?
// offset := minLabels[labelIdx]
// labelIdx++
// length := minLabels[labelIdx]
// labelIdx++
// name := symbols[offset : offset+length]
// // todo, check for overflow?
// offset = minLabels[labelIdx]
// labelIdx++
// length = minLabels[labelIdx]
// labelIdx++
// value := symbols[offset : offset+length]
// ls.Add(name, value)
// }
return ls.Labels()
}
func Uint64RefToLabels(symbols string, minLabels []uint64) labels.Labels {
ls := labels.NewScratchBuilder(len(minLabels) / 2)
labelIdx := 0
@ -996,6 +1049,25 @@ func DecodeMinimizedWriteRequestFixed32(r io.Reader) (*prompb.MinimizedWriteRequ
return &req, nil
}
func DecodeMinimizedWriteRequestBytes(r io.Reader) (*prompb.MinimizedWriteRequestBytes, 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.MinimizedWriteRequestBytes
if err := proto.Unmarshal(reqBuf, &req); err != nil {
return nil, err
}
return &req, nil
}
func MinimizedWriteRequestToWriteRequest(redReq *prompb.MinimizedWriteRequest) (*prompb.WriteRequest, error) {
req := &prompb.WriteRequest{
Timeseries: make([]prompb.TimeSeries, len(redReq.Timeseries)),
@ -1041,18 +1113,13 @@ func min64WriteRequestToWriteRequest(redReq *prompb.MinimizedWriteRequestFixed64
})
})
exemplars := make([]prompb.Exemplar, len(rts.Exemplars))
// TODO handle 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 := 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 = e.Labels
}
req.Timeseries[i].Samples = rts.Samples
req.Timeseries[i].Exemplars = exemplars

View file

@ -395,7 +395,8 @@ const (
Base1 RemoteWriteFormat = iota // original map based format
Min32Optimized // two 32bit varint plus marshalling optimization
Min64Fixed // a single fixed64 bit value, first 32 are offset and 2nd 32 are
Min32Fixed // two 32bit fixed, similar to optimized but not varints + no manual marshalling optimization
Min32Fixed
MinBytes // two 32bit fixed, similar to optimized but not varints + no manual marshalling optimization
)
// QueueManager manages a queue of samples to be sent to the Storage
@ -1396,6 +1397,11 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) {
pendingMin32Data[i].Samples = []prompb.Sample{{}}
}
pendingMinBytesData := make([]prompb.MinimizedTimeSeriesBytes, max)
for i := range pendingMinBytesData {
pendingMinBytesData[i].Samples = []prompb.Sample{{}}
}
timer := time.NewTimer(time.Duration(s.qm.cfg.BatchSendDeadline))
stop := func() {
if !timer.Stop() {
@ -1450,6 +1456,11 @@ func (s *shards) runShard(ctx context.Context, shardID int, queue *queue) {
n := nPendingSamples + nPendingExemplars + nPendingHistograms
s.sendMin32Samples(ctx, pendingMin32Data[:n], symbolTable.LabelsString(), nPendingSamples, nPendingExemplars, nPendingHistograms, pBuf, &buf)
symbolTable.clear()
case MinBytes:
nPendingSamples, nPendingExemplars, nPendingHistograms := populateMinimizedTimeSeriesBytes(&symbolTable, batch, pendingMinBytesData, s.qm.sendExemplars, s.qm.sendNativeHistograms)
n := nPendingSamples + nPendingExemplars + nPendingHistograms
s.sendMin32Samples(ctx, pendingMin32Data[:n], symbolTable.LabelsString(), nPendingSamples, nPendingExemplars, nPendingHistograms, pBuf, &buf)
symbolTable.clear()
}
queue.ReturnForReuse(batch)
@ -1577,6 +1588,18 @@ func (s *shards) sendMin32Samples(ctx context.Context, samples []prompb.Minimize
s.updateMetrics(ctx, err, sampleCount, exemplarCount, histogramCount, time.Since(begin))
}
func (s *shards) sendMinBytes(ctx context.Context, samples []prompb.MinimizedTimeSeriesBytes, labels 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 := buildMinimizedWriteRequestBytes(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) updateMetrics(ctx context.Context, err error, sampleCount, exemplarCount, histogramCount int, duration time.Duration) {
if err != nil {
level.Error(s.qm.logger).Log("msg", "non-recoverable error", "count", sampleCount, "exemplarCount", exemplarCount, "err", err)
@ -1726,20 +1749,14 @@ func populateMinimizedTimeSeriesFixed64(symbolTable *rwSymbolTable, batch []time
})
nPendingSamples++
// TODO: handle all types
//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 tExemplar:
// TODO intern exemplars and histograms for the new formats
pendingData[nPending].Exemplars = append(pendingData[nPending].Exemplars, prompb.Exemplar{
Labels: labelsToLabelsProto(d.exemplarLabels, nil),
Value: d.value,
Timestamp: d.timestamp,
})
nPendingExemplars++
case tHistogram:
pendingData[nPending].Histograms = append(pendingData[nPending].Histograms, HistogramToHistogramProto(d.timestamp, d.histogram))
nPendingHistograms++
@ -1801,6 +1818,55 @@ func populateMinimizedTimeSeriesFixed32(symbolTable *rwSymbolTable, batch []time
return nPendingSamples, nPendingExemplars, nPendingHistograms
}
func populateMinimizedTimeSeriesBytes(symbolTable *rwSymbolTable, batch []timeSeries, pendingData []prompb.MinimizedTimeSeriesBytes, 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].LabelSymbols = labelsToByteSlice(d.seriesLabels, symbolTable, pendingData[nPending].LabelSymbols)
switch d.sType {
case tSample:
pendingData[nPending].Samples = append(pendingData[nPending].Samples, prompb.Sample{
Value: d.value,
Timestamp: d.timestamp,
})
nPendingSamples++
// TODO: handle all types
//case tExemplar:
// 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 populateMinimizedTimeSeriesPacking(symbolTable *rwSymbolTable, batch []timeSeries, pendingData []prompb.MinimizedTimeSeriesPacking, sendExemplars, sendNativeHistograms bool) (int, int, int) {
var nPendingSamples, nPendingExemplars, nPendingHistograms int
for nPending, d := range batch {
@ -2163,6 +2229,52 @@ func buildMinimizedWriteRequestFixed32(samples []prompb.MinimizedTimeSeriesFixed
return compressed, highest, nil
}
func buildMinimizedWriteRequestBytes(samples []prompb.MinimizedTimeSeriesBytes, labels 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.MinimizedWriteRequestBytes{
Symbols: 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
}
func buildMinimizedWriteRequestPacking(samples []prompb.MinimizedTimeSeriesPacking, labels string, pBuf *proto.Buffer, buf *[]byte) ([]byte, int64, error) {
var highest int64
for _, ts := range samples {

View file

@ -69,23 +69,23 @@ func TestSampleDelivery(t *testing.T) {
floatHistograms bool
rwFormat RemoteWriteFormat
}{
//{samples: true, exemplars: false, histograms: false, floatHistograms: false, name: "samples only"},
//{samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "samples, exemplars, and histograms"},
//{samples: false, exemplars: true, histograms: false, floatHistograms: false, name: "exemplars only"},
//{samples: false, exemplars: false, histograms: true, floatHistograms: false, name: "histograms only"},
//{samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "float histograms only"},
{samples: true, exemplars: false, histograms: false, floatHistograms: false, name: "samples only"},
{samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "samples, exemplars, and histograms"},
{samples: false, exemplars: true, histograms: false, floatHistograms: false, name: "exemplars only"},
{samples: false, exemplars: false, histograms: true, floatHistograms: false, name: "histograms only"},
{samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "float histograms only"},
{rwFormat: Min32Optimized, samples: true, exemplars: false, histograms: false, name: "interned samples only"},
//{rwFormat: Min32Optimized, samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "interned samples, exemplars, and histograms"},
//{rwFormat: Min32Optimized, samples: false, exemplars: true, histograms: false, name: "interned exemplars only"},
//{rwFormat: Min32Optimized, samples: false, exemplars: false, histograms: true, name: "interned histograms only"},
//{rwFormat: Min32Optimized, samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "interned float histograms only"},
{rwFormat: Min32Optimized, samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "interned samples, exemplars, and histograms"},
{rwFormat: Min32Optimized, samples: false, exemplars: true, histograms: false, name: "interned exemplars only"},
{rwFormat: Min32Optimized, samples: false, exemplars: false, histograms: true, name: "interned histograms only"},
{rwFormat: Min32Optimized, samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "interned float histograms only"},
//{rwFormat: Min64Fixed, samples: true, exemplars: false, histograms: false, name: "interned samples only"},
//{rwFormat: Min64Fixed, samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "interned samples, exemplars, and histograms"},
//{rwFormat: Min64Fixed, samples: false, exemplars: true, histograms: false, name: "interned exemplars only"},
//{rwFormat: Min64Fixed, samples: false, exemplars: false, histograms: true, name: "interned histograms only"},
//{rwFormat: Min64Fixed, samples: false, exemplars: false, histograms: false, floatHistograms: true, name: "interned float histograms only"},
{rwFormat: Min64Fixed, samples: true, exemplars: false, histograms: false, name: "interned samples only"},
{rwFormat: Min64Fixed, samples: true, exemplars: true, histograms: true, floatHistograms: true, name: "interned samples, exemplars, and histograms"},
{rwFormat: Min64Fixed, samples: false, exemplars: true, histograms: false, name: "interned exemplars only"},
{rwFormat: Min64Fixed, samples: false, exemplars: false, histograms: true, name: "interned histograms only"},
{rwFormat: Min64Fixed, 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
@ -118,24 +118,24 @@ func TestSampleDelivery(t *testing.T) {
var (
series []record.RefSeries
samples []record.RefSample
//exemplars []record.RefExemplar
//histograms []record.RefHistogramSample
//floatHistograms []record.RefFloatHistogramSample
exemplars []record.RefExemplar
histograms []record.RefHistogramSample
floatHistograms []record.RefFloatHistogramSample
)
// Generates same series in both cases.
if tc.samples {
samples, series = createTimeseries(n, n)
}
//if tc.exemplars {
// exemplars, series = createExemplars(n, n)
//}
//if tc.histograms {
// histograms, _, series = createHistograms(n, n, false)
//}
//if tc.floatHistograms {
// _, floatHistograms, series = createHistograms(n, n, true)
//}
if tc.exemplars {
exemplars, series = createExemplars(n, n)
}
if tc.histograms {
histograms, _, series = createHistograms(n, n, false)
}
if tc.floatHistograms {
_, floatHistograms, series = createHistograms(n, n, true)
}
// Apply new config.
queueConfig.Capacity = len(samples)
@ -152,24 +152,24 @@ func TestSampleDelivery(t *testing.T) {
// Send first half of data.
c.expectSamples(samples[:len(samples)/2], series)
//c.expectExemplars(exemplars[:len(exemplars)/2], series)
//c.expectHistograms(histograms[:len(histograms)/2], series)
//c.expectFloatHistograms(floatHistograms[:len(floatHistograms)/2], series)
c.expectExemplars(exemplars[:len(exemplars)/2], series)
c.expectHistograms(histograms[:len(histograms)/2], series)
c.expectFloatHistograms(floatHistograms[:len(floatHistograms)/2], series)
qm.Append(samples[:len(samples)/2])
//qm.AppendExemplars(exemplars[:len(exemplars)/2])
//qm.AppendHistograms(histograms[:len(histograms)/2])
//qm.AppendFloatHistograms(floatHistograms[:len(floatHistograms)/2])
qm.AppendExemplars(exemplars[:len(exemplars)/2])
qm.AppendHistograms(histograms[:len(histograms)/2])
qm.AppendFloatHistograms(floatHistograms[:len(floatHistograms)/2])
c.waitForExpectedData(t)
// Send second half of data.
c.expectSamples(samples[len(samples)/2:], series)
//c.expectExemplars(exemplars[len(exemplars)/2:], series)
//c.expectHistograms(histograms[len(histograms)/2:], series)
//c.expectFloatHistograms(floatHistograms[len(floatHistograms)/2:], series)
c.expectExemplars(exemplars[len(exemplars)/2:], series)
c.expectHistograms(histograms[len(histograms)/2:], series)
c.expectFloatHistograms(floatHistograms[len(floatHistograms)/2:], series)
qm.Append(samples[len(samples)/2:])
//qm.AppendExemplars(exemplars[len(exemplars)/2:])
//qm.AppendHistograms(histograms[len(histograms)/2:])
//qm.AppendFloatHistograms(floatHistograms[len(floatHistograms)/2:])
qm.AppendExemplars(exemplars[len(exemplars)/2:])
qm.AppendHistograms(histograms[len(histograms)/2:])
qm.AppendFloatHistograms(floatHistograms[len(floatHistograms)/2:])
c.waitForExpectedData(t)
})
}

View file

@ -76,6 +76,7 @@ func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
var reqMin *prompb.MinimizedWriteRequest
var reqMin64Fixed *prompb.MinimizedWriteRequestFixed64
var reqMin32Fixed *prompb.MinimizedWriteRequestFixed32
var reqMinBytes *prompb.MinimizedWriteRequestBytes
// TODO: this should eventually be done via content negotiation/looking at the header
switch h.rwFormat {
@ -87,6 +88,8 @@ func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
reqMin64Fixed, err = DecodeMinimizedWriteRequestFixed64(r.Body)
case Min32Fixed:
reqMin32Fixed, err = DecodeMinimizedWriteRequestFixed32(r.Body)
case MinBytes:
reqMinBytes, err = DecodeMinimizedWriteRequestBytes(r.Body)
}
if err != nil {
@ -105,6 +108,8 @@ func (h *writeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
err = h.writeMin64(r.Context(), reqMin64Fixed)
case Min32Fixed:
err = h.writeMin32(r.Context(), reqMin32Fixed)
case MinBytes:
err = h.writeMinBytes(r.Context(), reqMinBytes)
}
switch {
@ -415,3 +420,42 @@ func (h *writeHandler) writeMin32(ctx context.Context, req *prompb.MinimizedWrit
return nil
}
func (h *writeHandler) writeMinBytes(ctx context.Context, req *prompb.MinimizedWriteRequestBytes) (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 {
ls := ByteSliceToLabels(req.Symbols, ts.LabelSymbols)
err := h.appendSamples(app, ts.Samples, ls)
if err != nil {
return err
}
for _, ep := range ts.Exemplars {
e := exemplarProtoToExemplar(ep)
//e := exemplarRefProtoToExemplar(req.StringSymbolTable, ep)
h.appendExemplar(app, e, ls, &outOfOrderExemplarErrs)
}
err = h.appendHistograms(app, ts.Histograms, ls)
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
}