MCPcopy Create free account
hub / github.com/cortexproject/cortex / checkRunError

Method checkRunError

pkg/compactor/blocks_cleaner.go:305–316  ·  view source on GitHub ↗
(runType string, err error)

Source from the content-addressed store, hash-verified

303}
304
305func (c *BlocksCleaner) checkRunError(runType string, err error) {
306 if err == nil {
307 level.Info(c.logger).Log("msg", fmt.Sprintf("successfully completed blocks cleanup and maintenance for %s users", runType))
308 c.runsCompleted.WithLabelValues(runType).Inc()
309 c.runsLastSuccess.WithLabelValues(runType).SetToCurrentTime()
310 } else if errors.Is(err, context.Canceled) {
311 level.Info(c.logger).Log("msg", fmt.Sprintf("canceled blocks cleanup and maintenance for %s users", runType), "err", err)
312 } else {
313 level.Error(c.logger).Log("msg", fmt.Sprintf("failed to run blocks cleanup and maintenance for %s users", runType), "err", err.Error())
314 c.runsFailed.WithLabelValues(runType).Inc()
315 }
316}
317
318func (c *BlocksCleaner) runEmitPartitionMetricsWorker(ctx context.Context, jobChan <-chan *cleanerJob) {
319 for job := range jobChan {

Callers 3

startingMethod · 0.95
runActiveUserCleanupMethod · 0.95
runDeleteUserCleanupMethod · 0.95

Calls 4

LogMethod · 0.45
IncMethod · 0.45
IsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected