Skip to content

Commit

Permalink
removed stop duration metric replaced it by log
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Le <[email protected]>
  • Loading branch information
alexqyle committed Nov 29, 2023
1 parent 4d081db commit 07a1ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* [CHANGE] Index Cache: Multi level cache backfilling operation becomes async. Added `-blocks-storage.bucket-store.index-cache.multilevel.max-async-concurrency` and `-blocks-storage.bucket-store.index-cache.multilevel.max-async-buffer-size` configs and metric `cortex_store_multilevel_index_cache_backfill_dropped_items_total` for number of dropped items. #5661
* [FEATURE] Ingester: Add per-tenant new metric `cortex_ingester_tsdb_data_replay_duration_seconds`. #5477
* [ENHANCEMENT] Store Gateway: Added `-store-gateway.enabled-tenants` and `-store-gateway.disabled-tenants` to explicitly enable or disable store-gateway for specific tenants. #5638
* [ENHANCEMENT] Compactor: Add compactor start and stop duration in seconds metrics. #5683
* [ENHANCEMENT] Compactor: Add new compactor metric `cortex_compactor_start_duration_seconds`. #5683

## 1.16.0 2023-11-20

Expand Down
8 changes: 2 additions & 6 deletions pkg/compactor/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ type Compactor struct {

// Metrics.
CompactorStartDurationSeconds prometheus.Gauge
CompactorStopDurationSeconds prometheus.Gauge
compactionRunsStarted prometheus.Counter
compactionRunsInterrupted prometheus.Counter
compactionRunsCompleted prometheus.Counter
Expand Down Expand Up @@ -409,10 +408,6 @@ func newCompactor(
Name: "cortex_compactor_start_duration_seconds",
Help: "Time in seconds spent by compactor running start function",
}),
CompactorStopDurationSeconds: promauto.With(registerer).NewGauge(prometheus.GaugeOpts{
Name: "cortex_compactor_stop_duration_seconds",
Help: "Time in seconds spent by compactor running stop function",
}),
compactionRunsStarted: promauto.With(registerer).NewCounter(prometheus.CounterOpts{
Name: "cortex_compactor_runs_started_total",
Help: "Total number of compaction runs started.",
Expand Down Expand Up @@ -498,6 +493,7 @@ func (c *Compactor) starting(ctx context.Context) error {
begin := time.Now()
defer func() {
c.CompactorStartDurationSeconds.Set(time.Since(begin).Seconds())
level.Info(c.logger).Log("msg", "compactor started", "duration", time.Since(begin), "duration_ms", time.Since(begin).Milliseconds())
}()

var err error
Expand Down Expand Up @@ -598,7 +594,7 @@ func (c *Compactor) starting(ctx context.Context) error {
func (c *Compactor) stopping(_ error) error {
begin := time.Now()
defer func() {
c.CompactorStopDurationSeconds.Set(time.Since(begin).Seconds())
level.Info(c.logger).Log("msg", "compactor stopped", "duration", time.Since(begin), "duration_ms", time.Since(begin).Milliseconds())
}()

ctx := context.Background()
Expand Down

0 comments on commit 07a1ede

Please sign in to comment.