Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics,store: add a metric for ttlManager to record the lifetime reach events (#14298) #14300

Merged
merged 3 commits into from
Jan 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,5 @@ func RegisterMetrics() {
prometheus.MustRegister(TiKVTxnHeartBeatHistogram)
prometheus.MustRegister(TiKVPessimisticLockKeysDuration)
prometheus.MustRegister(GRPCConnTransientFailureCounter)
prometheus.MustRegister(TiKVTTLLifeTimeReachCounter)
}
8 changes: 8 additions & 0 deletions metrics/tikvclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,12 @@ var (
Buckets: prometheus.ExponentialBuckets(0.001, 2, 24), // 1ms ~ 16777s
Help: "tidb txn pessimistic lock keys duration",
})

TiKVTTLLifeTimeReachCounter = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: "tidb",
Subsystem: "tikvclient",
Name: "ttl_lifetime_reach_total",
Help: "Counter of ttlManager live too long.",
})
)
1 change: 1 addition & 0 deletions store/tikv/2pc.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ func (tm *ttlManager) keepAlive(c *twoPhaseCommitter) {
// the key will not be locked forever.
logutil.Logger(context.Background()).Info("ttlManager live up to its lifetime",
zap.Uint64("txnStartTS", c.startTS))
metrics.TiKVTTLLifeTimeReachCounter.Inc()
return
}

Expand Down