为什么 Grafana 中的 Google Cloud Monitoring 面板在每次刷新之间变化很大?

问题描述 投票:0回答:1

我们在 GKE 集群中使用 Google Managed Prometheus。如果可能的话,我想使用 Google Cloud Monitoring Grafana 插件(使用 GMP 作为 Prometheus 数据源本质上需要在某处部署 shim)。使用 PromQL 查询器进行 Google Cloud Monitoring 是可行的,但每次面板重新加载时,我都会得到完全不同的值。这是我正在运行的查询:

sum(increase(some_counter_metric[1y])) / 1000000

这本质上给了我一个数字,但就我而言,它可以从 ~50 摆动到 ~200,然后每 5 秒返回一次。

在 Grafana 中使用 PromQL 和 Google Cloud Monitoring 的其他图表也会出现类似的行为。

google-cloud-platform prometheus grafana promql google-managed-prometheus
1个回答
0
投票

您可以考虑再次检查查询语法是否有拼写错误或不正确的运算符。

云监控通常以比 Prometheus 更粗的分辨率存储数据(默认为 1m)。您也可以尝试将其调整为[5m]或[12m],看是否稳定。另外,云监控按聚合时间段存储数据,可能会丢失一些时间戳。您可以尝试使用插值函数来估计缺失值,例如

linear
holt\_win\_linear.

最后,您可以尝试将Grafana更新到最新。有时更新到最新版本可以解决已知的问题或错误。

© www.soinside.com 2019 - 2024. All rights reserved.