Skip to content

Commit

Permalink
Followups #11154
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacorts committed Nov 10, 2023
1 parent 4248825 commit e7c6382
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/bloomcompactor/bloomcompactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/bloomcompactor/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pkg/bloomcompactor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down

0 comments on commit e7c6382

Please sign in to comment.