浏览代码

Merge branch 'andrewhowdencom-master'

bergquist 9 年之前
父节点
当前提交
8a8de91a8b
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      docs/sources/features/datasources/prometheus.md

+ 5 - 0
docs/sources/features/datasources/prometheus.md

@@ -72,4 +72,9 @@ label_values(hostname)
 
 
 You can also use raw queries & regular expressions to extract anything you might need.
 You can also use raw queries & regular expressions to extract anything you might need.
 
 
+### Using templated variables in queries
+
+When the `Include All` option or `Multi-Value` option is enabled, Grafana converts the labels from plain text to a regex compatible string. 
+Which means you have to use `=~` instead of `=` in your Prometheus queries. For example `ALERTS{instance=~$instance}` instead of `ALERTS{instance=$instance}`.
+
 ![](/img/v2/prometheus_templating.png)
 ![](/img/v2/prometheus_templating.png)