mirror of
https://github.com/prometheus/prometheus
synced 2024-12-24 07:23:02 +00:00
Increments WAL corruption metric on WAL corruption during checkpointing (#7491)
* Increments wal corruption metric on error during checkpointing Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com> * check for wal corruption error Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
This commit is contained in:
parent
e65e2e0dac
commit
f32307b656
@ -837,6 +837,9 @@ func (h *Head) Truncate(mint int64) (err error) {
|
||||
h.metrics.checkpointCreationTotal.Inc()
|
||||
if _, err = wal.Checkpoint(h.wal, first, last, keep, mint); err != nil {
|
||||
h.metrics.checkpointCreationFail.Inc()
|
||||
if _, ok := errors.Cause(err).(*wal.CorruptionErr); ok {
|
||||
h.metrics.walCorruptionsTotal.Inc()
|
||||
}
|
||||
return errors.Wrap(err, "create checkpoint")
|
||||
}
|
||||
if err := h.wal.Truncate(last + 1); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user