diff --git a/storage/remote/codec.go b/storage/remote/codec.go index 041bdf10e..9b6f5a5ab 100644 --- a/storage/remote/codec.go +++ b/storage/remote/codec.go @@ -528,7 +528,7 @@ func spansProtoToSpans(s []*prompb.BucketSpan) []histogram.Span { return spans } -func histogramToHistogramProto(timestamp int64, h *histogram.Histogram) prompb.Histogram { +func HistogramToHistogramProto(timestamp int64, h *histogram.Histogram) prompb.Histogram { return prompb.Histogram{ Count: &prompb.Histogram_CountInt{CountInt: h.Count}, Sum: h.Sum, diff --git a/storage/remote/codec_test.go b/storage/remote/codec_test.go index 536657733..7d1ba9b5b 100644 --- a/storage/remote/codec_test.go +++ b/storage/remote/codec_test.go @@ -52,7 +52,7 @@ var writeRequestFixture = &prompb.WriteRequest{ }, Samples: []prompb.Sample{{Value: 1, Timestamp: 0}}, Exemplars: []prompb.Exemplar{{Labels: []prompb.Label{{Name: "f", Value: "g"}}, Value: 1, Timestamp: 0}}, - Histograms: []prompb.Histogram{histogramToHistogramProto(0, &testHistogram)}, + Histograms: []prompb.Histogram{HistogramToHistogramProto(0, &testHistogram)}, }, { Labels: []prompb.Label{ @@ -64,7 +64,7 @@ var writeRequestFixture = &prompb.WriteRequest{ }, Samples: []prompb.Sample{{Value: 2, Timestamp: 1}}, Exemplars: []prompb.Exemplar{{Labels: []prompb.Label{{Name: "h", Value: "i"}}, Value: 2, Timestamp: 1}}, - Histograms: []prompb.Histogram{histogramToHistogramProto(1, &testHistogram)}, + Histograms: []prompb.Histogram{HistogramToHistogramProto(1, &testHistogram)}, }, }, } diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index faf27257a..bd5fe9398 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -1397,7 +1397,7 @@ func (s *shards) populateTimeSeries(batch []timeSeries, pendingData []prompb.Tim }) nPendingExemplars++ case tHistogram: - pendingData[nPending].Histograms = append(pendingData[nPending].Histograms, histogramToHistogramProto(d.timestamp, d.histogram)) + pendingData[nPending].Histograms = append(pendingData[nPending].Histograms, HistogramToHistogramProto(d.timestamp, d.histogram)) nPendingHistograms++ } } diff --git a/storage/remote/queue_manager_test.go b/storage/remote/queue_manager_test.go index f6259862e..764e688b3 100644 --- a/storage/remote/queue_manager_test.go +++ b/storage/remote/queue_manager_test.go @@ -701,7 +701,7 @@ func (c *TestWriteClient) expectHistograms(hh []record.RefHistogram, series []re for _, h := range hh { seriesName := getSeriesNameFromRef(series[h.Ref]) - c.expectedHistograms[seriesName] = append(c.expectedHistograms[seriesName], histogramToHistogramProto(h.T, h.H)) + c.expectedHistograms[seriesName] = append(c.expectedHistograms[seriesName], HistogramToHistogramProto(h.T, h.H)) } c.wg.Add(len(hh)) } diff --git a/storage/remote/write_handler_test.go b/storage/remote/write_handler_test.go index 7daa56d02..49cec25da 100644 --- a/storage/remote/write_handler_test.go +++ b/storage/remote/write_handler_test.go @@ -123,7 +123,7 @@ func TestOutOfOrderExemplar(t *testing.T) { func TestOutOfOrderHistogram(t *testing.T) { buf, _, err := buildWriteRequest([]prompb.TimeSeries{{ Labels: []prompb.Label{{Name: "__name__", Value: "test_metric"}}, - Histograms: []prompb.Histogram{histogramToHistogramProto(0, &testHistogram)}, + Histograms: []prompb.Histogram{HistogramToHistogramProto(0, &testHistogram)}, }}, nil, nil, nil) require.NoError(t, err)