Add rate limit ratio monitoring (#26709)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/26725/head
yihao.dai 2023-09-03 20:47:02 +08:00 committed by GitHub
parent a34a9d606c
commit c6024a32f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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)
}