diff --git a/metrics/ddl.go b/metrics/ddl.go index b44f836d207c3..b36998282c96e 100644 --- a/metrics/ddl.go +++ b/metrics/ddl.go @@ -43,9 +43,9 @@ var ( Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), }) - SyncerInit = "syncer_init" - SyncerRestart = "syncer_restart" - SyncerClear = "syncer_clear" + SyncerInit = "init" + SyncerRestart = "restart" + SyncerClear = "clear" DeploySyncerHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ @@ -78,14 +78,14 @@ var ( }, []string{"op", "result_state"}) // Metrics for ddl_worker.go. - WorkerAddDDLJob = "add_ddl_job" - WorkerFinishDDLJob = "finish_ddl_job" + WorkerAddDDLJob = "add_job" + WorkerFinishDDLJob = "finish_job" WorkerWaitSchemaChanged = "wait_schema_changed" DDLWorkerHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "tidb", Subsystem: "ddl", - Name: "ddl_worker_operation", + Name: "worker_operation_duration_seconds", Help: "Bucketed histogram of processing time (s) of ddl worker operations", Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), }, []string{"op", "result_state"}) @@ -97,7 +97,7 @@ var ( prometheus.CounterOpts{ Namespace: "tidb", Subsystem: "ddl", - Name: "ddl_counter", + Name: "worker_total", Help: "Counter of creating ddl/worker and isowner.", }, []string{"type"}) ) diff --git a/metrics/meta.go b/metrics/meta.go index cc82c50a5806b..2e0e148f8b181 100644 --- a/metrics/meta.go +++ b/metrics/meta.go @@ -20,13 +20,13 @@ import ( // Metrics var ( GlobalAutoID = "global" - TableAutoIDAlloc = "table" - TableAutoIDRebase = "table_rebase" + TableAutoIDAlloc = "alloc" + TableAutoIDRebase = "rebase" AutoIDHistogram = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "tidb", - Subsystem: "meta", - Name: "autoid_alloc", + Subsystem: "autoid", + Name: "operation_duration_seconds", Help: "Bucketed histogram of processing time (s) of handled autoid.", Buckets: prometheus.ExponentialBuckets(0.0005, 2, 22), }, []string{"op", "result_state"}) @@ -41,7 +41,7 @@ var ( prometheus.HistogramOpts{ Namespace: "tidb", Subsystem: "meta", - Name: "meta_opt", + Name: "operation_duration_seconds", Help: "Bucketed histogram of processing time (s) of tidb meta data operations.", Buckets: prometheus.ExponentialBuckets(0.0005, 2, 22), }, []string{"op", "result_state"}) diff --git a/metrics/metrics.go b/metrics/metrics.go index 44641c96b8224..89631a1a42a1f 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -32,11 +32,11 @@ const ( LabelDDL = "ddl" LabelGCWorker = "gcworker" - opSucc = "op_succ" - opFailed = "op_failed" + opSucc = "ok" + opFailed = "err" ) -// RetLabel returns "op_succ" when err == nil and "op_failed" when err != nil. +// RetLabel returns "ok" when err == nil and "err" when err != nil. // This could be useful when you need to observe the operation result. func RetLabel(err error) string { if err == nil { diff --git a/metrics/server.go b/metrics/server.go index 88e99ef13e4d6..1d2c3bf66810d 100644 --- a/metrics/server.go +++ b/metrics/server.go @@ -64,18 +64,18 @@ var ( Help: "Counter of critical errors.", }) - EventStart = "server_start" - EventGracefulDown = "server_graceful_shutdown" + EventStart = "start" + EventGracefulDown = "graceful_shutdown" // Eventkill occurs when the server.Kill() function is called. - EventKill = "server_kill" + EventKill = "kill" // EventHang occurs when server meet some critical error. It will close the listening port and hang for ever. - EventHang = "server_hang" - EventClose = "server_close" + EventHang = "hang" + EventClose = "close" ServerEventCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "tidb", Subsystem: "server", - Name: "server_event", + Name: "event_total", Help: "Counter of tidb-server event.", }, []string{"type"}) )