enhance: [2.4] Unify InboundLabel case using metrics.Label (#36613) (#36616)

Cherry pick from master
pr: #36613 
Previous label case broken by #36107, this PR make all inbound label
using label constants from metrics package.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2024-09-30 16:19:17 +08:00 committed by GitHub
parent f8dfd0de53
commit 385bfc2639
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2506,7 +2506,7 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest)
tr := timerecord.NewTimeRecorder(method)
metrics.GetStats(ctx).
SetNodeID(paramtable.GetNodeID()).
SetInboundLabel(method).
SetInboundLabel(metrics.InsertLabel).
SetCollectionName(request.GetCollectionName())
metrics.ProxyFunctionCall.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), method, metrics.TotalLabel, request.GetDbName(), request.GetCollectionName()).Inc()
@ -2635,7 +2635,7 @@ func (node *Proxy) Delete(ctx context.Context, request *milvuspb.DeleteRequest)
metrics.GetStats(ctx).
SetNodeID(paramtable.GetNodeID()).
SetInboundLabel(method).
SetInboundLabel(metrics.DeleteLabel).
SetCollectionName(request.GetCollectionName())
if err := merr.CheckHealthy(node.GetStateCode()); err != nil {
@ -2744,7 +2744,7 @@ func (node *Proxy) Upsert(ctx context.Context, request *milvuspb.UpsertRequest)
metrics.GetStats(ctx).
SetNodeID(paramtable.GetNodeID()).
SetInboundLabel(method).
SetInboundLabel(metrics.UpsertLabel).
SetCollectionName(request.GetCollectionName())
metrics.ProxyFunctionCall.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), method, metrics.TotalLabel, request.GetDbName(), request.GetCollectionName()).Inc()