Skip to content

Commit d54ad6c

Browse files
authored
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: #41280 pr:#41294 Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
1 parent a89b611 commit d54ad6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/datacoord/metrics_info.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ func (s *Server) getCollectionMetrics(ctx context.Context) *metricsinfo.DataCoor
7070
IndexName: "",
7171
Timestamp: 0,
7272
})
73+
if err == merr.ErrIndexNotFound {
74+
log.Ctx(ctx).Debug("index not found, ignore to report index metrics",
75+
zap.Int64("collection", collectionID),
76+
zap.Error(err),
77+
)
78+
continue
79+
}
7380
if err := merr.CheckRPCCall(indexInfo, err); err != nil {
7481
log.Ctx(ctx).Warn("failed to describe index, ignore to report index metrics",
7582
zap.Int64("collection", collectionID),

0 commit comments

Comments
 (0)