From 51acba7d991dfd353a3ecc992b854c4947b2c26a Mon Sep 17 00:00:00 2001 From: bigsheeper Date: Wed, 2 Nov 2022 10:55:34 +0800 Subject: [PATCH] Add role name to ttDelay metric (#20239) Signed-off-by: bigsheeper Signed-off-by: bigsheeper --- internal/metrics/metrics.go | 2 +- internal/metrics/rootcoord_metrics.go | 1 + internal/rootcoord/quota_center.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index d3599d700c..e7d6cc800f 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -65,7 +65,7 @@ const ( collectionName = "collection_name" segmentStateLabelName = "segment_state" usernameLabelName = "username" - rolenameLabelName = "role_name" + roleNameLabelName = "role_name" cacheNameLabelName = "cache_name" cacheStateLabelName = "cache_state" ) diff --git a/internal/metrics/rootcoord_metrics.go b/internal/metrics/rootcoord_metrics.go index c8e6554068..aeae154329 100644 --- a/internal/metrics/rootcoord_metrics.go +++ b/internal/metrics/rootcoord_metrics.go @@ -142,6 +142,7 @@ var ( Name: "time_tick_delay", Help: "The max time tick delay of flow graphs", }, []string{ + roleNameLabelName, nodeIDLabelName, }) ) diff --git a/internal/rootcoord/quota_center.go b/internal/rootcoord/quota_center.go index a4ea80f1a5..eb00ecec0e 100644 --- a/internal/rootcoord/quota_center.go +++ b/internal/rootcoord/quota_center.go @@ -428,7 +428,7 @@ func (q *QuotaCenter) getTimeTickDelayFactor(ts Timestamp) float64 { vchannel = metric.Fgm.MinFlowGraphChannel minTt = t2 } - metrics.RootCoordTtDelay.WithLabelValues(strconv.FormatInt(nodeID, 10)).Set(float64(curMaxDelay.Milliseconds())) + metrics.RootCoordTtDelay.WithLabelValues(typeutil.QueryNodeRole, strconv.FormatInt(nodeID, 10)).Set(float64(curMaxDelay.Milliseconds())) } } for nodeID, metric := range q.dataNodeMetrics { @@ -441,7 +441,7 @@ func (q *QuotaCenter) getTimeTickDelayFactor(ts Timestamp) float64 { vchannel = metric.Fgm.MinFlowGraphChannel minTt = t2 } - metrics.RootCoordTtDelay.WithLabelValues(strconv.FormatInt(nodeID, 10)).Set(float64(curMaxDelay.Milliseconds())) + metrics.RootCoordTtDelay.WithLabelValues(typeutil.DataNodeRole, strconv.FormatInt(nodeID, 10)).Set(float64(curMaxDelay.Milliseconds())) } }