feat: record the number of times milvus turns into force-deny-writing states (#34960) (#34989)

/kind improvement
fix: #34961
pr: #34960 

---------

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
This commit is contained in:
Jiquan Long 2024-07-25 15:43:09 +08:00 committed by GitHub
parent 6283fd0b46
commit 2822d8729c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -1569,6 +1569,7 @@ func (q *QuotaCenter) recordMetrics() {
return false
}
metrics.RootCoordQuotaStates.WithLabelValues(errorCode.String(), name).Set(1.0)
metrics.RootCoordForceDenyWritingCounter.Inc()
return false
}
return true

View File

@ -170,6 +170,15 @@ var (
"name",
})
// RootCoordForceDenyWritingCounter records the number of times that milvus turns into force-deny-writing states.
RootCoordForceDenyWritingCounter = prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: milvusNamespace,
Subsystem: typeutil.RootCoordRole,
Name: "force_deny_writing_counter",
Help: "The number of times milvus turns into force-deny-writing states",
})
// RootCoordRateLimitRatio reflects the ratio of rate limit.
RootCoordRateLimitRatio = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
@ -241,6 +250,7 @@ func RegisterRootCoord(registry *prometheus.Registry) {
registry.MustRegister(RootCoordNumOfRoles)
registry.MustRegister(RootCoordTtDelay)
registry.MustRegister(RootCoordQuotaStates)
registry.MustRegister(RootCoordForceDenyWritingCounter)
registry.MustRegister(RootCoordRateLimitRatio)
registry.MustRegister(RootCoordDDLReqLatencyInQueue)