fix(lint): linter errors

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2024-12-10 16:25:20 +01:00
parent b94c87bea6
commit 8f572fe905
2 changed files with 4 additions and 0 deletions

View file

@ -216,6 +216,7 @@ func TestRecord_EncodeDecode(t *testing.T) {
decGaugeFloatHistograms, err := dec.FloatHistogramSamples(gaugeFloatHistSamples, nil)
require.NoError(t, err)
decCustomBucketsGaugeFloatHistograms, err := dec.FloatHistogramSamples(customBucketsGaugeFloatHistSamples, nil)
require.NoError(t, err)
decGaugeFloatHistograms = append(decGaugeFloatHistograms, decCustomBucketsGaugeFloatHistograms...)
require.Equal(t, floatHistograms, decGaugeFloatHistograms)
}

View file

@ -227,6 +227,9 @@ func Checkpoint(logger *slog.Logger, w *WL, from, to int, keep func(id chunks.He
stats.DroppedSamples += len(histogramSamples) - len(repl)
case record.CustomBucketsHistogramSamples:
histogramSamples, err = dec.HistogramSamples(rec, histogramSamples)
if err != nil {
return nil, fmt.Errorf("decode histogram samples: %w", err)
}
// Drop irrelevant histogramSamples in place.
repl := histogramSamples[:0]
for _, h := range histogramSamples {