Skip to content

Commit

Permalink
ttl: fix TTL cannot export metrics tidb_server_ttl_phase_time (#42517
Browse files Browse the repository at this point in the history
…) (#42524)

close #42515
  • Loading branch information
ti-chi-bot authored Mar 24, 2023
1 parent 7be4869 commit 46597f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ttl/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func InitMetricsVars() {

ScanningTaskCnt = metrics.TTLTaskStatus.With(prometheus.Labels{metrics.LblType: "scanning"})
DeletingTaskCnt = metrics.TTLTaskStatus.With(prometheus.Labels{metrics.LblType: "deleting"})

scanWorkerPhases = initWorkerPhases("scan_worker")
deleteWorkerPhases = initWorkerPhases("delete_worker")
}

func initWorkerPhases(workerType string) map[string]prometheus.Counter {
Expand All @@ -89,8 +92,8 @@ func initWorkerPhases(workerType string) map[string]prometheus.Counter {
}
}

var scanWorkerPhases = initWorkerPhases("scan_worker")
var deleteWorkerPhases = initWorkerPhases("delete_worker")
var scanWorkerPhases map[string]prometheus.Counter
var deleteWorkerPhases map[string]prometheus.Counter

// PhaseTracer is used to tracer the phases duration
type PhaseTracer struct {
Expand Down

0 comments on commit 46597f2

Please sign in to comment.