【问题标题】:Understanding Grafana metrics variables了解 Grafana 指标变量
【发布时间】:2021-08-08 21:47:36
【问题描述】:

提供了一些prometheus系列:

query_duration{datname="audit_log", group="grok-pg", instance="docker.for.mac.localhost:9144", job="grok-pg", ts="21-05-19 12:18:10.965"}   14.859
query_duration{datname="audit_log", group="grok-pg", instance="docker.for.mac.localhost:9144", job="grok-pg", ts="21-05-19 12:19:27.603"}   10.082

如果我分配一个特定的值,Grafana 能够识别变量 datname:

但是,如果我将其视为变量,则它不起作用:

我错过了什么?感谢您的关注

【问题讨论】:

  • 你是如何设置变量 $datname 的值的?
  • 我可能错了,但我假设 grafana 的度量字段中的“$datname”变量 -> 将匹配 query_duration{ prometheus 系列中的“datname=”。这个假设是错误的吗?

标签: prometheus grafana grok


【解决方案1】:

$datname 是一个Grafana variable,其值需要由 Grafana 设置,然后再计算表达式并将其发送到 Prometheus 以获取数据。

需要在设置>变量中设置变量。

【讨论】:

    猜你喜欢
    • 2015-06-08
    • 2021-12-17
    • 1970-01-01
    • 2021-07-09
    • 2019-05-02
    • 1970-01-01
    • 2019-10-05
    • 2020-01-19
    相关资源
    最近更新 更多