enhance: Reduce ListImportTasks log content (#28605)

In proxy `ListImportTasks` may print all task information from
rootcoord, this may cause log content too large to process
This PR make this log print taskID and importState only

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/28627/head
congqixia 2023-11-21 20:58:23 +08:00 committed by GitHub
parent faf38ed8dd
commit e47fe4e4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -3954,7 +3954,9 @@ func (node *Proxy) ListImportTasks(ctx context.Context, req *milvuspb.ListImport
log.Debug("successfully received list import tasks response",
zap.String("collection", req.CollectionName),
zap.Any("tasks", resp.Tasks))
zap.Any("tasks", lo.SliceToMap(resp.GetTasks(), func(state *milvuspb.GetImportStateResponse) (int64, commonpb.ImportState) {
return state.GetId(), state.GetState()
})))
metrics.ProxyFunctionCall.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), method, metrics.SuccessLabel).Inc()
metrics.ProxyReqLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), method).Observe(float64(tr.ElapseSpan().Milliseconds()))
return resp, err