mirror of
https://github.com/prometheus/prometheus.git
synced 2025-10-25 06:21:26 +02:00
Update tsdb/record/record.go
Co-authored-by: Björn Rabenstein <beorn@grafana.com> Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
This commit is contained in:
parent
30f941c57c
commit
35d9f28c87
@ -461,7 +461,7 @@ func (d *Decoder) HistogramSamples(rec []byte, histograms []RefHistogramSample)
|
||||
DecodeHistogram(&dec, rh.H)
|
||||
|
||||
if !histogram.IsKnownSchema(rh.H.Schema) {
|
||||
d.logger.Warn("invalid histogram schema in WAL record", "schema", rh.H.Schema, "timestamp", rh.T)
|
||||
d.logger.Warn("skipping histogram with unknown schema in WAL record", "schema", rh.H.Schema, "timestamp", rh.T)
|
||||
continue
|
||||
}
|
||||
if rh.H.Schema > histogram.ExponentialSchemaMax && rh.H.Schema <= histogram.ExponentialSchemaMaxReserved {
|
||||
@ -565,7 +565,7 @@ func (d *Decoder) FloatHistogramSamples(rec []byte, histograms []RefFloatHistogr
|
||||
DecodeFloatHistogram(&dec, rh.FH)
|
||||
|
||||
if !histogram.IsKnownSchema(rh.FH.Schema) {
|
||||
d.logger.Warn("invalid histogram schema in WAL record", "schema", rh.FH.Schema, "timestamp", rh.T)
|
||||
d.logger.Warn("skipping histogram with unknown schema in WAL record", "schema", rh.FH.Schema, "timestamp", rh.T)
|
||||
continue
|
||||
}
|
||||
if rh.FH.Schema > histogram.ExponentialSchemaMax && rh.FH.Schema <= histogram.ExponentialSchemaMaxReserved {
|
||||
|
||||
@ -256,7 +256,7 @@ func TestRecord_DecodeInvalidHistogramSchema(t *testing.T) {
|
||||
decHistograms, err := dec.HistogramSamples(histSamples, nil)
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, decHistograms)
|
||||
require.Contains(t, output.String(), "invalid histogram schema in WAL record")
|
||||
require.Contains(t, output.String(), "skipping histogram with unknown schema in WAL record")
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -291,7 +291,7 @@ func TestRecord_DecodeInvalidFloatHistogramSchema(t *testing.T) {
|
||||
decHistograms, err := dec.FloatHistogramSamples(histSamples, nil)
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, decHistograms)
|
||||
require.Contains(t, output.String(), "invalid histogram schema in WAL record")
|
||||
require.Contains(t, output.String(), "skipping histogram with unknown schema in WAL record")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user