Grafana内置参数
$__dashboard
当前dashboard的名称
$__from $__to
时间范围的毫秒值
可自定义格式,比如:{$__from: date :YYYY-MM-DD HH:mm:ss} {$__from: date :seconds}
$__interval
查询的时间间隔,包含单位,比如:30s,2m
$__interval_ms
查询的时间间隔,毫秒值
$__range
查询的时间区间大小,包含单位,比如:2d
$__range_s $__range_ms
查询的时间区间大小,分别是秒数和毫秒数
$__timeFilter
返回当前选择的时间范围表达式,比如:time > now() -7d,常用于数据库作为datasource的时候。
Query variable of Prometheus
| Name | Description |
|---|---|
| label_names() | Returns a list of label names. |
| label_values(label) | Returns a list of label values for the label in every metric. |
| label_values(metric{condiation}, label) | Returns a list of label values for the label in the specified metric. 也可以设置label为metric限定范围,且grafana中设置多个参数时支持联动。 |
| metrics(metric) | Returns a list of metrics matching the specified metric regex. |
| query_result(query) | Returns a list of Prometheus query result for the query. |
本文介绍了Grafana中的一些内置参数,如$__dashboard, $__from, $__to等,这些参数用于获取当前dashboard名称和时间范围等信息。同时,也探讨了Prometheus的查询变量,例如$__timeFilter,它用于根据选定时间范围生成过滤表达式,适用于Prometheus数据源的查询操作。"
113558262,10542480,LaTeX 数学模式间距与align环境解析,"['LaTeX', '数学排版', '公式编辑']
3652





