From c43f8f79442fd7b0963ddaab19c6620a6011fc3b Mon Sep 17 00:00:00 2001 From: Xianhui Lin <35839735+JsDove@users.noreply.github.com> Date: Fri, 18 Apr 2025 10:36:36 +0800 Subject: [PATCH] feat: Ignore reporting index metrics for non-existent indexes (#41294) feat: Ignore reporting index metrics for non-existent indexes Remove the reporting of index metrics for non-existent indexes in the `getCollectionMetrics` function. This change improves the code by skipping unnecessary operations and reduces log noise. issue: https://github.com/milvus-io/milvus/issues/41280 Signed-off-by: Xianhui.Lin --- internal/datacoord/metrics_info.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/datacoord/metrics_info.go b/internal/datacoord/metrics_info.go index 829037cfa0..99355e3b84 100644 --- a/internal/datacoord/metrics_info.go +++ b/internal/datacoord/metrics_info.go @@ -70,6 +70,13 @@ func (s *Server) getCollectionMetrics(ctx context.Context) *metricsinfo.DataCoor IndexName: "", Timestamp: 0, }) + if err == merr.ErrIndexNotFound { + log.Ctx(ctx).Debug("index not found, ignore to report index metrics", + zap.Int64("collection", collectionID), + zap.Error(err), + ) + continue + } if err := merr.CheckRPCCall(indexInfo, err); err != nil { log.Ctx(ctx).Warn("failed to describe index, ignore to report index metrics", zap.Int64("collection", collectionID),