diff --git a/internal/rootcoord/quota_center.go b/internal/rootcoord/quota_center.go index f5291bb6e6..d2931ae853 100644 --- a/internal/rootcoord/quota_center.go +++ b/internal/rootcoord/quota_center.go @@ -456,6 +456,7 @@ func (q *QuotaCenter) calculateWriteRates() error { updateCollectionFactor(growingSegFactors) for collection, factor := range collectionFactors { + metrics.RootCoordRateLimitRatio.WithLabelValues(fmt.Sprint(collection)).Set(1 - factor) if factor <= 0 { if _, ok := ttFactors[collection]; ok && factor == ttFactors[collection] { // factor comes from ttFactor diff --git a/pkg/metrics/rootcoord_metrics.go b/pkg/metrics/rootcoord_metrics.go index d29f667b95..1ce0e94a68 100644 --- a/pkg/metrics/rootcoord_metrics.go +++ b/pkg/metrics/rootcoord_metrics.go @@ -169,6 +169,15 @@ var ( "quota_states", }) + // RootCoordRateLimitRatio reflects the ratio of rate limit. + RootCoordRateLimitRatio = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Namespace: milvusNamespace, + Subsystem: typeutil.RootCoordRole, + Name: "rate_limit_ratio", + Help: "", + }, []string{collectionIDLabelName}) + RootCoordDDLReqLatencyInQueue = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Namespace: milvusNamespace, @@ -208,5 +217,6 @@ func RegisterRootCoord(registry *prometheus.Registry) { registry.MustRegister(RootCoordNumOfRoles) registry.MustRegister(RootCoordTtDelay) registry.MustRegister(RootCoordQuotaStates) + registry.MustRegister(RootCoordRateLimitRatio) registry.MustRegister(RootCoordDDLReqLatencyInQueue) }