From 2822d8729c72e49e0e356fb59bb80af7d25283a7 Mon Sep 17 00:00:00 2001 From: Jiquan Long Date: Thu, 25 Jul 2024 15:43:09 +0800 Subject: [PATCH] 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 --- internal/rootcoord/quota_center.go | 1 + pkg/metrics/rootcoord_metrics.go | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/internal/rootcoord/quota_center.go b/internal/rootcoord/quota_center.go index a1ca015476..9ee6c46b19 100644 --- a/internal/rootcoord/quota_center.go +++ b/internal/rootcoord/quota_center.go @@ -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 diff --git a/pkg/metrics/rootcoord_metrics.go b/pkg/metrics/rootcoord_metrics.go index e50c9bece0..4ff9b8c606 100644 --- a/pkg/metrics/rootcoord_metrics.go +++ b/pkg/metrics/rootcoord_metrics.go @@ -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)