From fa9d8bfd2eb544db9e55dcf21d527efd3a8f32fd Mon Sep 17 00:00:00 2001 From: alanprot Date: Thu, 5 Dec 2024 17:23:38 -0800 Subject: [PATCH] Creating symbols table on the query stream response --- pkg/distributor/query.go | 1 + pkg/ingester/client/custom.go | 46 ++++ pkg/ingester/client/custom_test.go | 26 ++ pkg/ingester/client/ingester.pb.go | 409 ++++++++++++++++++++++------- pkg/ingester/client/ingester.proto | 4 + pkg/ingester/ingester.go | 12 +- 6 files changed, 406 insertions(+), 92 deletions(-) diff --git a/pkg/distributor/query.go b/pkg/distributor/query.go index c81e9f3e77..1df610f04c 100644 --- a/pkg/distributor/query.go +++ b/pkg/distributor/query.go @@ -283,6 +283,7 @@ func (d *Distributor) queryIngesterStream(ctx context.Context, replicationSet ri return nil, validation.LimitError(dataBytesLimitErr.Error()) } + result.DesymbolizeLabels() result.Chunkseries = append(result.Chunkseries, resp.Chunkseries...) } return result, nil diff --git a/pkg/ingester/client/custom.go b/pkg/ingester/client/custom.go index 62c0f43930..f97e6ecb69 100644 --- a/pkg/ingester/client/custom.go +++ b/pkg/ingester/client/custom.go @@ -3,7 +3,11 @@ package client import ( "encoding/binary" + writev2 "github.com/prometheus/prometheus/prompb/io/prometheus/write/v2" + "github.com/cortexproject/cortex/pkg/chunk/encoding" + "github.com/cortexproject/cortex/pkg/cortexpb" + "github.com/prometheus/prometheus/model/labels" ) // ChunksCount returns the number of chunks in response. @@ -45,3 +49,45 @@ func (m *QueryStreamResponse) SamplesCount() (count int) { } return } + +func (m *QueryStreamResponse) DesymbolizeLabels() { + if len(m.Symbols) == 0 { + return + } + + b := labels.NewScratchBuilder(0) + + for i, cs := range m.Chunkseries { + if len(cs.LabelsRefs) > 0 { + m.Chunkseries[i].Labels = cortexpb.FromLabelsToLabelAdapters(desymbolizeLabels(&b, cs.LabelsRefs, m.Symbols)) + } + cs.LabelsRefs = cs.LabelsRefs[:0] + b.Reset() + } + m.Symbols = m.Symbols[:0] +} + +func (m *QueryStreamResponse) SymbolizeLabels() { + if len(m.Symbols) > 0 { + return + } + + st := writev2.NewSymbolTable() + for i, _ := range m.Chunkseries { + if len(m.Chunkseries[i].Labels) > 0 { + m.Chunkseries[i].LabelsRefs = st.SymbolizeLabels(cortexpb.FromLabelAdaptersToLabels(m.Chunkseries[i].Labels), m.Chunkseries[i].LabelsRefs) + } + m.Chunkseries[i].Labels = m.Chunkseries[i].Labels[:0] + } + m.Symbols = st.Symbols() +} + +// desymbolizeLabels decodes label references, with given symbols to labels. +func desymbolizeLabels(b *labels.ScratchBuilder, labelRefs []uint32, symbols []string) labels.Labels { + b.Reset() + for i := 0; i < len(labelRefs); i += 2 { + b.Add(symbols[labelRefs[i]], symbols[labelRefs[i+1]]) + } + b.Sort() + return b.Labels() +} diff --git a/pkg/ingester/client/custom_test.go b/pkg/ingester/client/custom_test.go index 7213494ec2..acb49082ce 100644 --- a/pkg/ingester/client/custom_test.go +++ b/pkg/ingester/client/custom_test.go @@ -1,6 +1,7 @@ package client import ( + github_com_cortexproject_cortex_pkg_cortexpb "github.com/cortexproject/cortex/pkg/cortexpb" "testing" "time" @@ -11,6 +12,31 @@ import ( "github.com/cortexproject/cortex/pkg/util" ) +func TestSYmbolizeLabels(t *testing.T) { + chunkSeries := []TimeSeriesChunk{ + { + Labels: []github_com_cortexproject_cortex_pkg_cortexpb.LabelAdapter{ + {"N1", "V1"}, + {"N1", "V2"}, + {"N3", "V3"}, + }, + Chunks: []Chunk{{Encoding: int32(encoding.PrometheusXorChunk), Data: []byte("data1")}}, + }, + { + Labels: []github_com_cortexproject_cortex_pkg_cortexpb.LabelAdapter{ + {"V1", "N3"}, + {"N2", "V3"}, + {"Final", "Final2"}, + }, + Chunks: []Chunk{{Encoding: int32(encoding.PrometheusXorChunk), Data: []byte("data1")}}, + }, + } + + r := QueryStreamResponse{Chunkseries: chunkSeries} + r.SymbolizeLabels() + r.DesymbolizeLabels() +} + func TestSamplesCount(t *testing.T) { floatChk := util.GenerateChunk(t, time.Second, model.Time(0), 100, encoding.PrometheusXorChunk) histogramChk := util.GenerateChunk(t, time.Second, model.Time(0), 300, encoding.PrometheusHistogramChunk) diff --git a/pkg/ingester/client/ingester.pb.go b/pkg/ingester/client/ingester.pb.go index 374348afae..06ab0e5dea 100644 --- a/pkg/ingester/client/ingester.pb.go +++ b/pkg/ingester/client/ingester.pb.go @@ -196,6 +196,7 @@ type QueryRequest struct { StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` Matchers []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers,omitempty"` + Symbolized bool `protobuf:"varint,4,opt,name=Symbolized,proto3" json:"Symbolized,omitempty"` } func (m *QueryRequest) Reset() { *m = QueryRequest{} } @@ -251,6 +252,13 @@ func (m *QueryRequest) GetMatchers() []*LabelMatcher { return nil } +func (m *QueryRequest) GetSymbolized() bool { + if m != nil { + return m.Symbolized + } + return false +} + type ExemplarQueryRequest struct { StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` @@ -313,6 +321,7 @@ func (m *ExemplarQueryRequest) GetMatchers() []*LabelMatchers { // QueryStreamResponse contains a batch of timeseries chunks or timeseries. Only one of these series will be populated. type QueryStreamResponse struct { Chunkseries []TimeSeriesChunk `protobuf:"bytes,1,rep,name=chunkseries,proto3" json:"chunkseries"` + Symbols []string `protobuf:"bytes,3,rep,name=symbols,proto3" json:"symbols,omitempty"` } func (m *QueryStreamResponse) Reset() { *m = QueryStreamResponse{} } @@ -354,6 +363,13 @@ func (m *QueryStreamResponse) GetChunkseries() []TimeSeriesChunk { return nil } +func (m *QueryStreamResponse) GetSymbols() []string { + if m != nil { + return m.Symbols + } + return nil +} + type ExemplarQueryResponse struct { Timeseries []cortexpb.TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries"` } @@ -1159,6 +1175,7 @@ type TimeSeriesChunk struct { UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Labels []github_com_cortexproject_cortex_pkg_cortexpb.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3,customtype=github.com/cortexproject/cortex/pkg/cortexpb.LabelAdapter" json:"labels"` Chunks []Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` + LabelsRefs []uint32 `protobuf:"varint,5,rep,packed,name=labels_refs,json=labelsRefs,proto3" json:"labels_refs,omitempty"` } func (m *TimeSeriesChunk) Reset() { *m = TimeSeriesChunk{} } @@ -1214,6 +1231,13 @@ func (m *TimeSeriesChunk) GetChunks() []Chunk { return nil } +func (m *TimeSeriesChunk) GetLabelsRefs() []uint32 { + if m != nil { + return m.LabelsRefs + } + return nil +} + type Chunk struct { StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` @@ -1484,91 +1508,94 @@ func init() { func init() { proto.RegisterFile("ingester.proto", fileDescriptor_60f6df4f3586b478) } var fileDescriptor_60f6df4f3586b478 = []byte{ - // 1339 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0x14, 0xc7, - 0x13, 0xdf, 0xf1, 0x3e, 0xec, 0xad, 0x7d, 0xb0, 0x6e, 0x1b, 0xbc, 0x0c, 0x7f, 0xc6, 0x30, 0x88, - 0x7f, 0xac, 0x24, 0xd8, 0xe0, 0x24, 0x12, 0xe4, 0x85, 0x6c, 0x30, 0x60, 0xc0, 0x18, 0xc6, 0x86, - 0x44, 0x51, 0xa2, 0xd1, 0x78, 0xb7, 0xb1, 0x27, 0xcc, 0x63, 0x99, 0xee, 0x41, 0x90, 0x53, 0xa2, - 0x7c, 0x80, 0xe4, 0x98, 0x6b, 0x6e, 0xf9, 0x00, 0xf9, 0x10, 0x1c, 0x39, 0xe4, 0x80, 0x72, 0x40, - 0x61, 0x91, 0xa2, 0x1c, 0xc9, 0x37, 0x88, 0xa6, 0x1f, 0xf3, 0xf2, 0xf8, 0x41, 0x04, 0xb9, 0xed, - 0x54, 0xfd, 0xaa, 0xba, 0xea, 0xd7, 0x55, 0x5d, 0xb5, 0xd0, 0xb6, 0xbd, 0x4d, 0x4c, 0x28, 0x0e, - 0x66, 0x07, 0x81, 0x4f, 0x7d, 0x54, 0xeb, 0xf9, 0x01, 0xc5, 0x0f, 0xd5, 0xc9, 0x4d, 0x7f, 0xd3, - 0x67, 0xa2, 0xb9, 0xe8, 0x17, 0xd7, 0xaa, 0xe7, 0x36, 0x6d, 0xba, 0x15, 0x6e, 0xcc, 0xf6, 0x7c, - 0x77, 0x8e, 0x03, 0x07, 0x81, 0xff, 0x35, 0xee, 0x51, 0xf1, 0x35, 0x37, 0xb8, 0xb7, 0x29, 0x15, - 0x1b, 0xe2, 0x07, 0x37, 0xd5, 0x3f, 0x81, 0x86, 0x81, 0xad, 0xbe, 0x81, 0xef, 0x87, 0x98, 0x50, - 0x34, 0x0b, 0xa3, 0xf7, 0x43, 0x1c, 0xd8, 0x98, 0x74, 0x95, 0x63, 0xe5, 0x99, 0xc6, 0xfc, 0xe4, - 0xac, 0x80, 0xdf, 0x0a, 0x71, 0xf0, 0x48, 0xc0, 0x0c, 0x09, 0xd2, 0xcf, 0x43, 0x93, 0x9b, 0x93, - 0x81, 0xef, 0x11, 0x8c, 0xe6, 0x60, 0x34, 0xc0, 0x24, 0x74, 0xa8, 0xb4, 0x3f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0xa8, 0xf5, 0x1c, 0x1b, 0x7b, 0x74, 0xa3, 0xc6, 0xfe, 0xfa, 0xbf, 0xf7, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x84, 0xf7, 0x8d, 0x61, 0x65, 0x10, 0x00, 0x00, + // 1387 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0x13, 0xd7, + 0x17, 0xf7, 0xc4, 0x8f, 0xd8, 0xc7, 0x0f, 0x9c, 0x9b, 0x40, 0xcc, 0xf0, 0x67, 0x02, 0x83, 0xf8, + 0x37, 0x6a, 0x4b, 0x02, 0x69, 0x2b, 0x41, 0x5f, 0x28, 0x81, 0x00, 0x01, 0x42, 0x60, 0x1c, 0x68, + 0x55, 0xa9, 0x1a, 0x8d, 0xed, 0x9b, 0x64, 0xca, 0x3c, 0xcc, 0xdc, 0x6b, 0x44, 0x58, 0xb5, 0xea, + 0x07, 0x68, 0xd5, 0x6f, 0xd0, 0x5d, 0x3f, 0x40, 0x17, 0xfd, 0x08, 0x2c, 0x59, 0x74, 0x81, 0xba, + 0x40, 0xc5, 0x48, 0x55, 0x97, 0x7c, 0x84, 0x6a, 0xee, 0x63, 0x5e, 0x71, 0x1e, 0x54, 0xd0, 0xdd, + 0xdc, 0x73, 0x7e, 0xe7, 0xdc, 0xf3, 0xbc, 0xe7, 0xd8, 0xd0, 0xb0, 0xbd, 0x4d, 0x4c, 0x28, 0x0e, + 0xe6, 0xfa, 0x81, 0x4f, 0x7d, 0x54, 0xea, 0xfa, 0x01, 0xc5, 0x8f, 0xd4, 0xa9, 0x4d, 0x7f, 0xd3, + 0x67, 0xa4, 0xf9, 0xf0, 0x8b, 0x73, 0xd5, 0x0b, 0x9b, 0x36, 0xdd, 0x1a, 0x74, 0xe6, 0xba, 0xbe, + 0x3b, 0xcf, 0x81, 0xfd, 0xc0, 0xff, 0x06, 0x77,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, + 0x85, 0x13, 0xca, 0x6c, 0xd9, 0x48, 0x50, 0xf4, 0x9f, 0x15, 0x98, 0x5a, 0x7e, 0x84, 0xdd, 0xbe, + 0x63, 0x05, 0xff, 0x89, 0x0b, 0xe7, 0x76, 0xb8, 0x70, 0x78, 0x94, 0x0b, 0x24, 0xf6, 0x41, 0x7f, + 0x08, 0x93, 0xcc, 0xb4, 0x36, 0x0d, 0xb0, 0xe5, 0x46, 0x19, 0xbb, 0x08, 0xd5, 0xee, 0xd6, 0xc0, + 0xbb, 0x9f, 0x4a, 0xd9, 0xb4, 0x54, 0x16, 0x27, 0xec, 0x52, 0x08, 0x12, 0x59, 0x4b, 0x4a, 0xa0, + 0x16, 0x8c, 0x13, 0x16, 0x09, 0x6e, 0x49, 0xc5, 0x90, 0xc7, 0xeb, 0x85, 0xf2, 0x58, 0x33, 0xaf, + 0xb7, 0xe1, 0x70, 0x26, 0x34, 0x6f, 0xa0, 0x56, 0x7e, 0x57, 0x00, 0x31, 0x47, 0xef, 0x59, 0xce, + 0x00, 0x13, 0x19, 0xee, 0xe3, 0x00, 0x4e, 0x48, 0x35, 0x3d, 0xcb, 0xc5, 0x2c, 0xcc, 0x15, 0xa3, + 0xc2, 0x28, 0xb7, 0x2c, 0x17, 0xef, 0x92, 0x8d, 0xb1, 0xd7, 0xc8, 0x46, 0x7e, 0xdf, 0x6c, 0x84, + 0xc5, 0xb1, 0x7f, 0x36, 0xd0, 0x14, 0x14, 0x1d, 0xdb, 0xb5, 0x69, 0xab, 0xc8, 0x34, 0xf2, 0x83, + 0x7e, 0x1e, 0x26, 0x53, 0x5e, 0x89, 0x48, 0x9d, 0x84, 0x1a, 0x77, 0xeb, 0x21, 0xa3, 0xb3, 0x58, + 0x55, 0x8c, 0xaa, 0x13, 0x43, 0xf5, 0xcf, 0xe1, 0x68, 0x42, 0x32, 0x93, 0xe3, 0x03, 0xc8, 0xff, + 0xaa, 0xc0, 0xc4, 0x4d, 0x19, 0x28, 0xf2, 0xb6,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 0xcf, + 0xa2, 0x16, 0x73, 0xb8, 0xba, 0x70, 0x54, 0xa6, 0x7a, 0x47, 0x18, 0x0d, 0x06, 0xd3, 0xaf, 0x02, + 0x0a, 0x59, 0x24, 0xad, 0xfd, 0x1c, 0x14, 0x49, 0x48, 0x10, 0xef, 0xc7, 0xb1, 0xa4, 0x96, 0x8c, + 0x25, 0x06, 0x47, 0xea, 0x4f, 0x14, 0xd0, 0x56, 0x31, 0x0d, 0xec, 0x2e, 0xb9, 0xe2, 0x07, 0xe9, + 0xca, 0x7a, 0xcb, 0x75, 0x7f, 0x1e, 0x6a, 0xb2, 0x74, 0x4d, 0x82, 0xe9, 0xde, 0x4f, 0x77, 0x55, + 0x42, 0xdb, 0x98, 0xc6, 0x1d, 0x53, 0x48, 0xbe, 0x17, 0x37, 0x60, 0x66, 0x57, 0x4f, 0x44, 0x80, + 0x66, 0xa1, 0xe4, 0x32, 0x88, 0x88, 0x50, 0x33, 0x7e, 0x61, 0xb9, 0xa8, 0x21, 0xf8, 0xfa, 0x1d, + 0x38, 0xbd, 0x8b, 0xb2, 0x4c, 0x87, 0x1c, 0x5c, 0x65, 0x0b, 0x8e, 0x08, 0x95, 0xab, 0x98, 0x5a, + 0x61, 0x1a, 0x65, 0xc3, 0xac, 0xc1, 0xf4, 0x0e, 0x8e, 0x50, 0xff, 0x21, 0x94, 0x5d, 0x41, 0x13, + 0x17, 0xb4, 0xb2, 0x17, 0x44, 0x32, 0x11, 0x52, 0xff, 0x69, 0x0c, 0x0e, 0x65, 0xa6, 0x55, 0x98, + 0x98, 0x8d, 0xc0, 0x77, 0x4d, 0xb9, 0x8e, 0xc5, 0x35, 0xd8, 0x08, 0xe9, 0x2b, 0x82, 0xbc, 0xd2, + 0x4b, 0x16, 0xe9, 0x58, 0xaa, 0x48, 0x3d, 0x28, 0xb1, 0xd6, 0x97, 0x63, 0x76, 0x32, 0x36, 0x85, + 0x85, 0xe8, 0xb6, 0x65, 0x07, 0x4b, 0x8b, 0xe1,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 0xc7, 0x39, 0x88, 0x1a, 0x35, 0xc9, 0x21, 0x59, 0x3d, 0x4e, 0x34, 0x16, 0xb2, + 0x33, 0x08, 0xfd, 0x3f, 0x6a, 0xec, 0x3d, 0x67, 0xb7, 0xfa, 0xce, 0xbe, 0xb8, 0xe8, 0xb6, 0xc7, + 0x70, 0x7c, 0xcf, 0x89, 0x77, 0xe0, 0x3b, 0xcf, 0xec, 0x83, 0x1b, 0x11, 0xf5, 0x75, 0x38, 0x94, + 0x19, 0x80, 0x48, 0xcb, 0x68, 0xc9, 0xcc, 0x4c, 0x75, 0x66, 0x57, 0xbe, 0xd4, 0xbb, 0xf4, 0xe9, + 0xd3, 0x17, 0x5a, 0xee, 0xd9, 0x0b, 0x2d, 0xf7, 0xea, 0x85, 0xa6, 0x7c, 0x3b, 0xd4, 0x94, 0x5f, + 0x86, 0x9a, 0xf2, 0x64, 0xa8, 0x29, 0x4f, 0x87, 0x9a, 0xf2, 0xe7, 0x50, 0x53, 0xfe, 0x1e, 0x6a, + 0xb9, 0x57, 0x43, 0x4d, 0xf9, 0xf1, 0xa5, 0x96, 0x7b, 0xfa, 0x52, 0xcb, 0x3d, 0x7b, 0xa9, 0xe5, + 0xbe, 0x2a, 0x75, 0x1d, 0x1b, 0x7b, 0xb4, 0x53, 0x62, 0xff, 0x2a, 0x7c, 0xf0, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xa5, 0x67, 0x40, 0xcf, 0xc0, 0x10, 0x00, 0x00, } func (x MatchType) String() string { @@ -1698,6 +1725,9 @@ func (this *QueryRequest) Equal(that interface{}) bool { return false } } + if this.Symbolized != that1.Symbolized { + return false + } return true } func (this *ExemplarQueryRequest) Equal(that interface{}) bool { @@ -1762,6 +1792,14 @@ func (this *QueryStreamResponse) Equal(that interface{}) bool { return false } } + if len(this.Symbols) != len(that1.Symbols) { + return false + } + for i := range this.Symbols { + if this.Symbols[i] != that1.Symbols[i] { + return false + } + } return true } func (this *ExemplarQueryResponse) Equal(that interface{}) bool { @@ -2281,6 +2319,14 @@ func (this *TimeSeriesChunk) Equal(that interface{}) bool { return false } } + if len(this.LabelsRefs) != len(that1.LabelsRefs) { + return false + } + for i := range this.LabelsRefs { + if this.LabelsRefs[i] != that1.LabelsRefs[i] { + return false + } + } return true } func (this *Chunk) Equal(that interface{}) bool { @@ -2452,13 +2498,14 @@ func (this *QueryRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 7) + s := make([]string, 0, 8) s = append(s, "&client.QueryRequest{") s = append(s, "StartTimestampMs: "+fmt.Sprintf("%#v", this.StartTimestampMs)+",\n") s = append(s, "EndTimestampMs: "+fmt.Sprintf("%#v", this.EndTimestampMs)+",\n") if this.Matchers != nil { s = append(s, "Matchers: "+fmt.Sprintf("%#v", this.Matchers)+",\n") } + s = append(s, "Symbolized: "+fmt.Sprintf("%#v", this.Symbolized)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -2480,7 +2527,7 @@ func (this *QueryStreamResponse) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 5) + s := make([]string, 0, 6) s = append(s, "&client.QueryStreamResponse{") if this.Chunkseries != nil { vs := make([]*TimeSeriesChunk, len(this.Chunkseries)) @@ -2489,6 +2536,7 @@ func (this *QueryStreamResponse) GoString() string { } s = append(s, "Chunkseries: "+fmt.Sprintf("%#v", vs)+",\n") } + s = append(s, "Symbols: "+fmt.Sprintf("%#v", this.Symbols)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -2692,7 +2740,7 @@ func (this *TimeSeriesChunk) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) + s := make([]string, 0, 9) s = append(s, "&client.TimeSeriesChunk{") s = append(s, "FromIngesterId: "+fmt.Sprintf("%#v", this.FromIngesterId)+",\n") s = append(s, "UserId: "+fmt.Sprintf("%#v", this.UserId)+",\n") @@ -2704,6 +2752,7 @@ func (this *TimeSeriesChunk) GoString() string { } s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") } + s = append(s, "LabelsRefs: "+fmt.Sprintf("%#v", this.LabelsRefs)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -3482,6 +3531,16 @@ func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Symbolized { + i-- + if m.Symbolized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if len(m.Matchers) > 0 { for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { { @@ -3576,6 +3635,15 @@ func (m *QueryStreamResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Symbols) > 0 { + for iNdEx := len(m.Symbols) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Symbols[iNdEx]) + copy(dAtA[i:], m.Symbols[iNdEx]) + i = encodeVarintIngester(dAtA, i, uint64(len(m.Symbols[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.Chunkseries) > 0 { for iNdEx := len(m.Chunkseries) - 1; iNdEx >= 0; iNdEx-- { { @@ -4229,6 +4297,24 @@ func (m *TimeSeriesChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.LabelsRefs) > 0 { + dAtA5 := make([]byte, len(m.LabelsRefs)*10) + var j4 int + for _, num := range m.LabelsRefs { + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintIngester(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0x2a + } if len(m.Chunks) > 0 { for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { { @@ -4523,6 +4609,9 @@ func (m *QueryRequest) Size() (n int) { n += 1 + l + sovIngester(uint64(l)) } } + if m.Symbolized { + n += 2 + } return n } @@ -4559,6 +4648,12 @@ func (m *QueryStreamResponse) Size() (n int) { n += 1 + l + sovIngester(uint64(l)) } } + if len(m.Symbols) > 0 { + for _, s := range m.Symbols { + l = len(s) + n += 1 + l + sovIngester(uint64(l)) + } + } return n } @@ -4857,6 +4952,13 @@ func (m *TimeSeriesChunk) Size() (n int) { n += 1 + l + sovIngester(uint64(l)) } } + if len(m.LabelsRefs) > 0 { + l = 0 + for _, e := range m.LabelsRefs { + l += sovIngester(uint64(e)) + } + n += 1 + sovIngester(uint64(l)) + l + } return n } @@ -5006,6 +5108,7 @@ func (this *QueryRequest) String() string { `StartTimestampMs:` + fmt.Sprintf("%v", this.StartTimestampMs) + `,`, `EndTimestampMs:` + fmt.Sprintf("%v", this.EndTimestampMs) + `,`, `Matchers:` + repeatedStringForMatchers + `,`, + `Symbolized:` + fmt.Sprintf("%v", this.Symbolized) + `,`, `}`, }, "") return s @@ -5038,6 +5141,7 @@ func (this *QueryStreamResponse) String() string { repeatedStringForChunkseries += "}" s := strings.Join([]string{`&QueryStreamResponse{`, `Chunkseries:` + repeatedStringForChunkseries + `,`, + `Symbols:` + fmt.Sprintf("%v", this.Symbols) + `,`, `}`, }, "") return s @@ -5260,6 +5364,7 @@ func (this *TimeSeriesChunk) String() string { `UserId:` + fmt.Sprintf("%v", this.UserId) + `,`, `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, `Chunks:` + repeatedStringForChunks + `,`, + `LabelsRefs:` + fmt.Sprintf("%v", this.LabelsRefs) + `,`, `}`, }, "") return s @@ -5687,6 +5792,26 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbolized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIngester + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Symbolized = bool(v != 0) default: iNdEx = preIndex skippy, err := skipIngester(dAtA[iNdEx:]) @@ -5899,6 +6024,38 @@ func (m *QueryStreamResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + 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 ErrIntOverflowIngester + } + 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 ErrInvalidLengthIngester + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthIngester + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbols = append(m.Symbols, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipIngester(dAtA[iNdEx:]) @@ -7697,6 +7854,82 @@ func (m *TimeSeriesChunk) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIngester + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LabelsRefs = append(m.LabelsRefs, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIngester + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthIngester + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthIngester + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.LabelsRefs) == 0 { + m.LabelsRefs = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIngester + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LabelsRefs = append(m.LabelsRefs, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field LabelsRefs", wireType) + } default: iNdEx = preIndex skippy, err := skipIngester(dAtA[iNdEx:]) diff --git a/pkg/ingester/client/ingester.proto b/pkg/ingester/client/ingester.proto index 68f343693e..029a242d26 100644 --- a/pkg/ingester/client/ingester.proto +++ b/pkg/ingester/client/ingester.proto @@ -43,6 +43,7 @@ message QueryRequest { int64 start_timestamp_ms = 1; int64 end_timestamp_ms = 2; repeated LabelMatcher matchers = 3; + bool Symbolized = 4; } message ExemplarQueryRequest { @@ -56,6 +57,8 @@ message QueryStreamResponse { repeated TimeSeriesChunk chunkseries = 1 [(gogoproto.nullable) = false]; // Not used anymore reserved 2; + + repeated string symbols = 3; } message ExemplarQueryResponse { @@ -140,6 +143,7 @@ message TimeSeriesChunk { string user_id = 2; repeated cortexpb.LabelPair labels = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cortexproject/cortex/pkg/cortexpb.LabelAdapter"]; repeated Chunk chunks = 4 [(gogoproto.nullable) = false]; + repeated uint32 labels_refs = 5; } message Chunk { diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index 2af8d254f3..533844cf43 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -1969,7 +1969,7 @@ func (i *Ingester) QueryStream(req *client.QueryRequest, stream client.Ingester_ numSeries := 0 totalDataBytes := 0 numChunks := 0 - numSeries, numSamples, totalDataBytes, numChunks, err = i.queryStreamChunks(ctx, db, int64(from), int64(through), matchers, shardMatcher, stream) + numSeries, numSamples, totalDataBytes, numChunks, err = i.queryStreamChunks(ctx, db, int64(from), int64(through), matchers, shardMatcher, req.Symbolized, stream) if err != nil { return err @@ -2001,7 +2001,7 @@ func (i *Ingester) trackInflightQueryRequest() (func(), error) { } // queryStreamChunks streams metrics from a TSDB. This implements the client.IngesterServer interface -func (i *Ingester) queryStreamChunks(ctx context.Context, db *userTSDB, from, through int64, matchers []*labels.Matcher, sm *storepb.ShardMatcher, stream client.Ingester_QueryStreamServer) (numSeries, numSamples, totalBatchSizeBytes, numChunks int, _ error) { +func (i *Ingester) queryStreamChunks(ctx context.Context, db *userTSDB, from, through int64, matchers []*labels.Matcher, sm *storepb.ShardMatcher, sym bool, stream client.Ingester_QueryStreamServer) (numSeries, numSamples, totalBatchSizeBytes, numChunks int, _ error) { q, err := db.ChunkQuerier(from, through) if err != nil { return 0, 0, 0, 0, err @@ -2078,9 +2078,13 @@ func (i *Ingester) queryStreamChunks(ctx context.Context, db *userTSDB, from, th if (batchSizeBytes > 0 && batchSizeBytes+tsSize > queryStreamBatchMessageSize) || len(chunkSeries) >= queryStreamBatchSize { // Adding this series to the batch would make it too big, // flush the data and add it to new batch instead. - err = client.SendQueryStream(stream, &client.QueryStreamResponse{ + r := &client.QueryStreamResponse{ Chunkseries: chunkSeries, - }) + } + if sym { + r.SymbolizeLabels() + } + err = client.SendQueryStream(stream, r) if err != nil { return 0, 0, 0, 0, err }