Skip to content

Commit

Permalink
metrics: enlarge upper limits of some duration metrics (#17451) (#17648)
Browse files Browse the repository at this point in the history
* cherry pick #17451 to release-4.0

Signed-off-by: sre-bot <sre-bot@pingcap.com>

* resolve conflicts

Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>

Co-authored-by: Jack Yu <yusp@pingcap.com>
Co-authored-by: Shuaipeng Yu <jackysp@gmail.com>
  • Loading branch information
3 people authored Jun 6, 2020
1 parent cf7467a commit a0ad6f6
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions metrics/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
Subsystem: "ddl",
Name: "handle_job_duration_seconds",
Help: "Bucketed histogram of processing time (s) of handle jobs",
Buckets: prometheus.ExponentialBuckets(0.01, 2, 22), // 10ms ~ 6hours
Buckets: prometheus.ExponentialBuckets(0.01, 2, 24), // 10ms ~ 24hours
}, []string{LblType, LblResult})

BatchAddIdxHistogram = prometheus.NewHistogramVec(
Expand All @@ -40,7 +40,7 @@ var (
Subsystem: "ddl",
Name: "batch_add_idx_duration_seconds",
Help: "Bucketed histogram of processing time (s) of batch handle data",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 22), // 1ms ~ 0.5hours
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
}, []string{LblType})

SyncerInit = "init"
Expand Down Expand Up @@ -91,7 +91,7 @@ var (
Subsystem: "ddl",
Name: "worker_operation_duration_seconds",
Help: "Bucketed histogram of processing time (s) of ddl worker operations",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 22), // 1ms ~ 2048s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
}, []string{LblType, LblAction, LblResult})

CreateDDLInstance = "create_ddl_instance"
Expand Down
2 changes: 1 addition & 1 deletion metrics/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
Subsystem: "distsql",
Name: "handle_query_duration_seconds",
Help: "Bucketed histogram of processing time (s) of handled queries.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 18), // 0.5ms ~ 64s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType, LblSQLType})

DistSQLScanKeysPartialHistogram = prometheus.NewHistogram(
Expand Down
4 changes: 2 additions & 2 deletions metrics/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
Subsystem: "autoid",
Name: "operation_duration_seconds",
Help: "Bucketed histogram of processing time (s) of handled autoid.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 22), // 0.5ms ~ 1048s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType, LblResult})

GetSchemaDiff = "get_schema_diff"
Expand All @@ -43,6 +43,6 @@ var (
Subsystem: "meta",
Name: "operation_duration_seconds",
Help: "Bucketed histogram of processing time (s) of tidb meta data operations.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 22), // 0.5ms ~ 1048s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType, LblResult})
)
2 changes: 1 addition & 1 deletion metrics/oracles.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ var (
Subsystem: "pdclient",
Name: "ts_future_wait_seconds",
Help: "Bucketed histogram of seconds cost for waiting timestamp future.",
Buckets: prometheus.ExponentialBuckets(0.000005, 2, 24), // 5us ~ 40s
Buckets: prometheus.ExponentialBuckets(0.000005, 2, 30), // 5us ~ 2560s
})
)
10 changes: 5 additions & 5 deletions metrics/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
Subsystem: "server",
Name: "handle_query_duration_seconds",
Help: "Bucketed histogram of processing time (s) of handled queries.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 22), // 0.5ms ~ 1048s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblSQLType})

QueryTotalCounter = prometheus.NewCounterVec(
Expand Down Expand Up @@ -128,7 +128,7 @@ var (
Subsystem: "server",
Name: "get_token_duration_seconds",
Help: "Duration (us) for getting token, it should be small until concurrency limit is reached.",
Buckets: prometheus.ExponentialBuckets(1, 2, 26), // 1us ~ 33s
Buckets: prometheus.ExponentialBuckets(1, 2, 30), // 1us ~ 528s
})

TotalQueryProcHistogram = prometheus.NewHistogram(
Expand All @@ -137,23 +137,23 @@ var (
Subsystem: "server",
Name: "slow_query_process_duration_seconds",
Help: "Bucketed histogram of processing time (s) of of slow queries.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 22), // 1ms ~ 2048s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
})
TotalCopProcHistogram = prometheus.NewHistogram(
prometheus.HistogramOpts{
Namespace: "tidb",
Subsystem: "server",
Name: "slow_query_cop_duration_seconds",
Help: "Bucketed histogram of all cop processing time (s) of of slow queries.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 22), // 1ms ~ 2048s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
})
TotalCopWaitHistogram = prometheus.NewHistogram(
prometheus.HistogramOpts{
Namespace: "tidb",
Subsystem: "server",
Name: "slow_query_wait_duration_seconds",
Help: "Bucketed histogram of all cop waiting time (s) of of slow queries.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 22), // 1ms ~ 2048s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
})
)

Expand Down
10 changes: 5 additions & 5 deletions metrics/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (
Subsystem: "session",
Name: "parse_duration_seconds",
Help: "Bucketed histogram of processing time (s) in parse SQL.",
Buckets: prometheus.ExponentialBuckets(0.00004, 2, 22), // 40us ~ 84s
Buckets: prometheus.ExponentialBuckets(0.00004, 2, 28), // 40us ~ 1.5h
}, []string{LblSQLType})
SessionExecuteCompileDuration = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Expand All @@ -32,15 +32,15 @@ var (
Name: "compile_duration_seconds",
Help: "Bucketed histogram of processing time (s) in query optimize.",
// Build plan may execute the statement, or allocate table ID, so it might take a long time.
Buckets: prometheus.ExponentialBuckets(0.00004, 2, 22), // 40us ~ 84s
Buckets: prometheus.ExponentialBuckets(0.00004, 2, 28), // 40us ~ 1.5h
}, []string{LblSQLType})
SessionExecuteRunDuration = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "tidb",
Subsystem: "session",
Name: "execute_duration_seconds",
Help: "Bucketed histogram of processing time (s) in running executor.",
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 22), // 100us ~ 209s
Buckets: prometheus.ExponentialBuckets(0.0001, 2, 30), // 100us ~ 15h
}, []string{LblSQLType})
SchemaLeaseErrorCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Expand Down Expand Up @@ -88,7 +88,7 @@ var (
Subsystem: "session",
Name: "transaction_duration_seconds",
Help: "Bucketed histogram of a transaction execution duration, including retry.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms ~ 524s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
}, []string{LblSQLType, LblType})

StatementDeadlockDetectDuration = prometheus.NewHistogram(
Expand All @@ -97,7 +97,7 @@ var (
Subsystem: "session",
Name: "statement_deadlock_detect_duration_seconds",
Help: "Bucketed histogram of a statement deadlock detect duration.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms ~ 524s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
},
)

Expand Down
2 changes: 1 addition & 1 deletion metrics/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (
Subsystem: "statistics",
Name: "auto_analyze_duration_seconds",
Help: "Bucketed histogram of processing time (s) of auto analyze.",
Buckets: prometheus.ExponentialBuckets(0.01, 2, 20), // 10ms ~ 1.5hours
Buckets: prometheus.ExponentialBuckets(0.01, 2, 24), // 10ms ~ 24h
})

AutoAnalyzeCounter = prometheus.NewCounterVec(
Expand Down
16 changes: 8 additions & 8 deletions metrics/tikvclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (
Subsystem: "tikvclient",
Name: "txn_cmd_duration_seconds",
Help: "Bucketed histogram of processing time of txn cmds.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20), // 0.5ms ~ 262s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType})

TiKVBackoffHistogram = prometheus.NewHistogramVec(
Expand All @@ -32,7 +32,7 @@ var (
Subsystem: "tikvclient",
Name: "backoff_seconds",
Help: "total backoff seconds of a single backoffer.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20), // 0.5ms ~ 262s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType})

TiKVSendReqHistogram = prometheus.NewHistogramVec(
Expand All @@ -41,7 +41,7 @@ var (
Subsystem: "tikvclient",
Name: "request_seconds",
Help: "Bucketed histogram of sending request duration.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20), // 0.5ms ~ 262s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType, LblStore})

TiKVCoprocessorHistogram = prometheus.NewHistogram(
Expand All @@ -50,7 +50,7 @@ var (
Subsystem: "tikvclient",
Name: "cop_duration_seconds",
Help: "Run duration of a single coprocessor task, includes backoff time.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20), // 0.5ms ~ 262s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
})

TiKVLockResolverCounter = prometheus.NewCounterVec(
Expand Down Expand Up @@ -93,7 +93,7 @@ var (
Subsystem: "tikvclient",
Name: "rawkv_cmd_seconds",
Help: "Bucketed histogram of processing time of rawkv cmds.",
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 20), // 0.5ms ~ 262s
Buckets: prometheus.ExponentialBuckets(0.0005, 2, 29), // 0.5ms ~ 1.5days
}, []string{LblType})

TiKVRawkvSizeHistogram = prometheus.NewHistogramVec(
Expand All @@ -102,7 +102,7 @@ var (
Subsystem: "tikvclient",
Name: "rawkv_kv_size_bytes",
Help: "Size of key/value to put, in bytes.",
Buckets: prometheus.ExponentialBuckets(1, 2, 24), // 1Byte ~ 8MB
Buckets: prometheus.ExponentialBuckets(1, 2, 30), // 1Byte ~ 512MB
}, []string{LblType})

TiKVTxnRegionsNumHistogram = prometheus.NewHistogramVec(
Expand All @@ -111,7 +111,7 @@ var (
Subsystem: "tikvclient",
Name: "txn_regions_num",
Help: "Number of regions in a transaction.",
Buckets: prometheus.ExponentialBuckets(1, 2, 20), // 1 ~ 1M
Buckets: prometheus.ExponentialBuckets(1, 2, 25), // 1 ~ 16M
}, []string{LblType})

TiKVLoadSafepointCounter = prometheus.NewCounterVec(
Expand Down Expand Up @@ -187,7 +187,7 @@ var (
Namespace: "tidb",
Subsystem: "tikvclient",
Name: "batch_client_unavailable_seconds",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms ~ 524s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 28), // 1ms ~ 1.5days
Help: "batch client unavailable",
})

Expand Down

0 comments on commit a0ad6f6

Please sign in to comment.