Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
7b39873a
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7b39873a
编写于
1月 04, 2023
作者:
Y
yah01
提交者:
GitHub
1月 04, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
limit the frequency of GetMetrics() log (#21514)
Signed-off-by:
N
yah01
<
yang.cen@zilliz.com
>
上级
bf3c0215
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
63 addition
and
84 deletion
+63
-84
internal/datacoord/services.go
internal/datacoord/services.go
+7
-7
internal/datanode/services.go
internal/datanode/services.go
+4
-4
internal/indexcoord/index_coord.go
internal/indexcoord/index_coord.go
+14
-19
internal/indexnode/indexnode_service.go
internal/indexnode/indexnode_service.go
+6
-6
internal/proxy/impl.go
internal/proxy/impl.go
+16
-23
internal/querycoordv2/services.go
internal/querycoordv2/services.go
+1
-1
internal/querynode/impl.go
internal/querynode/impl.go
+6
-6
internal/rootcoord/root_coord.go
internal/rootcoord/root_coord.go
+9
-18
未找到文件。
internal/datacoord/services.go
浏览文件 @
7b39873a
...
...
@@ -860,7 +860,7 @@ func (s *Server) ShowConfigurations(ctx context.Context, req *internalpb.ShowCon
func
(
s
*
Server
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
if
s
.
isClosed
()
{
log
.
Warn
(
"DataCoord.GetMetrics failed"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
errDataCoordIsUnhealthy
(
paramtable
.
GetNodeID
())))
...
...
@@ -877,7 +877,7 @@ func (s *Server) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
req
.
Request
)
if
err
!=
nil
{
log
.
Warn
(
"DataCoord.GetMetrics failed to parse metric type"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
err
))
...
...
@@ -903,10 +903,10 @@ func (s *Server) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest
},
nil
}
log
.
Debug
(
"DataCoord.GetMetrics"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
RatedDebug
(
60
,
"DataCoord.GetMetrics"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric
_t
ype"
,
metricType
),
zap
.
String
(
"metric
T
ype"
,
metricType
),
zap
.
Any
(
"metrics"
,
metrics
),
// TODO(dragondriver): necessary? may be very large
zap
.
Error
(
err
))
...
...
@@ -914,9 +914,9 @@ func (s *Server) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest
}
log
.
RatedWarn
(
60.0
,
"DataCoord.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric
_t
ype"
,
metricType
))
zap
.
String
(
"metric
T
ype"
,
metricType
))
return
&
milvuspb
.
GetMetricsResponse
{
ComponentName
:
metricsinfo
.
ConstructComponentName
(
typeutil
.
DataCoordRole
,
paramtable
.
GetNodeID
()),
...
...
internal/datanode/services.go
浏览文件 @
7b39873a
...
...
@@ -240,7 +240,7 @@ func (node *DataNode) ShowConfigurations(ctx context.Context, req *internalpb.Sh
func
(
node
*
DataNode
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
if
!
node
.
isHealthy
()
{
log
.
Warn
(
"DataNode.GetMetrics failed"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
errDataNodeIsUnhealthy
(
paramtable
.
GetNodeID
())))
...
...
@@ -255,7 +255,7 @@ func (node *DataNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRe
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
req
.
Request
)
if
err
!=
nil
{
log
.
Warn
(
"DataNode.GetMetrics failed to parse metric type"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
err
))
...
...
@@ -282,8 +282,8 @@ func (node *DataNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRe
return
systemInfoMetrics
,
nil
}
log
.
Debug
(
"DataNode.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
RatedWarn
(
60
,
"DataNode.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric_type"
,
metricType
))
...
...
internal/indexcoord/index_coord.go
浏览文件 @
7b39873a
...
...
@@ -967,7 +967,7 @@ func (i *IndexCoord) ShowConfigurations(ctx context.Context, req *internalpb.Sho
// GetMetrics gets the metrics info of IndexCoord.
func
(
i
*
IndexCoord
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
log
.
RatedInfo
(
5
,
"IndexCoord.GetMetrics"
,
zap
.
Int64
(
"nodeID"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
))
log
.
RatedInfo
(
60
,
"IndexCoord.GetMetrics"
,
zap
.
Int64
(
"nodeID"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
))
if
!
i
.
isHealthy
()
{
log
.
Warn
(
msgIndexCoordIsUnhealthy
(
paramtable
.
GetNodeID
()))
...
...
@@ -984,7 +984,7 @@ func (i *IndexCoord) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsReq
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
req
.
Request
)
if
err
!=
nil
{
log
.
Error
(
"IndexCoord.GetMetrics failed to parse metric type"
,
zap
.
Int64
(
"node
id
"
,
i
.
session
.
ServerID
),
zap
.
Int64
(
"node
ID
"
,
i
.
session
.
ServerID
),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
err
))
...
...
@@ -997,35 +997,30 @@ func (i *IndexCoord) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsReq
},
nil
}
log
.
Debug
(
"IndexCoord.GetMetrics"
,
zap
.
String
(
"metric type"
,
metricType
))
if
metricType
==
metricsinfo
.
SystemInfoMetrics
{
ret
,
err
:=
i
.
metricsCacheManager
.
GetSystemInfoMetrics
()
if
err
==
nil
&&
ret
!=
nil
{
return
ret
,
nil
metrics
,
err
:=
i
.
metricsCacheManager
.
GetSystemInfoMetrics
()
if
err
!=
nil
{
// Miss cache
metrics
,
err
=
getSystemInfoMetrics
(
ctx
,
req
,
i
)
}
log
.
Warn
(
"failed to get system info metrics from cache, recompute instead"
,
zap
.
Error
(
err
))
metrics
,
err
:=
getSystemInfoMetrics
(
ctx
,
req
,
i
)
log
.
Debug
(
"IndexCoord.GetMetrics"
,
zap
.
Int64
(
"node
id
"
,
i
.
session
.
ServerID
),
log
.
RatedDebug
(
60
,
"IndexCoord.GetMetrics"
,
zap
.
Int64
(
"node
ID
"
,
i
.
session
.
ServerID
),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric
t
ype"
,
metricType
),
zap
.
String
(
"metric
T
ype"
,
metricType
),
zap
.
String
(
"metrics"
,
metrics
.
Response
),
// TODO(dragondriver): necessary? may be very large
zap
.
Error
(
err
))
zap
.
Error
(
err
),
)
i
.
metricsCacheManager
.
UpdateSystemInfoMetrics
(
metrics
)
return
metrics
,
nil
}
log
.
Warn
(
"IndexCoord.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
id
"
,
i
.
session
.
ServerID
),
log
.
RatedWarn
(
60
,
"IndexCoord.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
ID
"
,
i
.
session
.
ServerID
),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric
t
ype"
,
metricType
))
zap
.
String
(
"metric
T
ype"
,
metricType
))
return
&
milvuspb
.
GetMetricsResponse
{
Status
:
&
commonpb
.
Status
{
...
...
internal/indexnode/indexnode_service.go
浏览文件 @
7b39873a
...
...
@@ -230,7 +230,7 @@ func (i *IndexNode) GetJobStats(ctx context.Context, req *indexpb.GetJobStatsReq
func
(
i
*
IndexNode
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
if
!
commonpbutil
.
IsHealthyOrStopping
(
i
.
stateCode
)
{
log
.
Ctx
(
ctx
)
.
Warn
(
"IndexNode.GetMetrics failed"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
errIndexNodeIsUnhealthy
(
paramtable
.
GetNodeID
())))
...
...
@@ -246,7 +246,7 @@ func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequ
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
req
.
Request
)
if
err
!=
nil
{
log
.
Ctx
(
ctx
)
.
Warn
(
"IndexNode.GetMetrics failed to parse metric type"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
err
))
...
...
@@ -262,8 +262,8 @@ func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequ
if
metricType
==
metricsinfo
.
SystemInfoMetrics
{
metrics
,
err
:=
getSystemInfoMetrics
(
ctx
,
req
,
i
)
log
.
Ctx
(
ctx
)
.
Debug
(
"IndexNode.GetMetrics"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
Ctx
(
ctx
)
.
RatedDebug
(
60
,
"IndexNode.GetMetrics"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric_type"
,
metricType
),
zap
.
Error
(
err
))
...
...
@@ -271,8 +271,8 @@ func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequ
return
metrics
,
nil
}
log
.
Ctx
(
ctx
)
.
Warn
(
"IndexNode.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
Ctx
(
ctx
)
.
RatedWarn
(
60
,
"IndexNode.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric_type"
,
metricType
))
...
...
internal/proxy/impl.go
浏览文件 @
7b39873a
...
...
@@ -3220,13 +3220,13 @@ func (node *Proxy) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsReque
log
:=
log
.
Ctx
(
ctx
)
log
.
Debug
(
"Proxy.GetMetrics"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
RatedDebug
(
60
,
"Proxy.GetMetrics"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
))
if
!
node
.
checkHealthy
()
{
log
.
Warn
(
"Proxy.GetMetrics failed"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
errProxyIsUnhealthy
(
paramtable
.
GetNodeID
())))
...
...
@@ -3242,7 +3242,7 @@ func (node *Proxy) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsReque
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
req
.
Request
)
if
err
!=
nil
{
log
.
Warn
(
"Proxy.GetMetrics failed to parse metric type"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
err
))
...
...
@@ -3255,28 +3255,21 @@ func (node *Proxy) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsReque
},
nil
}
log
.
Debug
(
"Proxy.GetMetrics"
,
zap
.
String
(
"metric_type"
,
metricType
))
req
.
Base
=
commonpbutil
.
NewMsgBase
(
commonpbutil
.
WithMsgType
(
commonpb
.
MsgType_SystemInfo
),
commonpbutil
.
WithMsgID
(
0
),
commonpbutil
.
WithSourceID
(
paramtable
.
GetNodeID
()),
)
if
metricType
==
metricsinfo
.
SystemInfoMetrics
{
ret
,
err
:=
node
.
metricsCacheManager
.
GetSystemInfoMetrics
()
if
err
==
nil
&&
ret
!=
nil
{
return
ret
,
nil
metrics
,
err
:=
node
.
metricsCacheManager
.
GetSystemInfoMetrics
()
if
err
!=
nil
{
metrics
,
err
=
getSystemInfoMetrics
(
ctx
,
req
,
node
)
}
log
.
Debug
(
"failed to get system info metrics from cache, recompute instead"
,
zap
.
Error
(
err
))
metrics
,
err
:=
getSystemInfoMetrics
(
ctx
,
req
,
node
)
log
.
Debug
(
"Proxy.GetMetrics"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
RatedDebug
(
60
,
"Proxy.GetMetrics"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric
_t
ype"
,
metricType
),
zap
.
String
(
"metric
T
ype"
,
metricType
),
zap
.
Any
(
"metrics"
,
metrics
),
// TODO(dragondriver): necessary? may be very large
zap
.
Error
(
err
))
...
...
@@ -3285,10 +3278,10 @@ func (node *Proxy) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsReque
return
metrics
,
nil
}
log
.
Warn
(
"Proxy.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
log
.
RatedWarn
(
60
,
"Proxy.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metric
_t
ype"
,
metricType
))
zap
.
String
(
"metric
T
ype"
,
metricType
))
return
&
milvuspb
.
GetMetricsResponse
{
Status
:
&
commonpb
.
Status
{
...
...
@@ -3306,7 +3299,7 @@ func (node *Proxy) GetProxyMetrics(ctx context.Context, req *milvuspb.GetMetrics
defer
sp
.
Finish
()
log
:=
log
.
Ctx
(
ctx
)
.
With
(
zap
.
Int64
(
"node
_id
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"node
ID
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
))
if
!
node
.
checkHealthy
()
{
...
...
@@ -3355,13 +3348,13 @@ func (node *Proxy) GetProxyMetrics(ctx context.Context, req *milvuspb.GetMetrics
}
log
.
Debug
(
"Proxy.GetProxyMetrics"
,
zap
.
String
(
"metric
_t
ype"
,
metricType
))
zap
.
String
(
"metric
T
ype"
,
metricType
))
return
proxyMetrics
,
nil
}
log
.
Warn
(
"Proxy.GetProxyMetrics failed, request metric type is not implemented yet"
,
zap
.
String
(
"metric
_t
ype"
,
metricType
))
zap
.
String
(
"metric
T
ype"
,
metricType
))
return
&
milvuspb
.
GetMetricsResponse
{
Status
:
&
commonpb
.
Status
{
...
...
internal/querycoordv2/services.go
浏览文件 @
7b39873a
...
...
@@ -550,7 +550,7 @@ func (s *Server) ShowConfigurations(ctx context.Context, req *internalpb.ShowCon
func
(
s
*
Server
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
log
:=
log
.
Ctx
(
ctx
)
log
.
Debug
(
"get metrics request received"
,
log
.
RatedDebug
(
60
,
"get metrics request received"
,
zap
.
String
(
"metricType"
,
req
.
GetRequest
()))
if
s
.
status
.
Load
()
!=
commonpb
.
StateCode_Healthy
{
...
...
internal/querynode/impl.go
浏览文件 @
7b39873a
...
...
@@ -1208,7 +1208,7 @@ func (node *QueryNode) SyncReplicaSegments(ctx context.Context, req *querypb.Syn
func
(
node
*
QueryNode
)
ShowConfigurations
(
ctx
context
.
Context
,
req
*
internalpb
.
ShowConfigurationsRequest
)
(
*
internalpb
.
ShowConfigurationsResponse
,
error
)
{
if
!
node
.
isHealthyOrStopping
()
{
log
.
Warn
(
"QueryNode.ShowConfigurations failed"
,
zap
.
Int64
(
"nodeI
d
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"nodeI
D
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Pattern
),
zap
.
Error
(
errQueryNodeIsUnhealthy
(
paramtable
.
GetNodeID
())))
...
...
@@ -1245,7 +1245,7 @@ func (node *QueryNode) ShowConfigurations(ctx context.Context, req *internalpb.S
func
(
node
*
QueryNode
)
GetMetrics
(
ctx
context
.
Context
,
req
*
milvuspb
.
GetMetricsRequest
)
(
*
milvuspb
.
GetMetricsResponse
,
error
)
{
if
!
node
.
isHealthyOrStopping
()
{
log
.
Ctx
(
ctx
)
.
Warn
(
"QueryNode.GetMetrics failed"
,
zap
.
Int64
(
"nodeI
d
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"nodeI
D
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
errQueryNodeIsUnhealthy
(
paramtable
.
GetNodeID
())))
...
...
@@ -1263,7 +1263,7 @@ func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsR
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
req
.
Request
)
if
err
!=
nil
{
log
.
Ctx
(
ctx
)
.
Warn
(
"QueryNode.GetMetrics failed to parse metric type"
,
zap
.
Int64
(
"nodeI
d
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"nodeI
D
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
Error
(
err
))
...
...
@@ -1279,7 +1279,7 @@ func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsR
queryNodeMetrics
,
err
:=
getSystemInfoMetrics
(
ctx
,
req
,
node
)
if
err
!=
nil
{
log
.
Ctx
(
ctx
)
.
Warn
(
"QueryNode.GetMetrics failed"
,
zap
.
Int64
(
"nodeI
d
"
,
paramtable
.
GetNodeID
()),
zap
.
Int64
(
"nodeI
D
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metricType"
,
metricType
),
zap
.
Error
(
err
))
...
...
@@ -1293,8 +1293,8 @@ func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsR
return
queryNodeMetrics
,
nil
}
log
.
Ctx
(
ctx
)
.
Debug
(
"QueryNode.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"nodeI
d
"
,
paramtable
.
GetNodeID
()),
log
.
Ctx
(
ctx
)
.
RatedDebug
(
60
,
"QueryNode.GetMetrics failed, request metric type is not implemented yet"
,
zap
.
Int64
(
"nodeI
D
"
,
paramtable
.
GetNodeID
()),
zap
.
String
(
"req"
,
req
.
Request
),
zap
.
String
(
"metricType"
,
metricType
))
...
...
internal/rootcoord/root_coord.go
浏览文件 @
7b39873a
...
...
@@ -1479,32 +1479,23 @@ func (c *Core) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest) (
metricType
,
err
:=
metricsinfo
.
ParseMetricType
(
in
.
Request
)
if
err
!=
nil
{
log
.
Warn
(
"ParseMetricType failed"
,
zap
.
String
(
"role"
,
typeutil
.
RootCoordRole
),
zap
.
Int64
(
"node
_id
"
,
c
.
session
.
ServerID
),
zap
.
String
(
"req"
,
in
.
Request
),
zap
.
Error
(
err
))
zap
.
Int64
(
"node
ID
"
,
c
.
session
.
ServerID
),
zap
.
String
(
"req"
,
in
.
Request
),
zap
.
Error
(
err
))
return
&
milvuspb
.
GetMetricsResponse
{
Status
:
failStatus
(
commonpb
.
ErrorCode_UnexpectedError
,
"ParseMetricType failed: "
+
err
.
Error
()),
Response
:
""
,
},
nil
}
log
.
Ctx
(
ctx
)
.
Debug
(
"GetMetrics success"
,
zap
.
String
(
"role"
,
typeutil
.
RootCoordRole
),
zap
.
String
(
"metric_type"
,
metricType
))
if
metricType
==
metricsinfo
.
SystemInfoMetrics
{
ret
,
err
:=
c
.
metricsCacheManager
.
GetSystemInfoMetrics
()
if
err
==
nil
&&
ret
!=
nil
{
return
ret
,
nil
metrics
,
err
:=
c
.
metricsCacheManager
.
GetSystemInfoMetrics
()
if
err
!=
nil
{
metrics
,
err
=
c
.
getSystemInfoMetrics
(
ctx
,
in
)
}
log
.
Warn
(
"GetSystemInfoMetrics from cache failed"
,
zap
.
String
(
"role"
,
typeutil
.
RootCoordRole
),
zap
.
Error
(
err
))
systemInfoMetrics
,
err
:=
c
.
getSystemInfoMetrics
(
ctx
,
in
)
if
err
!=
nil
{
log
.
Warn
(
"GetSystemInfoMetrics failed"
,
zap
.
String
(
"role"
,
typeutil
.
RootCoordRole
),
zap
.
String
(
"metric
_t
ype"
,
metricType
),
zap
.
String
(
"metric
T
ype"
,
metricType
),
zap
.
Error
(
err
))
return
&
milvuspb
.
GetMetricsResponse
{
Status
:
failStatus
(
commonpb
.
ErrorCode_UnexpectedError
,
fmt
.
Sprintf
(
"getSystemInfoMetrics failed: %s"
,
err
.
Error
())),
...
...
@@ -1512,12 +1503,12 @@ func (c *Core) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest) (
},
nil
}
c
.
metricsCacheManager
.
UpdateSystemInfoMetrics
(
systemInfoM
etrics
)
return
systemInfoM
etrics
,
err
c
.
metricsCacheManager
.
UpdateSystemInfoMetrics
(
m
etrics
)
return
m
etrics
,
err
}
log
.
Warn
(
"GetMetrics failed, metric type not implemented"
,
zap
.
String
(
"role"
,
typeutil
.
RootCoordRole
),
zap
.
String
(
"metric
_t
ype"
,
metricType
))
log
.
RatedWarn
(
60
,
"GetMetrics failed, metric type not implemented"
,
zap
.
String
(
"role"
,
typeutil
.
RootCoordRole
),
zap
.
String
(
"metric
T
ype"
,
metricType
))
return
&
milvuspb
.
GetMetricsResponse
{
Status
:
failStatus
(
commonpb
.
ErrorCode_UnexpectedError
,
metricsinfo
.
MsgUnimplementedMetric
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录