feat: [2.5]Ignore reporting index metrics for non-existent indexes (#41296)

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
pr:https://github.com/milvus-io/milvus/pull/41294

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
pull/41388/head
Xianhui Lin 2025-04-17 16:28:34 +08:00 committed by GitHub
parent a89b611b2a
commit d54ad6cfc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -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),