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 <xianhui.lin@zilliz.com>
pull/41395/head
Xianhui Lin 2025-04-18 10:36:36 +08:00 committed by GitHub
parent d50781c8cc
commit c43f8f7944
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),