diff --git a/pkg/bloomcompactor/bloomcompactor.go b/pkg/bloomcompactor/bloomcompactor.go index f7bcd5df40d38..b517957833a94 100644 --- a/pkg/bloomcompactor/bloomcompactor.go +++ b/pkg/bloomcompactor/bloomcompactor.go @@ -197,7 +197,7 @@ func (c *Compactor) running(ctx context.Context) error { case <-ticker.C: c.metrics.compactionRunsStarted.Inc() if err := c.runCompaction(ctx); err != nil { - c.metrics.compactionRunsErred.Inc() + c.metrics.compactionRunsFailed.Inc() level.Error(c.logger).Log("msg", "failed to run compaction", "err", err) continue } diff --git a/pkg/bloomcompactor/job.go b/pkg/bloomcompactor/job.go index 5257be97095d8..fb8b417f54985 100644 --- a/pkg/bloomcompactor/job.go +++ b/pkg/bloomcompactor/job.go @@ -79,6 +79,13 @@ func (j *Job) Through() model.Time { } func (j *Job) computeFromThrough() { + if len(j.chunks) == 0 { + var zero model.Time + j.from = &zero + j.through = &zero + return + } + minFrom := model.Latest maxThrough := model.Earliest diff --git a/pkg/bloomcompactor/metrics.go b/pkg/bloomcompactor/metrics.go index 0d8ed23c54ed1..9baa7128d25e1 100644 --- a/pkg/bloomcompactor/metrics.go +++ b/pkg/bloomcompactor/metrics.go @@ -13,7 +13,7 @@ const ( type metrics struct { compactionRunsStarted prometheus.Counter compactionRunsCompleted prometheus.Counter - compactionRunsErred prometheus.Counter + compactionRunsFailed prometheus.Counter compactionRunDiscoveredTenants prometheus.Counter compactionRunSkippedTenants prometheus.Counter compactionRunSucceededTenants prometheus.Counter @@ -39,7 +39,7 @@ func newMetrics(r prometheus.Registerer) *metrics { Name: "runs_completed_total", Help: "Total number of compactions completed successfully", }), - compactionRunsErred: promauto.With(r).NewCounter(prometheus.CounterOpts{ + compactionRunsFailed: promauto.With(r).NewCounter(prometheus.CounterOpts{ Namespace: metricsNamespace, Subsystem: metricsSubsystem, Name: "runs_failed_total",