请求Grafana太大的Uri -Kubernetes仪表板

发布于 2025-02-12 01:39:09 字数 338 浏览 1 评论 0原文

我们正在为Kubernetes群集运行近100个实例,并使用Prometheus Server创建Grafana仪表板。要监视磁盘使用情况,以下查询用作

(sum(node_filesystem_size_bytes{instance=~"$Instance"}) - sum(node_filesystem_free_bytes{instance=~"$Instance"})) / sum(node_filesystem_size_bytes{instance=~"$Instance"})

实例IP被替换,我们正在使用近80个实例,我会遇到错误,因为“请求Uri太大”。有人可以帮助解决此问题

We are running nearly 100 instances in Production for kubernetes cluster and using prometheus server to create Grafana dashboard. To monitor the disk usage , below query is used

(sum(node_filesystem_size_bytes{instance=~"$Instance"}) - sum(node_filesystem_free_bytes{instance=~"$Instance"})) / sum(node_filesystem_size_bytes{instance=~"$Instance"})

As Instance ip is getting replaced and we are using nearly 80 instances, I am getting error as "Request URI too large".Can someone help to fix this issue

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伤痕我心 2025-02-19 01:39:09

You only need to specify the instances once and use the

(sum(node_filesystem_size_bytes{instance=~"$Instance"})
  - on(instance) sum(node_filesystem_free_bytes))
/ on(instance) sum(node_filesystem_size_bytes)

请考虑在时间序列中添加统一标签,以便您可以执行... {instance_type ='group--一个“},而不是明确指定实例。

You only need to specify the instances once and use the on matching operator to get their matching series:

(sum(node_filesystem_size_bytes{instance=~"$Instance"})
  - on(instance) sum(node_filesystem_free_bytes))
/ on(instance) sum(node_filesystem_size_bytes)

Consider also adding a unifying label to your time series so you can do something like ...{instance_type="group-A"} instead of explicitly specifying instances.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文