variables - 多值Prometheus查询Grafana

标签 variables kubernetes prometheus grafana promql

我正在使用Grafana加上Prometheus查询在Grafana中为Kubernetes创建仪表板。我将节点的名称(在本例中为3)作为变量,然后将此值传递给其他查询以提取计算机的IP。提取的值正确。我启用了多值选项。

该问题与查询sum(rate(container_cpu_usage_seconds_total{id="/", instance=~"$ip_test:10250"}[1m]))和不止一个IP有关,因为它只需要其中之一。在其他查询中它可以工作,但我认为这是可能的,因为其他查询在变量后没有:10250

我的问题是,您知道将所有ip:port连接起来的任何方法吗?例如:X.X.X.X:pppp | X.X.X.X:pppp

最佳答案

像这样尝试:
sum(rate(rate(container_cpu_usage_seconds_total {id =“/”,instance =〜“($ ip_test):10250”} [1m]))

关于variables - 多值Prometheus查询Grafana,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61323624/

相关文章:

css - 使用另一个文件中的变量时,.less 文件无法编译

php - 将列拆分为单独的变量

azure - 如何使用 Azure Pipelines 设置 kubernetes 自动缩放(在同一节点中和横向扩展)?

spring-boot - Spring Boot Microservice调用Web API

docker - prometheus 中未公开自定义指标

spring-boot - 在 Spring Boot 中使用 prometheus 自定义指标

JQuery 设置宽度!变量后很重要

javascript - 在 ASP MVC 页面之间传递变量而不将其发送到服务器

docker - 有没有办法在Docketfile中动态传递sqlhost名称

kubernetes - Sumo Logic kubernetes 集成要求不存在 Prometheus