mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
storage: Correctly increase prometheus_local_storage_open_head_chunks
This commit is contained in:
parent
8097a3c523
commit
69eddc9e84
|
@ -927,6 +927,7 @@ func (s *MemorySeriesStorage) Append(sample *model.Sample) error {
|
||||||
s.discardedSamples.WithLabelValues(outOfOrderTimestamp).Inc()
|
s.discardedSamples.WithLabelValues(outOfOrderTimestamp).Inc()
|
||||||
return ErrOutOfOrderSample // Caused by the caller.
|
return ErrOutOfOrderSample // Caused by the caller.
|
||||||
}
|
}
|
||||||
|
headChunkWasClosed := series.headChunkClosed
|
||||||
completedChunksCount, err := series.add(model.SamplePair{
|
completedChunksCount, err := series.add(model.SamplePair{
|
||||||
Value: sample.Value,
|
Value: sample.Value,
|
||||||
Timestamp: sample.Timestamp,
|
Timestamp: sample.Timestamp,
|
||||||
|
@ -935,6 +936,11 @@ func (s *MemorySeriesStorage) Append(sample *model.Sample) error {
|
||||||
s.quarantineSeries(fp, sample.Metric, err)
|
s.quarantineSeries(fp, sample.Metric, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if headChunkWasClosed {
|
||||||
|
// Appending to a series with a closed head chunk creates an
|
||||||
|
// additional open head chunk.
|
||||||
|
s.headChunks.Inc()
|
||||||
|
}
|
||||||
s.ingestedSamples.Inc()
|
s.ingestedSamples.Inc()
|
||||||
s.incNumChunksToPersist(completedChunksCount)
|
s.incNumChunksToPersist(completedChunksCount)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue