未验证 提交 178559a8 编写于 作者: C Cai Yudong 提交者: GitHub

Ignore gather c metrics fail (#23366)

Signed-off-by: NYudong Cai <yudong.cai@zilliz.com>
上级 43a9e175
......@@ -39,14 +39,15 @@ type MilvusRegistry struct {
// Gather implements Gatherer.
func (r *MilvusRegistry) Gather() ([]*dto.MetricFamily, error) {
var res []*dto.MetricFamily
res1, err := r.GoRegistry.Gather()
resGo, err := r.GoRegistry.Gather()
if err != nil {
return res, err
}
res2, err := r.CRegistry.Gather()
resC, err := r.CRegistry.Gather()
if err != nil {
return res, err
// if gather c metrics fail, ignore the error and return go metrics
return resGo, nil
}
res = append(res1, res2...)
res = append(resGo, resC...)
return res, nil
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册