【问题标题】:Prometheus + Grafana trouble with templatingPrometheus + Grafana 模板问题
【发布时间】:2017-11-14 11:53:24
【问题描述】:

在 Grafana 中制作模板:

Name - Instance
Query - label_values(instance) 
for recive all instance.
And have reqest example:
sum(machine_cpu_cores) by (instance)

如果 sum(machine_cpu_cores) by (instance=~"$Instance") 我有错误。怎么做对?谢谢。

【问题讨论】:

  • “Prometheus + Grafana”作为标题根本没有描述你的问题。
  • 您没有包含错误消息。

标签: grafana prometheus grafana-templating


【解决方案1】:

您很可能放错了=~ 运算符。

正确的查询应该是这样的:

sum(machine_cpu_cores{instance=~"$Instance"}) by (instance)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-15
    • 2021-08-17
    • 1970-01-01
    • 2018-04-18
    • 2021-10-16
    • 2019-12-07
    • 1970-01-01
    • 2020-11-15
    相关资源
    最近更新 更多