同样情况,楼主解决了吗,求回复!万分感谢
V3.3.2版本所有pod无监控数据
16 天 后
frezesK零S
- 已编辑
问题原因是 kube-state-metrics 指标重复,
found duplicate series for the match group;
many-to-many matching not allowed: matching labels must be unique on one side
具体应该是环境上采集了两份 kube-state-metrics 的指标数据,一份是来自于kubesphere-monitoring-system 的kube-state-metrics, 一份看日志应该是 {service=“tke-kube-state-metrics”}, 所以计算时指标重复冲突,可以根据需求保留一份采集就行。
{
"results": [
{
"metric_name": "pod_net_bytes_received",
"data": {
"resultType": "vector"
}
},
{
"metric_name": "pod_memory_usage_wo_cache",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"namespace": "phm-prod",
"pod": "phm-collect-app-6f44bfbcbc-jnfv7"
},
"value": [
1728699460,
"28292.3984375"
],
"min_value": "",
"max_value": "",
"avg_value": "",
"sum_value": "",
"fee": "",
"resource_unit": "",
"currency_unit": ""
}
]
}
},
{
"metric_name": "pod_cpu_usage",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"namespace": "phm-prod",
"pod": "phm-collect-app-6f44bfbcbc-jnfv7"
},
"value": [
1728699460,
"1.005"
],
"min_value": "",
"max_value": "",
"avg_value": "",
"sum_value": "",
"fee": "",
"resource_unit": "",
"currency_unit": ""
}
]
}
},
{
"metric_name": "pod_net_bytes_transmitted",
"data": {
"resultType": "vector"
}
}
]
}
frezesK零S
将prometheus 的9090 端口设置为nodeport,访问页面,查询下这个表达式
sum by (namespace,pod)(container_memory_working_set_bytes{image!="",job="kubelet",metrics_path="/metrics/cadvisor",pod="prom-agent-k8s-0"})
把这里的 pod="prom-agent-k8s-0"
换成你的pod name, 查询下原始表达式。 后端返回默认不带单位,返回28292,所以会处理为27Ki,但看起来和 top 结果不符合。所以需要查询下原始值。
frezesK零S
看不出来问题在哪? 这是对应查询的PromQL,
https://github.com/kubesphere/kubesphere/blob/release-3.3/pkg/simple/client/monitoring/prometheus/promql.go#L209
你在看下同一时刻的值是否一致? 检查下其他Pod 是否也有类似的情况。
frezes 所有pod都是一样的,显示的都是Ki。
大佬,我还有另一个问题,就是istio的链路追踪缺少组件,其他贴子也有提到,但是没看到具体有用的解决方法,能帮忙看下吗?