diff --git a/pkg/querier/codec/protobuf_codec.go b/pkg/querier/codec/protobuf_codec.go index 78b1d7c58a7..74aa848be87 100644 --- a/pkg/querier/codec/protobuf_codec.go +++ b/pkg/querier/codec/protobuf_codec.go @@ -113,9 +113,9 @@ func getMatrixSampleStreams(data *v1.QueryData) *[]tripperware.SampleStream { } histogramsLen := len(sampleStream.Histograms) - var histograms []tripperware.SampleHistogramPair + var histograms []*tripperware.SampleHistogramPair if histogramsLen > 0 { - histograms = make([]tripperware.SampleHistogramPair, histogramsLen) + histograms = make([]*tripperware.SampleHistogramPair, histogramsLen) for j := 0; j < histogramsLen; j++ { bucketsLen := len(sampleStream.Histograms[j].H.NegativeBuckets) + len(sampleStream.Histograms[j].H.PositiveBuckets) if sampleStream.Histograms[j].H.ZeroCount > 0 { @@ -124,7 +124,7 @@ func getMatrixSampleStreams(data *v1.QueryData) *[]tripperware.SampleStream { buckets := make([]*tripperware.HistogramBucket, bucketsLen) it := sampleStream.Histograms[j].H.AllBucketIterator() getBuckets(buckets, it) - histograms[j] = tripperware.SampleHistogramPair{ + histograms[j] = &tripperware.SampleHistogramPair{ TimestampMs: sampleStream.Histograms[j].T, Histogram: tripperware.SampleHistogram{ Count: sampleStream.Histograms[j].H.Count, diff --git a/pkg/querier/codec/protobuf_codec_test.go b/pkg/querier/codec/protobuf_codec_test.go index 54fa561fd52..09294dc10a5 100644 --- a/pkg/querier/codec/protobuf_codec_test.go +++ b/pkg/querier/codec/protobuf_codec_test.go @@ -239,7 +239,7 @@ func TestProtobufCodec_Encode(t *testing.T) { Labels: []cortexpb.LabelAdapter{ {Name: "__name__", Value: "foo"}, }, - Histograms: []tripperware.SampleHistogramPair{ + Histograms: []*tripperware.SampleHistogramPair{ { TimestampMs: 1000, Histogram: tripperware.SampleHistogram{