From b8bcad36cfd0283fa73267921fe0e3334d3123e7 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 01/13] Allow the option of ignoring name when comparing shape --- pkg/mimirpb/compat_test.go | 4 +-- pkg/mimirpb/query_response_extra_test.go | 2 +- pkg/util/test/shape.go | 37 +++++++++++++++--------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 8f84a97a16e..542a7c53fb4 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -564,7 +564,7 @@ func TestPrometheusSampleHistogramInSyncWithMimirPbSampleHistogram(t *testing.T) protoType := reflect.TypeOf(SampleHistogram{}) prometheusType := reflect.TypeOf(model.SampleHistogram{}) - test.RequireSameShape(t, prometheusType, protoType) + test.RequireSameShape(t, prometheusType, protoType, false) } // Check that Promtheus Label and MimirPb LabelAdapter types converted @@ -573,5 +573,5 @@ func TestPrometheusLabelsInSyncWithMimirPbLabelAdapter(t *testing.T) { protoType := reflect.TypeOf(LabelAdapter{}) prometheusType := reflect.TypeOf(labels.Label{}) - test.RequireSameShape(t, prometheusType, protoType) + test.RequireSameShape(t, prometheusType, protoType, false) } diff --git a/pkg/mimirpb/query_response_extra_test.go b/pkg/mimirpb/query_response_extra_test.go index e475ae0a622..ad5d145bd70 100644 --- a/pkg/mimirpb/query_response_extra_test.go +++ b/pkg/mimirpb/query_response_extra_test.go @@ -81,5 +81,5 @@ func TestFloatHistogramProtobufTypeRemainsInSyncWithPrometheus(t *testing.T) { protoType := reflect.TypeOf(FloatHistogram{}) prometheusType := reflect.TypeOf(histogram.FloatHistogram{}) - test.RequireSameShape(t, prometheusType, protoType) + test.RequireSameShape(t, prometheusType, protoType, false) } diff --git a/pkg/util/test/shape.go b/pkg/util/test/shape.go index 1810c1c719b..c05a5144479 100644 --- a/pkg/util/test/shape.go +++ b/pkg/util/test/shape.go @@ -16,29 +16,34 @@ import ( // in the same order). This function requires that this property is maintained. // The fields do not need to have the same names to make the conversion safe, // but we also check the names are the same here to ensure there's no confusion -// (eg. two bool fields swapped). -func RequireSameShape(t *testing.T, expectedType reflect.Type, actualType reflect.Type) { - expectedFormatted := prettyPrintType(expectedType) - actualFormatted := prettyPrintType(actualType) +// (eg. two bool fields swapped) when ignoreName is false. However, when you +// know the names are different, you can set ignoreName to true. +func RequireSameShape(t *testing.T, expectedType reflect.Type, actualType reflect.Type, ignoreName bool) { + expectedFormatted := prettyPrintType(expectedType, ignoreName) + actualFormatted := prettyPrintType(actualType, ignoreName) require.Equal(t, expectedFormatted, actualFormatted) } -func prettyPrintType(t reflect.Type) string { +func prettyPrintType(t reflect.Type, ignoreName bool) string { if t.Kind() != reflect.Struct { panic(fmt.Sprintf("expected %s to be a struct but is %s", t.Name(), t.Kind())) } tree := treeprint.NewWithRoot("") - addTypeToTree(t, tree) + addTypeToTree(t, tree, ignoreName) return tree.String() } -func addTypeToTree(t reflect.Type, tree treeprint.Tree) { +func addTypeToTree(t reflect.Type, tree treeprint.Tree, ignoreName bool) { if t.Kind() == reflect.Pointer { - name := fmt.Sprintf("%s: *%s", t.Name(), t.Elem().Kind()) - addTypeToTree(t.Elem(), tree.AddBranch(name)) + fieldName := t.Name() + if ignoreName { + fieldName = "name" + } + name := fmt.Sprintf("%s: *%s", fieldName, t.Elem().Kind()) + addTypeToTree(t.Elem(), tree.AddBranch(name), ignoreName) return } @@ -48,21 +53,25 @@ func addTypeToTree(t reflect.Type, tree treeprint.Tree) { for i := 0; i < t.NumField(); i++ { f := t.Field(i) + fieldName := f.Name + if ignoreName { + fieldName = "name" + } switch f.Type.Kind() { case reflect.Pointer: - name := fmt.Sprintf("+%v %s: *%s", f.Offset, f.Name, f.Type.Elem().Kind()) - addTypeToTree(f.Type.Elem(), tree.AddBranch(name)) + name := fmt.Sprintf("+%v %s: *%s", f.Offset, fieldName, f.Type.Elem().Kind()) + addTypeToTree(f.Type.Elem(), tree.AddBranch(name), ignoreName) case reflect.Slice: - name := fmt.Sprintf("+%v %s: []%s", f.Offset, f.Name, f.Type.Elem().Kind()) + name := fmt.Sprintf("+%v %s: []%s", f.Offset, fieldName, f.Type.Elem().Kind()) if isPrimitive(f.Type.Elem().Kind()) { tree.AddNode(name) } else { - addTypeToTree(f.Type.Elem(), tree.AddBranch(name)) + addTypeToTree(f.Type.Elem(), tree.AddBranch(name), ignoreName) } default: - name := fmt.Sprintf("+%v %s: %s", f.Offset, f.Name, f.Type.Kind()) + name := fmt.Sprintf("+%v %s: %s", f.Offset, fieldName, f.Type.Kind()) tree.AddNode(name) } } From f79d791bd6e4bc9ffd8a1db83e3c1f69c0066aad Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 02/13] Update the ignored name when comparing shape according to code review --- pkg/util/test/shape.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/util/test/shape.go b/pkg/util/test/shape.go index c05a5144479..a18c700cc36 100644 --- a/pkg/util/test/shape.go +++ b/pkg/util/test/shape.go @@ -11,6 +11,8 @@ import ( "github.com/xlab/treeprint" ) +const ignoredFieldName = "" + // We use unsafe casting to convert between some Mimir and Prometheus types // For this to be safe, the two types need to have the same shape (same fields // in the same order). This function requires that this property is maintained. @@ -40,7 +42,7 @@ func addTypeToTree(t reflect.Type, tree treeprint.Tree, ignoreName bool) { if t.Kind() == reflect.Pointer { fieldName := t.Name() if ignoreName { - fieldName = "name" + fieldName = ignoredFieldName } name := fmt.Sprintf("%s: *%s", fieldName, t.Elem().Kind()) addTypeToTree(t.Elem(), tree.AddBranch(name), ignoreName) @@ -55,7 +57,7 @@ func addTypeToTree(t reflect.Type, tree treeprint.Tree, ignoreName bool) { f := t.Field(i) fieldName := f.Name if ignoreName { - fieldName = "name" + fieldName = ignoredFieldName } switch f.Type.Kind() { From 4a31adad4e2554cdfa1258d690ea4a99c760e2fe Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 03/13] Improve tests for conversion between histogram and proto --- pkg/mimirpb/compat_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 542a7c53fb4..7c87037b4d1 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -442,6 +442,8 @@ func TestFromHistogramToHistogramProto(t *testing.T) { Timestamp: ts, } assert.Equal(t, expected, p) + h2 := FromHistogramProtoToHistogram(&p) + assert.Equal(t, h, h2) // Also check via JSON encode/decode promP := remote.HistogramToHistogramProto(ts, h) @@ -473,6 +475,8 @@ func TestFromFloatHistogramToHistogramProto(t *testing.T) { Timestamp: ts, } assert.Equal(t, expected, p) + h2 := FromFloatHistogramProtoToFloatHistogram(&p) + assert.Equal(t, h, h2) // Also check via JSON encode/decode promP := remote.FloatHistogramToHistogramProto(ts, h) @@ -567,7 +571,7 @@ func TestPrometheusSampleHistogramInSyncWithMimirPbSampleHistogram(t *testing.T) test.RequireSameShape(t, prometheusType, protoType, false) } -// Check that Promtheus Label and MimirPb LabelAdapter types converted +// Check that Prometheus Label and MimirPb LabelAdapter types converted // into each other with unsafe.Pointer are compatible func TestPrometheusLabelsInSyncWithMimirPbLabelAdapter(t *testing.T) { protoType := reflect.TypeOf(LabelAdapter{}) From 65c38bb9c4fcf430ec54b4f21a85d9daa3b76ecd Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 04/13] Add benchmarks for histogram conversion methods in mimirpb compat --- pkg/mimirpb/compat_test.go | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 7c87037b4d1..18554728217 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -223,6 +223,17 @@ func TestFromFPointsToSamples(t *testing.T) { assert.Equal(t, expected, FromFPointsToSamples(input)) } +func BenchmarkFromFPointsToSamples(b *testing.B) { + n := 100 + input := make([]promql.FPoint, n) + for i := 0; i < n; i++ { + input[i] = promql.FPoint{T: int64(i), F: float64(i)} + } + for i := 0; i < b.N; i++ { + FromFPointsToSamples(input) + } +} + func TestFromHPointsToHistograms(t *testing.T) { input := []promql.HPoint{{T: 3, H: test.GenerateTestFloatHistogram(0)}, {T: 5, H: test.GenerateTestFloatHistogram(1)}} expected := []FloatHistogramPair{ @@ -233,6 +244,17 @@ func TestFromHPointsToHistograms(t *testing.T) { assert.Equal(t, expected, FromHPointsToHistograms(input)) } +func BenchmarkFromHPointsToHistograms(b *testing.B) { + n := 100 + input := make([]promql.HPoint, n) + for i := 0; i < n; i++ { + input[i] = promql.HPoint{T: int64(i), H: test.GenerateTestFloatHistogram(i)} + } + for i := 0; i < b.N; i++ { + FromHPointsToHistograms(input) + } +} + func TestPreallocatingMetric(t *testing.T) { t.Run("should be unmarshallable from the bytes of a default Metric", func(t *testing.T) { metric := Metric{ @@ -454,6 +476,16 @@ func TestFromHistogramToHistogramProto(t *testing.T) { assert.Equal(t, expected, p2) } +func BenchmarkFromHistogramToHistogramProto(b *testing.B) { + for i := 0; i < b.N; i++ { + for i := 0; i < 100; i++ { + h := test.GenerateTestHistogram(int(i)) + p := FromHistogramToHistogramProto(int64(i), h) + FromHistogramProtoToHistogram(&p) + } + } +} + func TestFromFloatHistogramToHistogramProto(t *testing.T) { var ts int64 = 1 h := test.GenerateTestFloatHistogram(int(ts)) @@ -487,6 +519,16 @@ func TestFromFloatHistogramToHistogramProto(t *testing.T) { assert.Equal(t, expected, p2) } +func BenchmarkFromFloatHistogramToHistogramProto(b *testing.B) { + for i := 0; i < b.N; i++ { + for i := 0; i < 100; i++ { + h := test.GenerateTestFloatHistogram(int(i)) + p := FromFloatHistogramToHistogramProto(int64(i), h) + FromFloatHistogramProtoToFloatHistogram(&p) + } + } +} + func TestFromFloatHistogramToPromHistogram(t *testing.T) { cases := []struct { h histogram.FloatHistogram From 74338fbfe59aafbbf84a377aefcf7d62593b3ff7 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 05/13] Fix benchmarks according to code review --- pkg/mimirpb/compat_test.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 18554728217..c8538f6a779 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -229,6 +229,7 @@ func BenchmarkFromFPointsToSamples(b *testing.B) { for i := 0; i < n; i++ { input[i] = promql.FPoint{T: int64(i), F: float64(i)} } + b.ResetTimer() for i := 0; i < b.N; i++ { FromFPointsToSamples(input) } @@ -250,6 +251,7 @@ func BenchmarkFromHPointsToHistograms(b *testing.B) { for i := 0; i < n; i++ { input[i] = promql.HPoint{T: int64(i), H: test.GenerateTestFloatHistogram(i)} } + b.ResetTimer() for i := 0; i < b.N; i++ { FromHPointsToHistograms(input) } @@ -477,9 +479,14 @@ func TestFromHistogramToHistogramProto(t *testing.T) { } func BenchmarkFromHistogramToHistogramProto(b *testing.B) { + n := 100 + input := make([]*histogram.Histogram, n) + for i := 0; i < n; i++ { + input[i] = test.GenerateTestHistogram(int(i)) + } + b.ResetTimer() for i := 0; i < b.N; i++ { - for i := 0; i < 100; i++ { - h := test.GenerateTestHistogram(int(i)) + for _, h := range input { p := FromHistogramToHistogramProto(int64(i), h) FromHistogramProtoToHistogram(&p) } @@ -520,9 +527,14 @@ func TestFromFloatHistogramToHistogramProto(t *testing.T) { } func BenchmarkFromFloatHistogramToHistogramProto(b *testing.B) { + n := 100 + input := make([]*histogram.FloatHistogram, n) + for i := 0; i < n; i++ { + input[i] = test.GenerateTestFloatHistogram(int(i)) + } + b.ResetTimer() for i := 0; i < b.N; i++ { - for i := 0; i < 100; i++ { - h := test.GenerateTestFloatHistogram(int(i)) + for _, h := range input { p := FromFloatHistogramToHistogramProto(int64(i), h) FromFloatHistogramProtoToFloatHistogram(&p) } From c20c4e308b53e05ee12b42878755b6c19a00451d Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 06/13] Direct cast from FPoints to Samples --- pkg/mimirpb/compat.go | 11 ++--------- pkg/mimirpb/compat_test.go | 9 +++++++++ pkg/mimirpb/mimir.pb.go | 1 + pkg/mimirpb/mimir.proto | 1 + 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/pkg/mimirpb/compat.go b/pkg/mimirpb/compat.go index cd6036e9fbb..a06d5f17e9c 100644 --- a/pkg/mimirpb/compat.go +++ b/pkg/mimirpb/compat.go @@ -341,16 +341,9 @@ func fromSpansToSpansProto(s []histogram.Span) []BucketSpan { return spans } -// FromFPointsToSamples converts []promql.FPoint to []Sample. +// FromFPointsToSamples casts []promql.FPoint to []Sample. It uses unsafe. func FromFPointsToSamples(points []promql.FPoint) []Sample { - samples := make([]Sample, 0, len(points)) - for _, point := range points { - samples = append(samples, Sample{ - TimestampMs: point.T, - Value: point.F, - }) - } - return samples + return *(*[]Sample)(unsafe.Pointer(&points)) } // FromHPointsToHistograms converts []promql.HPoint to []FloatHistogramPair. diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index c8538f6a779..1d477ffdccb 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -223,6 +223,15 @@ func TestFromFPointsToSamples(t *testing.T) { assert.Equal(t, expected, FromFPointsToSamples(input)) } +// Check that Prometheus FPoint and Mimir Sample types converted +// into each other with unsafe.Pointer are compatible +func TestPrometheusFPointInSyncWithMimirPbSample(t *testing.T) { + protoType := reflect.TypeOf(Sample{}) + prometheusType := reflect.TypeOf(promql.FPoint{}) + + test.RequireSameShape(t, prometheusType, protoType, true) +} + func BenchmarkFromFPointsToSamples(b *testing.B) { n := 100 input := make([]promql.FPoint, n) diff --git a/pkg/mimirpb/mimir.pb.go b/pkg/mimirpb/mimir.pb.go index 86d665e8492..ac27fd810d7 100644 --- a/pkg/mimirpb/mimir.pb.go +++ b/pkg/mimirpb/mimir.pb.go @@ -390,6 +390,7 @@ func (m *LabelPair) GetValue() []byte { } type Sample struct { + // Fields order MUST match promql.FPoint so that we can cast types between them. TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` } diff --git a/pkg/mimirpb/mimir.proto b/pkg/mimirpb/mimir.proto index 634874e88a6..c1017461021 100644 --- a/pkg/mimirpb/mimir.proto +++ b/pkg/mimirpb/mimir.proto @@ -48,6 +48,7 @@ message LabelPair { } message Sample { + // Fields order MUST match promql.FPoint so that we can cast types between them. int64 timestamp_ms = 2; double value = 1; } From ff674b6ab2e248699851a3e3bc553e149f8fbcd6 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 07/13] Direct cast between BucketSpans and histogram.Spans --- pkg/mimirpb/compat.go | 14 ++------------ pkg/mimirpb/compat_test.go | 9 +++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pkg/mimirpb/compat.go b/pkg/mimirpb/compat.go index a06d5f17e9c..9033093bce6 100644 --- a/pkg/mimirpb/compat.go +++ b/pkg/mimirpb/compat.go @@ -279,12 +279,7 @@ func fromSpansProtoToSpans(s []BucketSpan) []histogram.Span { if len(s) == 0 { return nil } - spans := make([]histogram.Span, len(s)) - for i := 0; i < len(s); i++ { - spans[i] = histogram.Span{Offset: s[i].Offset, Length: s[i].Length} - } - - return spans + return *(*[]histogram.Span)(unsafe.Pointer(&s)) } func FromHistogramToHistogramProto(timestamp int64, h *histogram.Histogram) Histogram { @@ -333,12 +328,7 @@ func fromSpansToSpansProto(s []histogram.Span) []BucketSpan { if len(s) == 0 { return nil } - spans := make([]BucketSpan, len(s)) - for i := 0; i < len(s); i++ { - spans[i] = BucketSpan{Offset: s[i].Offset, Length: s[i].Length} - } - - return spans + return *(*[]BucketSpan)(unsafe.Pointer(&s)) } // FromFPointsToSamples casts []promql.FPoint to []Sample. It uses unsafe. diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 1d477ffdccb..7a4d9018eb4 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -642,3 +642,12 @@ func TestPrometheusLabelsInSyncWithMimirPbLabelAdapter(t *testing.T) { test.RequireSameShape(t, prometheusType, protoType, false) } + +// Check that Prometheus histogram.Span and MimirPb BucketSpan types converted +// into each other with unsafe.Pointer are compatible +func TestPrometheusHistogramSpanInSyncWithMimirPbBucketSpan(t *testing.T) { + protoType := reflect.TypeOf(BucketSpan{}) + prometheusType := reflect.TypeOf(histogram.Span{}) + + test.RequireSameShape(t, prometheusType, protoType, false) +} From 273a38827ec95a51647b716224a0130577cdeb65 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 08/13] Direct cast from HPoints to FloatHistogramPairs --- pkg/api/protobuf_codec.go | 2 +- pkg/api/protobuf_codec_test.go | 6 +- .../querymiddleware/codec_json_test.go | 4 +- .../querymiddleware/codec_protobuf.go | 4 +- .../querymiddleware/codec_protobuf_test.go | 12 +- pkg/frontend/querymiddleware/codec_test.go | 12 +- .../querymiddleware/sharded_queryable_test.go | 4 +- .../querymiddleware/split_and_cache_test.go | 12 +- pkg/mimirpb/compat.go | 15 +- pkg/mimirpb/compat_test.go | 13 +- pkg/mimirpb/mimir.pb.go | 315 +++++++++--------- pkg/mimirpb/mimir.proto | 5 +- 12 files changed, 207 insertions(+), 197 deletions(-) diff --git a/pkg/api/protobuf_codec.go b/pkg/api/protobuf_codec.go index 237bba061c7..da142e47ad7 100644 --- a/pkg/api/protobuf_codec.go +++ b/pkg/api/protobuf_codec.go @@ -148,7 +148,7 @@ func (c protobufCodec) encodeMatrixSeries(s promql.Series) mimirpb.MatrixSeries for _, p := range s.Histograms { histograms = append(histograms, mimirpb.FloatHistogramPair{ TimestampMs: p.T, - Histogram: *mimirpb.FloatHistogramFromPrometheusModel(p.H), + Histogram: mimirpb.FloatHistogramFromPrometheusModel(p.H), }) } diff --git a/pkg/api/protobuf_codec_test.go b/pkg/api/protobuf_codec_test.go index 36613653a63..24be49acea3 100644 --- a/pkg/api/protobuf_codec_test.go +++ b/pkg/api/protobuf_codec_test.go @@ -715,7 +715,7 @@ var protobufCodecScenarios = map[string]struct { Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: 1234, - Histogram: mimirpb.FloatHistogram{ + Histogram: &mimirpb.FloatHistogram{ CounterResetHint: histogram.GaugeType, Schema: 3, ZeroThreshold: 1.23, @@ -827,7 +827,7 @@ var protobufCodecScenarios = map[string]struct { Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: 1234, - Histogram: mimirpb.FloatHistogram{ + Histogram: &mimirpb.FloatHistogram{ CounterResetHint: histogram.GaugeType, Schema: 3, ZeroThreshold: 1.23, @@ -848,7 +848,7 @@ var protobufCodecScenarios = map[string]struct { }, { TimestampMs: 12340, - Histogram: mimirpb.FloatHistogram{ + Histogram: &mimirpb.FloatHistogram{ CounterResetHint: histogram.GaugeType, Schema: 4, ZeroThreshold: 1.203, diff --git a/pkg/frontend/querymiddleware/codec_json_test.go b/pkg/frontend/querymiddleware/codec_json_test.go index 1bf3729d75c..316e2d16ecc 100644 --- a/pkg/frontend/querymiddleware/codec_json_test.go +++ b/pkg/frontend/querymiddleware/codec_json_test.go @@ -269,7 +269,7 @@ func TestPrometheusCodec_JSONEncoding(t *testing.T) { Data: &PrometheusData{ ResultType: model.ValMatrix.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1_234, Histogram: responseHistogram}}}, + {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1_234, Histogram: &responseHistogram}}}, }, }, }, @@ -316,7 +316,7 @@ func TestPrometheusCodec_JSONEncoding(t *testing.T) { { Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 101}, {TimestampMs: 2_000, Value: 201}}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 3_000, Histogram: responseHistogram}}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 3_000, Histogram: &responseHistogram}}}, }, }, }, diff --git a/pkg/frontend/querymiddleware/codec_protobuf.go b/pkg/frontend/querymiddleware/codec_protobuf.go index bddec9c01d5..e2ce21f9c66 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf.go +++ b/pkg/frontend/querymiddleware/codec_protobuf.go @@ -158,7 +158,7 @@ func (protobufFormatter) encodeVectorData(data []SampleStream) (mimirpb.VectorDa histograms = append(histograms, mimirpb.VectorHistogram{ Metric: metric, - Histogram: sample.Histogram, + Histogram: *sample.Histogram, TimestampMs: sample.TimestampMs, }) } @@ -288,7 +288,7 @@ func (f protobufFormatter) decodeVectorData(data *mimirpb.VectorData) (*Promethe Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: sample.TimestampMs, - Histogram: sample.Histogram, + Histogram: &sample.Histogram, }, }, } diff --git a/pkg/frontend/querymiddleware/codec_protobuf_test.go b/pkg/frontend/querymiddleware/codec_protobuf_test.go index b67aff63d2e..48ebc7cb95b 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf_test.go +++ b/pkg/frontend/querymiddleware/codec_protobuf_test.go @@ -236,7 +236,7 @@ var protobufCodecScenarios = []struct { Result: []SampleStream{ { Labels: []mimirpb.LabelAdapter{{Name: "name-1", Value: "value-1"}}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: protobufResponseHistogram}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, }, @@ -273,7 +273,7 @@ var protobufCodecScenarios = []struct { }, { Labels: []mimirpb.LabelAdapter{{Name: "baz", Value: "blah"}}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: protobufResponseHistogram}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, }, @@ -499,7 +499,7 @@ var protobufCodecScenarios = []struct { Series: []mimirpb.MatrixSeries{ { Metric: []string{"name-1", "value-1", "name-2", "value-2"}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: protobufResponseHistogram}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, }, @@ -512,7 +512,7 @@ var protobufCodecScenarios = []struct { Result: []SampleStream{ { Labels: []mimirpb.LabelAdapter{{Name: "name-1", Value: "value-1"}, {Name: "name-2", Value: "value-2"}}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: protobufResponseHistogram}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, }, @@ -529,7 +529,7 @@ var protobufCodecScenarios = []struct { { Metric: []string{"name-1", "value-1", "name-2", "value-2"}, Samples: []mimirpb.Sample{{TimestampMs: 1000, Value: 200}}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: protobufResponseHistogram}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, }, @@ -543,7 +543,7 @@ var protobufCodecScenarios = []struct { { Labels: []mimirpb.LabelAdapter{{Name: "name-1", Value: "value-1"}, {Name: "name-2", Value: "value-2"}}, Samples: []mimirpb.Sample{{TimestampMs: 1000, Value: 200}}, - Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: protobufResponseHistogram}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, }, diff --git a/pkg/frontend/querymiddleware/codec_test.go b/pkg/frontend/querymiddleware/codec_test.go index 865fdbbec24..ec32c99cd86 100644 --- a/pkg/frontend/querymiddleware/codec_test.go +++ b/pkg/frontend/querymiddleware/codec_test.go @@ -564,7 +564,7 @@ func TestMergeAPIResponses(t *testing.T) { { Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ - {TimestampMs: 1000, Histogram: histogram1}, + {TimestampMs: 1000, Histogram: &histogram1}, }, }, }, @@ -581,7 +581,7 @@ func TestMergeAPIResponses(t *testing.T) { Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: 1000, - Histogram: histogram1, + Histogram: &histogram1, }, }, }, @@ -601,7 +601,7 @@ func TestMergeAPIResponses(t *testing.T) { { Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ - {TimestampMs: 1000, Histogram: histogram1}, + {TimestampMs: 1000, Histogram: &histogram1}, }, }, }, @@ -615,7 +615,7 @@ func TestMergeAPIResponses(t *testing.T) { { Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ - {TimestampMs: 2000, Histogram: histogram2}, + {TimestampMs: 2000, Histogram: &histogram2}, }, }, }, @@ -630,8 +630,8 @@ func TestMergeAPIResponses(t *testing.T) { { Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ - {TimestampMs: 1000, Histogram: histogram1}, - {TimestampMs: 2000, Histogram: histogram2}, + {TimestampMs: 1000, Histogram: &histogram1}, + {TimestampMs: 2000, Histogram: &histogram2}, }, }, }, diff --git a/pkg/frontend/querymiddleware/sharded_queryable_test.go b/pkg/frontend/querymiddleware/sharded_queryable_test.go index 0f989884053..1c5d9bba78c 100644 --- a/pkg/frontend/querymiddleware/sharded_queryable_test.go +++ b/pkg/frontend/querymiddleware/sharded_queryable_test.go @@ -464,13 +464,13 @@ func seriesSetToSampleStreams(set storage.SeriesSet) ([]SampleStream, error) { case chunkenc.ValHistogram: t, v := it.AtHistogram() stream.Histograms = append(stream.Histograms, mimirpb.FloatHistogramPair{ - Histogram: *mimirpb.FloatHistogramFromPrometheusModel(v.ToFloat()), + Histogram: mimirpb.FloatHistogramFromPrometheusModel(v.ToFloat()), TimestampMs: t, }) case chunkenc.ValFloatHistogram: t, v := it.AtFloatHistogram() stream.Histograms = append(stream.Histograms, mimirpb.FloatHistogramPair{ - Histogram: *mimirpb.FloatHistogramFromPrometheusModel(v), + Histogram: mimirpb.FloatHistogramFromPrometheusModel(v), TimestampMs: t, }) default: diff --git a/pkg/frontend/querymiddleware/split_and_cache_test.go b/pkg/frontend/querymiddleware/split_and_cache_test.go index 49ae2c4b444..5b307dd1280 100644 --- a/pkg/frontend/querymiddleware/split_and_cache_test.go +++ b/pkg/frontend/querymiddleware/split_and_cache_test.go @@ -81,7 +81,7 @@ func TestSplitAndCacheMiddleware_SplitByInterval(t *testing.T) { mockProtobufResponseWithSamplesAndHistograms(seriesLabels, nil, []mimirpb.FloatHistogramPair{ { TimestampMs: dayThreeStartTime.Unix() * 1000, - Histogram: thirdDayHistogram, + Histogram: &thirdDayHistogram, }, })) @@ -108,7 +108,7 @@ func TestSplitAndCacheMiddleware_SplitByInterval(t *testing.T) { mockProtobufResponseWithSamplesAndHistograms(seriesLabels, nil, []mimirpb.FloatHistogramPair{ { TimestampMs: dayFourEndTime.Unix() * 1000, - Histogram: fourthDayHistogram, + Histogram: &fourthDayHistogram, }, })) @@ -121,11 +121,11 @@ func TestSplitAndCacheMiddleware_SplitByInterval(t *testing.T) { []mimirpb.FloatHistogramPair{ { TimestampMs: dayThreeStartTime.Unix() * 1000, - Histogram: thirdDayHistogram, + Histogram: &thirdDayHistogram, }, { TimestampMs: dayFourEndTime.Unix() * 1000, - Histogram: fourthDayHistogram, + Histogram: &fourthDayHistogram, }, }, )) @@ -262,7 +262,7 @@ func TestSplitAndCacheMiddleware_ResultsCache(t *testing.T) { Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: 1634292000000, - Histogram: mimirpb.FloatHistogram{ + Histogram: &mimirpb.FloatHistogram{ CounterResetHint: histogram.GaugeType, Schema: 3, ZeroThreshold: 1.23, @@ -370,7 +370,7 @@ func TestSplitAndCacheMiddleware_ResultsCache_ShouldNotLookupCacheIfStepIsNotAli Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: 1634292000000, - Histogram: mimirpb.FloatHistogram{ + Histogram: &mimirpb.FloatHistogram{ CounterResetHint: histogram.GaugeType, Schema: 3, ZeroThreshold: 1.23, diff --git a/pkg/mimirpb/compat.go b/pkg/mimirpb/compat.go index 9033093bce6..88ba1214a87 100644 --- a/pkg/mimirpb/compat.go +++ b/pkg/mimirpb/compat.go @@ -336,20 +336,9 @@ func FromFPointsToSamples(points []promql.FPoint) []Sample { return *(*[]Sample)(unsafe.Pointer(&points)) } -// FromHPointsToHistograms converts []promql.HPoint to []FloatHistogramPair. +// FromHPointsToHistograms converts []promql.HPoint to []FloatHistogramPair. It uses unsafe. func FromHPointsToHistograms(points []promql.HPoint) []FloatHistogramPair { - samples := make([]FloatHistogramPair, 0, len(points)) - for _, point := range points { - h := point.H - if h == nil { - continue - } - samples = append(samples, FloatHistogramPair{ - TimestampMs: point.T, - Histogram: *FloatHistogramFromPrometheusModel(point.H), - }) - } - return samples + return *(*[]FloatHistogramPair)(unsafe.Pointer(&points)) } // FromFloatHistogramToPromHistogram converts histogram.FloatHistogram to model.SampleHistogram. diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 7a4d9018eb4..570d63dfe26 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -247,13 +247,22 @@ func BenchmarkFromFPointsToSamples(b *testing.B) { func TestFromHPointsToHistograms(t *testing.T) { input := []promql.HPoint{{T: 3, H: test.GenerateTestFloatHistogram(0)}, {T: 5, H: test.GenerateTestFloatHistogram(1)}} expected := []FloatHistogramPair{ - {TimestampMs: 3, Histogram: *FloatHistogramFromPrometheusModel(test.GenerateTestFloatHistogram(0))}, - {TimestampMs: 5, Histogram: *FloatHistogramFromPrometheusModel(test.GenerateTestFloatHistogram(1))}, + {TimestampMs: 3, Histogram: FloatHistogramFromPrometheusModel(test.GenerateTestFloatHistogram(0))}, + {TimestampMs: 5, Histogram: FloatHistogramFromPrometheusModel(test.GenerateTestFloatHistogram(1))}, } assert.Equal(t, expected, FromHPointsToHistograms(input)) } +// Check that Prometheus HPoint and Mimir FloatHistogramPair types converted +// into each other with unsafe.Pointer are compatible +func TestPrometheusHPointInSyncWithMimirPbFloatHistogramPair(t *testing.T) { + protoType := reflect.TypeOf(FloatHistogramPair{}) + prometheusType := reflect.TypeOf(promql.HPoint{}) + + test.RequireSameShape(t, prometheusType, protoType, true) +} + func BenchmarkFromHPointsToHistograms(b *testing.B) { n := 100 input := make([]promql.HPoint, n) diff --git a/pkg/mimirpb/mimir.pb.go b/pkg/mimirpb/mimir.pb.go index ac27fd810d7..135ea1db047 100644 --- a/pkg/mimirpb/mimir.pb.go +++ b/pkg/mimirpb/mimir.pb.go @@ -1008,8 +1008,9 @@ func (m *BucketSpan) GetLength() uint32 { } type FloatHistogramPair struct { - Histogram FloatHistogram `protobuf:"bytes,1,opt,name=histogram,proto3" json:"histogram"` - TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + // Fields order MUST match promql.HPoint so that we can cast types between them. + TimestampMs int64 `protobuf:"varint,1,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + Histogram *FloatHistogram `protobuf:"bytes,2,opt,name=histogram,proto3" json:"histogram,omitempty"` } func (m *FloatHistogramPair) Reset() { *m = FloatHistogramPair{} } @@ -1044,18 +1045,18 @@ func (m *FloatHistogramPair) XXX_DiscardUnknown() { var xxx_messageInfo_FloatHistogramPair proto.InternalMessageInfo -func (m *FloatHistogramPair) GetHistogram() FloatHistogram { +func (m *FloatHistogramPair) GetTimestampMs() int64 { if m != nil { - return m.Histogram + return m.TimestampMs } - return FloatHistogram{} + return 0 } -func (m *FloatHistogramPair) GetTimestampMs() int64 { +func (m *FloatHistogramPair) GetHistogram() *FloatHistogram { if m != nil { - return m.TimestampMs + return m.Histogram } - return 0 + return nil } // SampleHistogram is based on https://github.com/prometheus/common/blob/main/model/value_histogram.go @@ -1786,117 +1787,118 @@ func init() { func init() { proto.RegisterFile("mimir.proto", fileDescriptor_86d4d7485f544059) } var fileDescriptor_86d4d7485f544059 = []byte{ - // 1754 bytes of a gzipped FileDescriptorProto + // 1761 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x23, 0x49, 0x15, 0x76, 0xd9, 0x1d, 0xdb, 0xfd, 0x62, 0x3b, 0xbd, 0xb5, 0xa3, 0xc1, 0x3b, 0xda, 0x71, 0x32, 0x8d, 0x58, 0x02, 0x02, 0x0f, 0x9a, 0x85, 0x59, 0xed, 0x6a, 0x10, 0xb4, 0x9d, 0x9e, 0x49, 0xb2, - 0x89, 0x1d, 0xca, 0xf6, 0x2c, 0xcb, 0xc5, 0xea, 0x38, 0x95, 0xb8, 0xb5, 0xdd, 0xee, 0xa6, 0x7f, - 0x0c, 0x13, 0x4e, 0x5c, 0x40, 0x88, 0x13, 0x17, 0x2e, 0x88, 0x1b, 0x07, 0xf8, 0x0b, 0xf8, 0x1b, - 0x46, 0x42, 0x48, 0x73, 0x5c, 0x71, 0x18, 0x31, 0x99, 0xcb, 0x1e, 0xf7, 0xc0, 0x89, 0x13, 0xaa, - 0x57, 0xfd, 0xc3, 0xed, 0x24, 0xb0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94, 0x2f, + 0xff, 0xa4, 0xed, 0xe5, 0x44, 0x21, 0xeb, 0xfc, 0xdb, 0xd7, 0xe5, 0x11, 0xdf, 0x1e, 0x97, 0x74, + 0xd1, 0xfb, 0xfe, 0xf3, 0x97, 0x9d, 0xd2, 0xa7, 0x2f, 0x3b, 0xa5, 0xcf, 0x5f, 0x76, 0xc8, 0x2f, + 0x2e, 0x3a, 0xe4, 0xcf, 0x17, 0x1d, 0xf2, 0xec, 0xa2, 0x43, 0x9e, 0x5f, 0x74, 0xc8, 0x3f, 0x2e, + 0x3a, 0xe4, 0xb3, 0x8b, 0x4e, 0xe9, 0xf3, 0x8b, 0x0e, 0xf9, 0xed, 0xab, 0x4e, 0xe9, 0xf9, 0xab, + 0x4e, 0xe9, 0xd3, 0x57, 0x9d, 0xd2, 0x4f, 0x6a, 0xf8, 0x07, 0x8b, 0x7f, 0x7c, 0x5c, 0xc5, 0xbf, + 0x4a, 0xde, 0xfd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x71, 0xa8, 0x83, 0x88, 0x72, 0x11, 0x00, + 0x00, } func (x WriteRequest_SourceEnum) String() string { @@ -2517,10 +2519,10 @@ func (this *FloatHistogramPair) Equal(that interface{}) bool { } else if this == nil { return false } - if !this.Histogram.Equal(&that1.Histogram) { + if this.TimestampMs != that1.TimestampMs { return false } - if this.TimestampMs != that1.TimestampMs { + if !this.Histogram.Equal(that1.Histogram) { return false } return true @@ -3220,8 +3222,10 @@ func (this *FloatHistogramPair) GoString() string { } s := make([]string, 0, 6) s = append(s, "&mimirpb.FloatHistogramPair{") - s = append(s, "Histogram: "+strings.Replace(this.Histogram.GoString(), `&`, ``, 1)+",\n") s = append(s, "TimestampMs: "+fmt.Sprintf("%#v", this.TimestampMs)+",\n") + if this.Histogram != nil { + s = append(s, "Histogram: "+fmt.Sprintf("%#v", this.Histogram)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -4162,21 +4166,23 @@ func (m *FloatHistogramPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Histogram != nil { + { + size, err := m.Histogram.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMimir(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } if m.TimestampMs != 0 { i = encodeVarintMimir(dAtA, i, uint64(m.TimestampMs)) i-- - dAtA[i] = 0x10 - } - { - size, err := m.Histogram.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMimir(dAtA, i, uint64(size)) + dAtA[i] = 0x8 } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -5087,11 +5093,13 @@ func (m *FloatHistogramPair) Size() (n int) { } var l int _ = l - l = m.Histogram.Size() - n += 1 + l + sovMimir(uint64(l)) if m.TimestampMs != 0 { n += 1 + sovMimir(uint64(m.TimestampMs)) } + if m.Histogram != nil { + l = m.Histogram.Size() + n += 1 + l + sovMimir(uint64(l)) + } return n } @@ -5593,8 +5601,8 @@ func (this *FloatHistogramPair) String() string { return "nil" } s := strings.Join([]string{`&FloatHistogramPair{`, - `Histogram:` + strings.Replace(strings.Replace(this.Histogram.String(), "FloatHistogram", "FloatHistogram", 1), `&`, ``, 1) + `,`, `TimestampMs:` + fmt.Sprintf("%v", this.TimestampMs) + `,`, + `Histogram:` + strings.Replace(this.Histogram.String(), "FloatHistogram", "FloatHistogram", 1) + `,`, `}`, }, "") return s @@ -7747,6 +7755,25 @@ func (m *FloatHistogramPair) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimestampMs", wireType) + } + m.TimestampMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMimir + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimestampMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) } @@ -7775,29 +7802,13 @@ func (m *FloatHistogramPair) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } + if m.Histogram == nil { + m.Histogram = &FloatHistogram{} + } if err := m.Histogram.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimestampMs", wireType) - } - m.TimestampMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimestampMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipMimir(dAtA[iNdEx:]) diff --git a/pkg/mimirpb/mimir.proto b/pkg/mimirpb/mimir.proto index c1017461021..ee811f4768c 100644 --- a/pkg/mimirpb/mimir.proto +++ b/pkg/mimirpb/mimir.proto @@ -170,8 +170,9 @@ message BucketSpan { } message FloatHistogramPair { - FloatHistogram histogram = 1 [(gogoproto.nullable) = false]; - int64 timestamp_ms = 2; + // Fields order MUST match promql.HPoint so that we can cast types between them. + int64 timestamp_ms = 1; + FloatHistogram histogram = 2 [(gogoproto.nullable) = true]; } // SampleHistogram is based on https://github.com/prometheus/common/blob/main/model/value_histogram.go From e947167be386484651c2ab7a0c4380a60d46a467 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 09/13] Fix field numbers changing for FloatHistogramPair --- pkg/mimirpb/mimir.pb.go | 285 ++++++++++++++++++++-------------------- pkg/mimirpb/mimir.proto | 4 +- 2 files changed, 144 insertions(+), 145 deletions(-) diff --git a/pkg/mimirpb/mimir.pb.go b/pkg/mimirpb/mimir.pb.go index 135ea1db047..9454abf39db 100644 --- a/pkg/mimirpb/mimir.pb.go +++ b/pkg/mimirpb/mimir.pb.go @@ -1009,8 +1009,8 @@ func (m *BucketSpan) GetLength() uint32 { type FloatHistogramPair struct { // Fields order MUST match promql.HPoint so that we can cast types between them. - TimestampMs int64 `protobuf:"varint,1,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` - Histogram *FloatHistogram `protobuf:"bytes,2,opt,name=histogram,proto3" json:"histogram,omitempty"` + TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + Histogram *FloatHistogram `protobuf:"bytes,1,opt,name=histogram,proto3" json:"histogram,omitempty"` } func (m *FloatHistogramPair) Reset() { *m = FloatHistogramPair{} } @@ -1787,118 +1787,117 @@ func init() { func init() { proto.RegisterFile("mimir.proto", fileDescriptor_86d4d7485f544059) } var fileDescriptor_86d4d7485f544059 = []byte{ - // 1761 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x23, 0x49, - 0x15, 0x76, 0xd9, 0x1d, 0xdb, 0xfd, 0x62, 0x3b, 0xbd, 0xb5, 0xa3, 0xc1, 0x3b, 0xda, 0x71, 0x32, - 0x8d, 0x58, 0x02, 0x02, 0x0f, 0x9a, 0x85, 0x59, 0xed, 0x6a, 0x10, 0xb4, 0x9d, 0x9e, 0x49, 0xb2, - 0x89, 0x1d, 0xca, 0xf6, 0x2c, 0xcb, 0xc5, 0xea, 0x38, 0x95, 0xb8, 0xb5, 0xdd, 0xee, 0xa6, 0xbb, - 0x3d, 0x4c, 0x38, 0x71, 0x01, 0x21, 0x4e, 0x5c, 0xb8, 0x20, 0x6e, 0x1c, 0xe0, 0x2f, 0xe0, 0x6f, - 0x18, 0x09, 0x21, 0xcd, 0x71, 0xc5, 0x61, 0xc4, 0x64, 0x2e, 0x7b, 0xdc, 0x03, 0x27, 0x4e, 0xa8, - 0x5e, 0xf5, 0x0f, 0x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x6a, 0xf8, 0x07, 0x8b, 0x7f, 0x7c, 0x5c, 0xc5, 0xbf, - 0x4a, 0xde, 0xfd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x71, 0xa8, 0x83, 0x88, 0x72, 0x11, 0x00, - 0x00, + // 1758 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x73, 0x1b, 0x49, + 0x15, 0x56, 0x4b, 0x63, 0x49, 0xf3, 0x2c, 0xc9, 0xb3, 0xbd, 0xa9, 0xa0, 0x4d, 0x6d, 0x64, 0x67, + 0x28, 0x16, 0x43, 0x81, 0x42, 0x65, 0x21, 0x5b, 0xbb, 0x15, 0x0a, 0x46, 0xf2, 0x24, 0xb6, 0xd7, + 0x96, 0x4c, 0x4b, 0xca, 0xb2, 0x5c, 0x54, 0x23, 0xb9, 0x6d, 0x4d, 0xed, 0x8c, 0x66, 0x98, 0x19, + 0x85, 0x98, 0x13, 0x17, 0x28, 0x8a, 0x13, 0x17, 0x2e, 0x14, 0x37, 0x0e, 0xf0, 0x17, 0xf0, 0x37, + 0xa4, 0x8a, 0xa2, 0x2a, 0xc7, 0x2d, 0x0e, 0x29, 0xe2, 0x5c, 0xf6, 0x98, 0x03, 0x27, 0x4e, 0x54, + 0xbf, 0x9e, 0x1f, 0x1a, 0xd9, 0x86, 0xc0, 0xfa, 0x36, 0xfd, 0xfa, 0x7b, 0xaf, 0xbf, 0x7e, 0xfd, + 0xf5, 0xd3, 0x6b, 0xc1, 0xba, 0x6b, 0xbb, 0x76, 0xd0, 0xf6, 0x03, 0x2f, 0xf2, 0x68, 0x75, 0xea, + 0x05, 0x11, 0x7f, 0xea, 0x4f, 0x6e, 0x7d, 0xfb, 0xd4, 0x8e, 0x66, 0x8b, 0x49, 0x7b, 0xea, 0xb9, + 0x77, 0x4f, 0xbd, 0x53, 0xef, 0x2e, 0x02, 0x26, 0x8b, 0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7, 0x15, 0x68, + 0x15, 0x14, 0x36, 0x3a, 0x30, 0x35, 0xa2, 0x6f, 0x40, 0x3d, 0x66, 0x1f, 0xfa, 0xde, 0x3c, 0xe4, + 0xfa, 0x3f, 0x09, 0x40, 0x96, 0x1d, 0x6a, 0x40, 0x19, 0x57, 0x4e, 0x72, 0xf8, 0x76, 0x46, 0x1c, + 0xd7, 0x3b, 0xb2, 0xec, 0xa0, 0x73, 0x23, 0x4e, 0x61, 0x0d, 0x4d, 0xc6, 0xb1, 0xe5, 0x47, 0x3c, + 0x60, 0xb1, 0x23, 0xfd, 0x0e, 0x54, 0x42, 0xcb, 0xf5, 0x1d, 0x1e, 0x36, 0x8b, 0x18, 0x43, 0xcb, + 0x62, 0x0c, 0x70, 0x02, 0x37, 0x5d, 0x60, 0x09, 0x8c, 0xde, 0x07, 0x95, 0x3f, 0xe5, 0xae, 0xef, + 0x58, 0x41, 0x18, 0x27, 0x8c, 0x66, 0x3e, 0x66, 0x3c, 0x15, 0x7b, 0x65, 0x50, 0xfa, 0x21, 0xc0, + 0xcc, 0x0e, 0x23, 0xef, 0x34, 0xb0, 0xdc, 0xb0, 0xa9, 0xac, 0x12, 0xde, 0x4d, 0xe6, 0x62, 0xcf, + 0x25, 0xb0, 0xfe, 0x3d, 0x50, 0xd3, 0xfd, 0x50, 0x0a, 0x8a, 0x48, 0x74, 0x93, 0x6c, 0x91, 0xed, + 0x1a, 0xc3, 0x6f, 0x7a, 0x03, 0xd6, 0x9e, 0x58, 0xce, 0x42, 0x9e, 0x7e, 0x8d, 0xc9, 0x81, 0x6e, + 0x40, 0x59, 0x6e, 0x81, 0xde, 0x81, 0x1a, 0x8a, 0x25, 0xb2, 0x5c, 0x7f, 0xec, 0x86, 0x08, 0x2b, + 0xb1, 0xf5, 0xd4, 0x76, 0x18, 0x66, 0x21, 0x44, 0x5c, 0x92, 0x84, 0xf8, 0x7d, 0x11, 0x1a, 0x79, + 0x0d, 0xd0, 0x0f, 0x40, 0x89, 0xce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0xdb, 0xf3, 0x08, 0x8f, 0x5c, + 0xd9, 0x2d, 0xb0, 0x2a, 0x9a, 0xf6, 0xe6, 0x11, 0xbd, 0x03, 0xeb, 0x72, 0xfa, 0xc4, 0xf1, 0xac, + 0x48, 0xae, 0xb5, 0x5b, 0x60, 0x80, 0xc6, 0x87, 0xc2, 0x46, 0x35, 0x28, 0x85, 0x0b, 0x17, 0x57, + 0x22, 0x4c, 0x7c, 0xd2, 0x9b, 0x50, 0x0e, 0xa7, 0x33, 0xee, 0x5a, 0x78, 0xb8, 0x6f, 0xb1, 0x78, + 0x44, 0xbf, 0x06, 0x8d, 0x9f, 0xf3, 0xc0, 0x1b, 0x47, 0xb3, 0x80, 0x87, 0x33, 0xcf, 0x39, 0xc6, + 0x83, 0x26, 0xac, 0x2e, 0xac, 0xc3, 0xc4, 0x48, 0xdf, 0x8b, 0x61, 0x19, 0xaf, 0x32, 0xf2, 0x22, + 0xac, 0x26, 0xec, 0xdd, 0x84, 0xdb, 0x37, 0x41, 0x5b, 0xc2, 0x49, 0x82, 0x15, 0x24, 0x48, 0x58, + 0x23, 0x45, 0x4a, 0x92, 0x06, 0x34, 0xe6, 0xfc, 0xd4, 0x8a, 0xec, 0x27, 0x7c, 0x1c, 0xfa, 0xd6, + 0x3c, 0x6c, 0x56, 0x57, 0xab, 0x72, 0x67, 0x31, 0xfd, 0x8c, 0x47, 0x03, 0xdf, 0x9a, 0xc7, 0x37, + 0xb4, 0x9e, 0x78, 0x08, 0x5b, 0x48, 0xbf, 0x0e, 0x1b, 0x69, 0x88, 0x63, 0xee, 0x44, 0x56, 0xd8, + 0x54, 0xb7, 0x4a, 0xdb, 0x94, 0xa5, 0x91, 0x77, 0xd0, 0x9a, 0x03, 0x22, 0xb7, 0xb0, 0x09, 0x5b, + 0xa5, 0x6d, 0x92, 0x01, 0x91, 0x98, 0x28, 0x6f, 0x0d, 0xdf, 0x0b, 0xed, 0x25, 0x52, 0xeb, 0xff, + 0x9d, 0x54, 0xe2, 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, 0xe2, 0x1b, 0x94, 0xc5, + 0xc2, 0xd2, 0x1d, 0x7e, 0x13, 0x32, 0xe2, 0xf0, 0x52, 0x31, 0x5f, 0xfe, 0x46, 0x7a, 0x93, 0xc3, + 0xeb, 0x00, 0x64, 0x1a, 0xa7, 0xdf, 0x85, 0x72, 0xee, 0xe9, 0x7f, 0x73, 0xf5, 0x26, 0xc4, 0x8f, + 0x7f, 0x49, 0x38, 0xc6, 0xea, 0x7f, 0x20, 0x50, 0x5b, 0x9e, 0xbe, 0x32, 0x29, 0xff, 0xfb, 0x93, + 0xb6, 0x93, 0x13, 0x85, 0xac, 0xf3, 0xef, 0x5e, 0x95, 0x47, 0x7c, 0x7b, 0x5c, 0xd0, 0x45, 0xe7, + 0xfb, 0xcf, 0x5f, 0xb6, 0x0a, 0x9f, 0xbf, 0x6c, 0x15, 0x5e, 0xbf, 0x6c, 0x91, 0x5f, 0x9c, 0xb7, + 0xc8, 0x9f, 0xcf, 0x5b, 0xe4, 0xd9, 0x79, 0x8b, 0x3c, 0x3f, 0x6f, 0x91, 0x7f, 0x9c, 0xb7, 0xc8, + 0x17, 0xe7, 0xad, 0xc2, 0xeb, 0xf3, 0x16, 0xf9, 0xed, 0xab, 0x56, 0xe1, 0xf9, 0xab, 0x56, 0xe1, + 0xf3, 0x57, 0xad, 0xc2, 0x4f, 0x2a, 0xf8, 0x07, 0x8b, 0x3f, 0x99, 0x94, 0xf1, 0xaf, 0x92, 0xf7, + 0xff, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x65, 0xcf, 0xac, 0x82, 0x72, 0x11, 0x00, 0x00, } func (x WriteRequest_SourceEnum) String() string { @@ -4166,6 +4165,11 @@ func (m *FloatHistogramPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TimestampMs != 0 { + i = encodeVarintMimir(dAtA, i, uint64(m.TimestampMs)) + i-- + dAtA[i] = 0x10 + } if m.Histogram != nil { { size, err := m.Histogram.MarshalToSizedBuffer(dAtA[:i]) @@ -4176,12 +4180,7 @@ func (m *FloatHistogramPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMimir(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if m.TimestampMs != 0 { - i = encodeVarintMimir(dAtA, i, uint64(m.TimestampMs)) - i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -5093,13 +5092,13 @@ func (m *FloatHistogramPair) Size() (n int) { } var l int _ = l - if m.TimestampMs != 0 { - n += 1 + sovMimir(uint64(m.TimestampMs)) - } if m.Histogram != nil { l = m.Histogram.Size() n += 1 + l + sovMimir(uint64(l)) } + if m.TimestampMs != 0 { + n += 1 + sovMimir(uint64(m.TimestampMs)) + } return n } @@ -5601,8 +5600,8 @@ func (this *FloatHistogramPair) String() string { return "nil" } s := strings.Join([]string{`&FloatHistogramPair{`, - `TimestampMs:` + fmt.Sprintf("%v", this.TimestampMs) + `,`, `Histogram:` + strings.Replace(this.Histogram.String(), "FloatHistogram", "FloatHistogram", 1) + `,`, + `TimestampMs:` + fmt.Sprintf("%v", this.TimestampMs) + `,`, `}`, }, "") return s @@ -7755,25 +7754,6 @@ func (m *FloatHistogramPair) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimestampMs", wireType) - } - m.TimestampMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimestampMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Histogram", wireType) } @@ -7809,6 +7789,25 @@ func (m *FloatHistogramPair) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimestampMs", wireType) + } + m.TimestampMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMimir + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimestampMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipMimir(dAtA[iNdEx:]) diff --git a/pkg/mimirpb/mimir.proto b/pkg/mimirpb/mimir.proto index ee811f4768c..31d7021e9ba 100644 --- a/pkg/mimirpb/mimir.proto +++ b/pkg/mimirpb/mimir.proto @@ -171,8 +171,8 @@ message BucketSpan { message FloatHistogramPair { // Fields order MUST match promql.HPoint so that we can cast types between them. - int64 timestamp_ms = 1; - FloatHistogram histogram = 2 [(gogoproto.nullable) = true]; + int64 timestamp_ms = 2; + FloatHistogram histogram = 1 [(gogoproto.nullable) = true]; } // SampleHistogram is based on https://github.com/prometheus/common/blob/main/model/value_histogram.go From 0a6e95e7919ade7946cf3db7cd83f2ff1e78e837 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 10/13] Do reflect.TypeOf() in helper function instead --- pkg/mimirpb/compat_test.go | 26 +++++------------------- pkg/mimirpb/query_response_extra_test.go | 6 +----- pkg/util/test/shape.go | 6 +++--- 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index 570d63dfe26..b2b62b88953 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -8,7 +8,6 @@ package mimirpb import ( stdlibjson "encoding/json" "math" - "reflect" "strconv" "testing" "unsafe" @@ -226,10 +225,7 @@ func TestFromFPointsToSamples(t *testing.T) { // Check that Prometheus FPoint and Mimir Sample types converted // into each other with unsafe.Pointer are compatible func TestPrometheusFPointInSyncWithMimirPbSample(t *testing.T) { - protoType := reflect.TypeOf(Sample{}) - prometheusType := reflect.TypeOf(promql.FPoint{}) - - test.RequireSameShape(t, prometheusType, protoType, true) + test.RequireSameShape(t, promql.FPoint{}, Sample{}, true) } func BenchmarkFromFPointsToSamples(b *testing.B) { @@ -257,10 +253,7 @@ func TestFromHPointsToHistograms(t *testing.T) { // Check that Prometheus HPoint and Mimir FloatHistogramPair types converted // into each other with unsafe.Pointer are compatible func TestPrometheusHPointInSyncWithMimirPbFloatHistogramPair(t *testing.T) { - protoType := reflect.TypeOf(FloatHistogramPair{}) - prometheusType := reflect.TypeOf(promql.HPoint{}) - - test.RequireSameShape(t, prometheusType, protoType, true) + test.RequireSameShape(t, promql.HPoint{}, FloatHistogramPair{}, true) } func BenchmarkFromHPointsToHistograms(b *testing.B) { @@ -637,26 +630,17 @@ func TestFromFloatHistogramToPromHistogram(t *testing.T) { // Check that Prometheus and Mimir SampleHistogram types converted // into each other with unsafe.Pointer are compatible func TestPrometheusSampleHistogramInSyncWithMimirPbSampleHistogram(t *testing.T) { - protoType := reflect.TypeOf(SampleHistogram{}) - prometheusType := reflect.TypeOf(model.SampleHistogram{}) - - test.RequireSameShape(t, prometheusType, protoType, false) + test.RequireSameShape(t, model.SampleHistogram{}, SampleHistogram{}, false) } // Check that Prometheus Label and MimirPb LabelAdapter types converted // into each other with unsafe.Pointer are compatible func TestPrometheusLabelsInSyncWithMimirPbLabelAdapter(t *testing.T) { - protoType := reflect.TypeOf(LabelAdapter{}) - prometheusType := reflect.TypeOf(labels.Label{}) - - test.RequireSameShape(t, prometheusType, protoType, false) + test.RequireSameShape(t, labels.Label{}, LabelAdapter{}, false) } // Check that Prometheus histogram.Span and MimirPb BucketSpan types converted // into each other with unsafe.Pointer are compatible func TestPrometheusHistogramSpanInSyncWithMimirPbBucketSpan(t *testing.T) { - protoType := reflect.TypeOf(BucketSpan{}) - prometheusType := reflect.TypeOf(histogram.Span{}) - - test.RequireSameShape(t, prometheusType, protoType, false) + test.RequireSameShape(t, histogram.Span{}, BucketSpan{}, false) } diff --git a/pkg/mimirpb/query_response_extra_test.go b/pkg/mimirpb/query_response_extra_test.go index ad5d145bd70..5795f969b59 100644 --- a/pkg/mimirpb/query_response_extra_test.go +++ b/pkg/mimirpb/query_response_extra_test.go @@ -5,7 +5,6 @@ package mimirpb import ( "os" "path/filepath" - "reflect" "testing" "github.com/grafana/regexp" @@ -78,8 +77,5 @@ func extractPrometheusStrings(t *testing.T, constantType string) []string { // FloatHistogram types converted into each other with unsafe.Pointer // are compatible func TestFloatHistogramProtobufTypeRemainsInSyncWithPrometheus(t *testing.T) { - protoType := reflect.TypeOf(FloatHistogram{}) - prometheusType := reflect.TypeOf(histogram.FloatHistogram{}) - - test.RequireSameShape(t, prometheusType, protoType, false) + test.RequireSameShape(t, histogram.FloatHistogram{}, FloatHistogram{}, false) } diff --git a/pkg/util/test/shape.go b/pkg/util/test/shape.go index a18c700cc36..2afae831ab7 100644 --- a/pkg/util/test/shape.go +++ b/pkg/util/test/shape.go @@ -20,9 +20,9 @@ const ignoredFieldName = "" // but we also check the names are the same here to ensure there's no confusion // (eg. two bool fields swapped) when ignoreName is false. However, when you // know the names are different, you can set ignoreName to true. -func RequireSameShape(t *testing.T, expectedType reflect.Type, actualType reflect.Type, ignoreName bool) { - expectedFormatted := prettyPrintType(expectedType, ignoreName) - actualFormatted := prettyPrintType(actualType, ignoreName) +func RequireSameShape(t *testing.T, expectedType, actualType any, ignoreName bool) { + expectedFormatted := prettyPrintType(reflect.TypeOf(expectedType), ignoreName) + actualFormatted := prettyPrintType(reflect.TypeOf(actualType), ignoreName) require.Equal(t, expectedFormatted, actualFormatted) } From e798d0972c3f1038298ea0e81594e6c699bd6f05 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 11/13] Update tests according to code review --- pkg/mimirpb/compat_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index b2b62b88953..d9357b7c0d9 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -633,14 +633,16 @@ func TestPrometheusSampleHistogramInSyncWithMimirPbSampleHistogram(t *testing.T) test.RequireSameShape(t, model.SampleHistogram{}, SampleHistogram{}, false) } -// Check that Prometheus Label and MimirPb LabelAdapter types converted -// into each other with unsafe.Pointer are compatible +// Check that Prometheus Label and MimirPb LabelAdapter types +// are compatible with https://go.dev/ref/spec#Conversions +// and https://go.dev/ref/spec#Assignability +// More strict than necessary but is checked in compile time. func TestPrometheusLabelsInSyncWithMimirPbLabelAdapter(t *testing.T) { - test.RequireSameShape(t, labels.Label{}, LabelAdapter{}, false) + _ = labels.Label(LabelAdapter{}) } -// Check that Prometheus histogram.Span and MimirPb BucketSpan types converted -// into each other with unsafe.Pointer are compatible +// Check that Prometheus histogram.Span and MimirPb BucketSpan types +// are compatible, same as above. func TestPrometheusHistogramSpanInSyncWithMimirPbBucketSpan(t *testing.T) { - test.RequireSameShape(t, histogram.Span{}, BucketSpan{}, false) + _ = histogram.Span(BucketSpan{}) } From 6366aab3319fe0c4d99d5b223f0ebf2881f27500 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Tue, 16 May 2023 16:54:09 +0800 Subject: [PATCH 12/13] Fix `TestQuerierTenantFederation` integration test that started failing after FloatHistogramPair was changed to use pointers --- pkg/frontend/querymiddleware/codec_protobuf.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/frontend/querymiddleware/codec_protobuf.go b/pkg/frontend/querymiddleware/codec_protobuf.go index e2ce21f9c66..9fd3bfb91fa 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf.go +++ b/pkg/frontend/querymiddleware/codec_protobuf.go @@ -278,6 +278,7 @@ func (f protobufFormatter) decodeVectorData(data *mimirpb.VectorData) (*Promethe } for i, sample := range data.Histograms { + sample := sample l, err := labelsFromStringArray(sample.Metric) if err != nil { return nil, err From ff814ac9f3501aaccc5447b9fa26e44c704742dd Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Thu, 18 May 2023 08:17:43 +0800 Subject: [PATCH 13/13] Revise according to code review --- .../querymiddleware/codec_protobuf.go | 3 +- .../querymiddleware/codec_protobuf_test.go | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pkg/frontend/querymiddleware/codec_protobuf.go b/pkg/frontend/querymiddleware/codec_protobuf.go index 9fd3bfb91fa..42daf4cadf6 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf.go +++ b/pkg/frontend/querymiddleware/codec_protobuf.go @@ -278,7 +278,6 @@ func (f protobufFormatter) decodeVectorData(data *mimirpb.VectorData) (*Promethe } for i, sample := range data.Histograms { - sample := sample l, err := labelsFromStringArray(sample.Metric) if err != nil { return nil, err @@ -289,7 +288,7 @@ func (f protobufFormatter) decodeVectorData(data *mimirpb.VectorData) (*Promethe Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: sample.TimestampMs, - Histogram: &sample.Histogram, + Histogram: &data.Histograms[i].Histogram, }, }, } diff --git a/pkg/frontend/querymiddleware/codec_protobuf_test.go b/pkg/frontend/querymiddleware/codec_protobuf_test.go index 48ebc7cb95b..858460ec675 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf_test.go +++ b/pkg/frontend/querymiddleware/codec_protobuf_test.go @@ -46,6 +46,25 @@ var protobufResponseHistogram = mimirpb.FloatHistogram{ NegativeBuckets: []float64{400, 500, 600, 700}, } +var protobufResponseHistogram2 = mimirpb.FloatHistogram{ + CounterResetHint: histogram.GaugeType, + Schema: 3, + ZeroThreshold: 1.23, + ZeroCount: 556, + Count: 9101, + Sum: 789.1, + PositiveSpans: []mimirpb.BucketSpan{ + {Offset: 4, Length: 1}, + {Offset: 3, Length: 2}, + }, + NegativeSpans: []mimirpb.BucketSpan{ + {Offset: 7, Length: 3}, + {Offset: 9, Length: 1}, + }, + PositiveBuckets: []float64{100, 200, 300}, + NegativeBuckets: []float64{400, 500, 600, 700}, +} + var protobufCodecScenarios = []struct { name string payload mimirpb.QueryResponse @@ -258,6 +277,11 @@ var protobufCodecScenarios = []struct { TimestampMs: 1234, Histogram: protobufResponseHistogram, }, + { + Metric: []string{"baz2", "blah2"}, + TimestampMs: 1234, + Histogram: protobufResponseHistogram2, + }, }, }, }, @@ -275,6 +299,10 @@ var protobufCodecScenarios = []struct { Labels: []mimirpb.LabelAdapter{{Name: "baz", Value: "blah"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, + { + Labels: []mimirpb.LabelAdapter{{Name: "baz2", Value: "blah2"}}, + Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram2}}, + }, }, }, Headers: expectedProtobufResponseHeaders,