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

/kind improvement
fix: #34961

---------

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
pull/34956/head
Jiquan Long 2024-07-25 11:39:46 +08:00 committed by GitHub
parent e2f40fc2a8
commit b843c91bad
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)