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
close #42515
  • Loading branch information
lcwangchao authored Mar 23, 2023
1 parent 2e8a982 commit f5ca27e
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 @@ -112,6 +112,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 @@ -128,8 +131,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 f5ca27e

Please sign in to comment.