refine grafana metrics for replica selection (#25319)

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
pull/25344/head
wei liu 2023-07-05 17:00:25 +08:00 committed by GitHub
parent efdd71c640
commit 951c312ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -102,7 +102,7 @@ func (b *LookAsideBalancer) SelectNode(ctx context.Context, availableNodes []int
}
score := b.calculateScore(cost, executingNQ.Load())
metrics.ProxyWorkLoadScore.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10)).Observe(score)
metrics.ProxyWorkLoadScore.WithLabelValues(strconv.FormatInt(node, 10)).Set(score)
if targetNode == -1 || score < targetScore {
targetScore = score

View File

@ -249,14 +249,15 @@ var (
}, []string{usernameLabelName})
// ProxyWorkLoadScore record the score that measured query node's workload.
ProxyWorkLoadScore = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
ProxyWorkLoadScore = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: milvusNamespace,
Subsystem: typeutil.ProxyRole,
Name: "workload_score",
Help: "score that measured query node's workload",
Buckets: buckets,
}, []string{nodeIDLabelName})
}, []string{
nodeIDLabelName,
})
)
// RegisterProxy registers Proxy metrics