consoles: Escape regexes.

With the new string handling, some regexes need escaping.
This commit is contained in:
Brian Brazil 2015-10-10 17:05:04 +01:00
parent 965a71dc4d
commit f148179ef7
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@
new PromConsole.Graph({ new PromConsole.Graph({
node: document.querySelector("#diskioGraph"), node: document.querySelector("#diskioGraph"),
expr: [ expr: [
"irate(node_disk_io_time_ms{job='node',instance='{{ .Params.instance }}',device!~'^(md\\d+$|dm-)'}[5m]) / 1000 * 100", "irate(node_disk_io_time_ms{job='node',instance='{{ .Params.instance }}',device!~'^(md\\\\d+$|dm-)'}[5m]) / 1000 * 100",
], ],
min: 0, min: 0,
name: '[[ device ]]', name: '[[ device ]]',

View File

@ -35,7 +35,7 @@
<tr> <tr>
<th colspan="2">Disks</th> <th colspan="2">Disks</th>
</tr> </tr>
{{ range printf "node_disk_io_time_ms{job='node',instance='%s',device!~'^(md\\d+$|dm-)'}" .Params.instance | query | sortByLabel "device" }} {{ range printf "node_disk_io_time_ms{job='node',instance='%s',device!~'^(md\\\\d+$|dm-)'}" .Params.instance | query | sortByLabel "device" }}
<tr> <tr>
<td>{{ .Labels.device }} Utilization</td> <td>{{ .Labels.device }} Utilization</td>
<td>{{ template "prom_query_drilldown" (args (printf "irate(node_disk_io_time_ms{job='node',instance='%s',device='%s'}[5m]) / 1000 * 100" .Labels.instance .Labels.device) "%" "printf.1f") }}</td> <td>{{ template "prom_query_drilldown" (args (printf "irate(node_disk_io_time_ms{job='node',instance='%s',device='%s'}[5m]) / 1000 * 100" .Labels.instance .Labels.device) "%" "printf.1f") }}</td>
@ -85,7 +85,7 @@
new PromConsole.Graph({ new PromConsole.Graph({
node: document.querySelector("#diskioGraph"), node: document.querySelector("#diskioGraph"),
expr: [ expr: [
"irate(node_disk_io_time_ms{job='node',instance='{{ .Params.instance }}',device!~'^(md\\d+$|dm-)'}[5m]) / 1000 * 100", "irate(node_disk_io_time_ms{job='node',instance='{{ .Params.instance }}',device!~'^(md\\\\d+$|dm-)'}[5m]) / 1000 * 100",
], ],
min: 0, min: 0,
name: '[[ device ]]', name: '[[ device ]]',