Merge ~karimsye/charm-grafana:k8s-model-filter-template into ~prometheus-charmers/charm-grafana:master

Proposed by Syed Mohammad Adnan Karim
Status: Work in progress
Proposed branch: ~karimsye/charm-grafana:k8s-model-filter-template
Merge into: ~prometheus-charmers/charm-grafana:master
Diff against target: 562 lines (+127/-6)
2 files modified
reactive/grafana.py (+2/-1)
templates/dashboards/prometheus/Telegraf.json.j2 (+125/-5)
Reviewer Review Type Date Requested Status
Alvaro Uria (community) Needs Fixing
Xav Paice (community) Needs Fixing
Stuart Bishop (community) is-reviews Approve
Chris Sanders (community) Needs Information
BootStack Reviewers mr tracking; do not claim Pending
BootStack Reviewers Pending
BootStack Reviewers Pending
Review via email: mp+366501@code.launchpad.net

Commit message

Add variables to filter k8s clusters by model

Added juju_model variable to Telegraf.json.j2 dashboard template for
filtering k8s clusters by model name. Also renamed "non-juju hosts"
variable to host, and set its value to hostnames that are part of the
selected juju_model variable. Also added {% raw %} and {% endraw %} to
escape jinja's '{{ }}' syntax. This enables the legendFormat variable
to properly display varables such as host.

Description of the change

Add variables to filter k8s clusters by model

Added juju_model variable to Telegraf.json.j2 dashboard template for
filtering k8s clusters by model name. Also renamed "non-juju hosts"
variable to host, and set its value to hostnames that are part of the
selected juju_model variable. Also added {% raw %} and {% endraw %} to
escape jinja's '{{ }}' syntax. This enables the legendFormat variable
to properly display varables such as host.

Example Prometheus target metrics can be found here:
- https://pastebin.canonical.com/p/jRQRf36psn/
- https://pastebin.canonical.com/p/FSMmkBg9bQ/
- https://pastebin.canonical.com/p/CGK6Nz2QJj/

The 'juju_model' variable was derived by using the following in Grafana:
- Query: system_load1{}
- Regex: .*host="([^:]+).*$

The 'non-juju hosts' variable was changed to host and derived using the following in Grafana:
- Query: system_load1{host=~".*^($juju_model).*"}
- Regex: .*host="([^"]+).*

Both variables support multi-value and auto include all selection options.

I also added {% raw %} and {% endraw %} to escape jinja's '{{ }}' syntax.
For example, Jinja will evaluate {{host}} as "" and when the dashboard is imported, it will not render {{host}} in the legend section of the graphs. The escaping enables the "legendFormat" variable to properly display variables such as {{host}} and {{interface}}.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Chris Sanders (chris.sanders) wrote :

This is adding an entirely new dashboard which, as much as I can tell from the .json, is a duplicate of the current Telegraf with some modifications.
 * Is there a reason this isn't a modification of the Telegraf dashboard rather than a new template?
 * Won't this result in *both* dashboards being installed (if they have the same metrics) which we wouldn't want.
 * Assuming you can modify the Telegraf dashboard rather than put a duplicate in the charm, please make minimal changes so the diff is as readable as a json diff can be. It looks like you've run this dashboard through a json formatter that is different from the Telegraf json that Grafana produced. Small changes in white space, with no functional change to the json, only serve to make the diffs harder to read.

Also looking through the template, I notice you used {% raw %} in several places. Why has that been added to the template when it appears to wrap sections that were already present and didn't have it before?

review: Needs Information
Revision history for this message
Syed Mohammad Adnan Karim (karimsye) wrote :

> This is adding an entirely new dashboard which, as much as I can tell from the
> .json, is a duplicate of the current Telegraf with some modifications.
> * Is there a reason this isn't a modification of the Telegraf dashboard
> rather than a new template?
I created the dashboard based on https://grafana.admin.canonical.com/d/000000044/telegraf-host?orgId=1. Acknowledged. I will update the existing Telegraf.json.j2 dashboard to include the changes to filter by model.

> * Won't this result in *both* dashboards being installed (if they have the
> same metrics) which we wouldn't want.
Correct, I will update the existing Telegraf.json.j2 dashboard to include these changes.
I will also remove TelegrafKubernetes.json.j2 dashboard.

> * Assuming you can modify the Telegraf dashboard rather than put a duplicate
> in the charm, please make minimal changes so the diff is as readable as a json
> diff can be. It looks like you've run this dashboard through a json formatter
> that is different from the Telegraf json that Grafana produced. Small changes
> in white space, with no functional change to the json, only serve to make the
> diffs harder to read.
>
Acknowledged.

> Also looking through the template, I notice you used {% raw %} in several
> places. Why has that been added to the template when it appears to wrap
> sections that were already present and didn't have it before?
I used {% raw %} to escape {{ variable_name }} in the legendFormat variable.
Jinja will evaluate it as "" and when the dashboard is imported, it will not render
variable_name (typically {{host}}) in the legend section of the graphs.

de20009... by Syed Mohammad Adnan Karim

Add variables to filter k8s clusters by model

Added juju_model variable to Telegraf.json.j2 dashboard template for
filtering k8s clusters by model name. Also renamed "non-juju hosts"
variable to host, and set its value to hostnames that are part of the
selected juju_model variable. Also added {% raw %} and {% endraw %} to
escape jinja's '{{ }}' syntax. This enables the legendFormat variable
to properly display varables such as host.

Revision history for this message
Stuart Bishop (stub) wrote :

All good from ~canonical-is-reviews, but still needs a signoff from ~prometheus-charmers by someone who can confirm this is what we want and won't make our existing deployments fail.

review: Approve (is-reviews)
Revision history for this message
Chris Sanders (chris.sanders) wrote :

Thanks, the diff is significantly easier to read. I believe this address all of my previous concerns.

The only remaining comment is, with out testing in the charm someone should verify that this branch will still install expected dashboards on a standard non-k8s install. It doesn't look like any metrics actually changed so I think it's safe to say it will be ok.

Syed, can you confirm that there was no change to the metrics, only the new raw values?
Do you by chance already try this on an openstack w/o K8s to see that it still works as previously expected?

Revision history for this message
Syed Mohammad Adnan Karim (karimsye) wrote :

> Thanks, the diff is significantly easier to read. I believe this address all
> of my previous concerns.

No problem.

> The only remaining comment is, with out testing in the charm someone should
> verify that this branch will still install expected dashboards on a standard
> non-k8s install. It doesn't look like any metrics actually changed so I think
> it's safe to say it will be ok.
>
> Syed, can you confirm that there was no change to the metrics, only the new
> raw values?

Yes I can confirm that is the case.

> Do you by chance already try this on an openstack w/o K8s to see that it still
> works as previously expected?

I did not test it on openstack w/o k8s yet but I can give that a go and report mt findings.

Revision history for this message
Syed Mohammad Adnan Karim (karimsye) wrote :

I can confirm that on openstack deployments w/o k8s, the graphs work as expected, the only differences are in the Telegraf Host Metrics Dashboard. The diffrence is that now filtering by juju models is possible, and that unit hostnames show up properly on the legend of the graphs.

I saved screenshots comparing the changes between my update and the charmstore's version 28:
https://drive.google.com/drive/folders/19gr2loO2k3LEk3jfp8Pae3l5yAhBVtQZ?usp=sharing
https://drive.google.com/drive/folders/14KBXkFpTIDqdDt1u-8Nql7ugAHU4Vn9t?usp=sharing

Revision history for this message
Xav Paice (xavpaice) wrote :

Thanks for this work.

Please note that the charm-grafana code has moved to https://code.launchpad.net/~llama-charmers/charm-grafana/+git/charm-grafana/+ref/master and this change should be rebased against that, then re-submitted.

review: Needs Fixing
Revision history for this message
Alvaro Uria (aluria) wrote :

Moved the MP to WIP status because charm-grafana is now under ~llama-charmers namespace and charm-telegraf is the one maintaining the dashboard that will be pushed to grafana via the grafana-dashboards interface.

review: Needs Fixing

Unmerged commits

de20009... by Syed Mohammad Adnan Karim

Add variables to filter k8s clusters by model

Added juju_model variable to Telegraf.json.j2 dashboard template for
filtering k8s clusters by model name. Also renamed "non-juju hosts"
variable to host, and set its value to hostnames that are part of the
selected juju_model variable. Also added {% raw %} and {% endraw %} to
escape jinja's '{{ }}' syntax. This enables the legendFormat variable
to properly display varables such as host.

2dad259... by Syed Mohammad Adnan Karim

Add dashboard for filtering k8s clusters by model

Exisiting Telegraf.json.j2 dashboard only filters by unit name, making
it difficult to monitor multiple k8s clusters. Added dashboard called
TelegrafKubernetes.json.j2 to templates/dashboards/prometheus/ for
filtering k8s clusters by model and unit names. The dashboard uses
juju_model and juju_unit variables to achieve this. These variables
use regex to parse the hostname coming from a Prometheus data source.
The variables juju_model and juju_unit have been added to the
ignore_metrics variable because they are not real Prometheus metrics.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/grafana.py b/reactive/grafana.py
2index f98e11c..2ceb441 100644
3--- a/reactive/grafana.py
4+++ b/reactive/grafana.py
5@@ -522,7 +522,8 @@ def generate_prometheus_dashboards(gf_adminpasswd, ds):
6 ignore_metrics = ['by_cloud_status', 'group_left', 'count_values',
7 'nova_service_status', 'hypervisor_hostname', 'external_network',
8 'ip_type', 'instance_state', 'network_name', 'subnet_name',
9- 'ip_status', 'neutron_net', config['external_network']
10+ 'ip_status', 'neutron_net', config['external_network'],
11+ 'juju_model'
12 ]
13 prom_metrics.extend(ignore_metrics)
14 for filename in os.listdir(templates_dir):
15diff --git a/templates/dashboards/prometheus/Telegraf.json.j2 b/templates/dashboards/prometheus/Telegraf.json.j2
16index a58f03e..8e7f071 100644
17--- a/templates/dashboards/prometheus/Telegraf.json.j2
18+++ b/templates/dashboards/prometheus/Telegraf.json.j2
19@@ -202,7 +202,9 @@
20 "expr": "system_load1{host=~\"$host\"}",
21 "format": "time_series",
22 "intervalFactor": 2,
23+ {% raw %}
24 "legendFormat": "{{host}} 1min",
25+ {% endraw %}
26 "refId": "A",
27 "step": 2
28 },
29@@ -210,7 +212,9 @@
30 "expr": "system_load5{host=~\"$host\"}",
31 "format": "time_series",
32 "intervalFactor": 2,
33+ {% raw %}
34 "legendFormat": "{{host}} 5min",
35+ {% endraw %}
36 "refId": "B",
37 "step": 2
38 },
39@@ -218,7 +222,9 @@
40 "expr": "system_load15{host=~\"$host\"}",
41 "format": "time_series",
42 "intervalFactor": 2,
43+ {% raw %}
44 "legendFormat": "{{host}} 15min",
45+ {% endraw %}
46 "refId": "C",
47 "step": 2
48 }
49@@ -296,7 +302,9 @@
50 "expr": "mem_used{host=~\"$host\"}",
51 "format": "time_series",
52 "intervalFactor": 2,
53+ {% raw %}
54 "legendFormat": "Used {{host}}",
55+ {% endraw %}
56 "refId": "A",
57 "step": 2
58 },
59@@ -304,7 +312,9 @@
60 "expr": "mem_buffered{host=~\"$host\"} + mem_cached{host=~\"$host\"}",
61 "format": "time_series",
62 "intervalFactor": 2,
63+ {% raw %}
64 "legendFormat": "Buffers+cache {{host}}",
65+ {% endraw %}
66 "refId": "B",
67 "step": 2
68 },
69@@ -312,7 +322,9 @@
70 "expr": "mem_free{host=~\"$host\"}",
71 "format": "time_series",
72 "intervalFactor": 2,
73+ {% raw %}
74 "legendFormat": "Free {{host}}",
75+ {% endraw %}
76 "refId": "C",
77 "step": 2
78 }
79@@ -394,7 +406,9 @@
80 "expr": "cpu_usage_user{cpu=\"cpu-total\",host=~\"$host\"}",
81 "format": "time_series",
82 "intervalFactor": 2,
83+ {% raw %}
84 "legendFormat": "user {{host}}",
85+ {% endraw %}
86 "refId": "A",
87 "step": 2
88 },
89@@ -402,7 +416,9 @@
90 "expr": "cpu_usage_iowait{cpu=\"cpu-total\", host=~\"$host\"}",
91 "format": "time_series",
92 "intervalFactor": 2,
93+ {% raw %}
94 "legendFormat": "iowait {{host}}",
95+ {% endraw %}
96 "refId": "C",
97 "step": 2
98 },
99@@ -410,7 +426,9 @@
100 "expr": "cpu_usage_nice{cpu=\"cpu-total\", host=~\"$host\"}",
101 "format": "time_series",
102 "intervalFactor": 2,
103+ {% raw %}
104 "legendFormat": "nice {{host}}",
105+ {% endraw %}
106 "refId": "D",
107 "step": 2
108 },
109@@ -418,7 +436,9 @@
110 "expr": "cpu_usage_softirq{cpu=\"cpu-total\",host=~\"$host\"}",
111 "format": "time_series",
112 "intervalFactor": 2,
113+ {% raw %}
114 "legendFormat": "softirq {{host}}",
115+ {% endraw %}
116 "refId": "E",
117 "step": 2
118 },
119@@ -426,7 +446,9 @@
120 "expr": "cpu_usage_irq{cpu=\"cpu-total\", host=~\"$host\"}",
121 "format": "time_series",
122 "intervalFactor": 2,
123+ {% raw %}
124 "legendFormat": "irq {{host}}",
125+ {% endraw %}
126 "refId": "F",
127 "step": 2
128 },
129@@ -434,7 +456,9 @@
130 "expr": "cpu_usage_system{cpu=\"cpu-total\", host=~\"$host\"}",
131 "format": "time_series",
132 "intervalFactor": 2,
133+ {% raw %}
134 "legendFormat": "system {{host}}",
135+ {% endraw %}
136 "refId": "G",
137 "step": 2
138 },
139@@ -442,7 +466,9 @@
140 "expr": "cpu_usage_idle{cpu=\"cpu-total\", host=~\"$host\"}",
141 "format": "time_series",
142 "intervalFactor": 2,
143+ {% raw %}
144 "legendFormat": "idle {{host}}",
145+ {% endraw %}
146 "refId": "B",
147 "step": 2
148 }
149@@ -522,7 +548,9 @@
150 "expr": "system_n_users{host=~\"$host\"}",
151 "format": "time_series",
152 "intervalFactor": 2,
153+ {% raw %}
154 "legendFormat": "Users {{host}}",
155+ {% endraw %}
156 "refId": "A",
157 "step": 2
158 }
159@@ -600,7 +628,9 @@
160 "expr": "rate(swap_in{host=~\"$host\"}[2m])",
161 "format": "time_series",
162 "intervalFactor": 2,
163+ {% raw %}
164 "legendFormat": "Swap in {{host}}",
165+ {% endraw %}
166 "refId": "A",
167 "step": 2
168 },
169@@ -608,7 +638,9 @@
170 "expr": "rate(swap_out{host=~\"$host\"}[2m])",
171 "format": "time_series",
172 "intervalFactor": 2,
173+ {% raw %}
174 "legendFormat": "Swap out {{host}}",
175+ {% endraw %}
176 "refId": "B",
177 "step": 2
178 }
179@@ -713,7 +745,9 @@
180 "expr": "netstat_tcp_established{host=~\"$host\"}",
181 "format": "time_series",
182 "intervalFactor": 2,
183+ {% raw %}
184 "legendFormat": "Established {{host}}",
185+ {% endraw %}
186 "refId": "A",
187 "step": 4
188 },
189@@ -721,7 +755,9 @@
190 "expr": "netstat_tcp_syn_sent{host=~\"$host\"}",
191 "format": "time_series",
192 "intervalFactor": 2,
193+ {% raw %}
194 "legendFormat": "Syn sent {{host}}",
195+ {% endraw %}
196 "refId": "B",
197 "step": 4
198 },
199@@ -729,7 +765,9 @@
200 "expr": "netstat_tcp_syn_recv{host=~\"$host\"}",
201 "format": "time_series",
202 "intervalFactor": 2,
203+ {% raw %}
204 "legendFormat": "Syn recv {{host}}",
205+ {% endraw %}
206 "refId": "C",
207 "step": 4
208 },
209@@ -737,7 +775,9 @@
210 "expr": "netstat_tcp_fin_wait1{host=~\"$host\"}",
211 "format": "time_series",
212 "intervalFactor": 2,
213+ {% raw %}
214 "legendFormat": "Fin wait1 {{host}}",
215+ {% endraw %}
216 "refId": "D",
217 "step": 4
218 },
219@@ -745,7 +785,9 @@
220 "expr": "netstat_tcp_fin_wait2{host=~\"$host\"}",
221 "format": "time_series",
222 "intervalFactor": 2,
223+ {% raw %}
224 "legendFormat": "Fin wait2 {{host}}",
225+ {% endraw %}
226 "refId": "E",
227 "step": 4
228 },
229@@ -753,7 +795,9 @@
230 "expr": "netstat_tcp_time_wait{host=~\"$host\"}",
231 "format": "time_series",
232 "intervalFactor": 2,
233+ {% raw %}
234 "legendFormat": "Time wait {{host}}",
235+ {% endraw %}
236 "refId": "F",
237 "step": 4
238 },
239@@ -761,7 +805,9 @@
240 "expr": "netstat_tcp_close{host=~\"$host\"}",
241 "format": "time_series",
242 "intervalFactor": 2,
243+ {% raw %}
244 "legendFormat": "Close {{host}}",
245+ {% endraw %}
246 "refId": "G",
247 "step": 4
248 },
249@@ -769,7 +815,9 @@
250 "expr": "netstat_tcp_close_wait{host=~\"$host\"}",
251 "format": "time_series",
252 "intervalFactor": 2,
253+ {% raw %}
254 "legendFormat": "Close wait {{host}}",
255+ {% endraw %}
256 "refId": "H",
257 "step": 4
258 },
259@@ -777,7 +825,9 @@
260 "expr": "netstat_tcp_last_ack{host=~\"$host\"}",
261 "format": "time_series",
262 "intervalFactor": 2,
263+ {% raw %}
264 "legendFormat": "Last ack {{host}}",
265+ {% endraw %}
266 "refId": "I",
267 "step": 4
268 },
269@@ -785,7 +835,9 @@
270 "expr": "netstat_tcp_listen{host=~\"$host\"}",
271 "format": "time_series",
272 "intervalFactor": 2,
273+ {% raw %}
274 "legendFormat": "Listen {{host}}",
275+ {% endraw %}
276 "refId": "J",
277 "step": 4
278 },
279@@ -793,7 +845,9 @@
280 "expr": "netstat_tcp_closing{host=~\"$host\"}",
281 "format": "time_series",
282 "intervalFactor": 2,
283+ {% raw %}
284 "legendFormat": "Closing {{host}}",
285+ {% endraw %}
286 "refId": "K",
287 "step": 4
288 },
289@@ -801,7 +855,9 @@
290 "expr": "netstat_tcp_none{host=~\"$host\"}",
291 "format": "time_series",
292 "intervalFactor": 2,
293+ {% raw %}
294 "legendFormat": "None {{host}}",
295+ {% endraw %}
296 "refId": "L",
297 "step": 4
298 }
299@@ -897,7 +953,9 @@
300 "instant": false,
301 "interval": "1m",
302 "intervalFactor": 2,
303+ {% raw %}
304 "legendFormat": "In {{host}} {{interface}}",
305+ {% endraw %}
306 "metric": "net_by",
307 "refId": "A",
308 "step": 4
309@@ -908,7 +966,9 @@
310 "hide": false,
311 "interval": "1m",
312 "intervalFactor": 2,
313+ {% raw %}
314 "legendFormat": "Out {{host}} {{interface}}",
315+ {% endraw %}
316 "refId": "B",
317 "step": 4
318 }
319@@ -991,7 +1051,9 @@
320 "expr": "rate(net_packets_recv{host=~\"$host\",interface=~\"^bond.*|^eth.*|^en.*\"}[5m])",
321 "format": "time_series",
322 "intervalFactor": 2,
323+ {% raw %}
324 "legendFormat": "In {{interface}} {{host}}",
325+ {% endraw %}
326 "refId": "A",
327 "step": 4
328 },
329@@ -999,7 +1061,9 @@
330 "expr": "rate(net_packets_sent{host=~\"$host\",interface=~\"^bond.*|^eth.*|^en.*\"}[5m])",
331 "format": "time_series",
332 "intervalFactor": 2,
333+ {% raw %}
334 "legendFormat": "Out {{interface}} {{host}}",
335+ {% endraw %}
336 "refId": "B",
337 "step": 4
338 },
339@@ -1007,7 +1071,9 @@
340 "expr": "rate(net_drop_in{host=~\"$host\",interface=~\"^bond.*|^eth.*|^en.*\"}[5m])",
341 "format": "time_series",
342 "intervalFactor": 2,
343+ {% raw %}
344 "legendFormat": "Drop In {{interface}} {{host}}",
345+ {% endraw %}
346 "refId": "C",
347 "step": 4
348 },
349@@ -1015,7 +1081,9 @@
350 "expr": "rate(net_drop_out{host=~\"$host\",interface=~\"^bond.*|^eth.*|^en.*\"}[5m])",
351 "format": "time_series",
352 "intervalFactor": 2,
353+ {% raw %}
354 "legendFormat": "Drop Out {{interface}} {{host}}",
355+ {% endraw %}
356 "refId": "D",
357 "step": 4
358 }
359@@ -1096,7 +1164,9 @@
360 "format": "time_series",
361 "interval": "",
362 "intervalFactor": 2,
363+ {% raw %}
364 "legendFormat": "Err in {{interface}} {{host}}",
365+ {% endraw %}
366 "metric": "net_err_in",
367 "refId": "A",
368 "step": 4
369@@ -1105,7 +1175,9 @@
370 "expr": "rate(net_err_out{host=~\"$host\",interface=~\"^bond.*|^eth.*|^en.*|^br.*\"}[5m])",
371 "format": "time_series",
372 "intervalFactor": 2,
373+ {% raw %}
374 "legendFormat": "Err out {{interface}} {{host}}",
375+ {% endraw %}
376 "metric": "net_d",
377 "refId": "B",
378 "step": 4
379@@ -1115,7 +1187,9 @@
380 "format": "time_series",
381 "interval": "",
382 "intervalFactor": 2,
383+ {% raw %}
384 "legendFormat": "Drop in {{interface}} {{host}}",
385+ {% endraw %}
386 "refId": "C",
387 "step": 4
388 },
389@@ -1123,7 +1197,9 @@
390 "expr": "rate(net_drop_in{host=~\"$host\",interface=~\"^bond.*|^eth.*|^en.*|^br.*\"}[5m])",
391 "format": "time_series",
392 "intervalFactor": 2,
393+ {% raw %}
394 "legendFormat": "Drop out {{interface}} {{host}}",
395+ {% endraw %}
396 "refId": "D",
397 "step": 4
398 }
399@@ -1206,7 +1282,9 @@
400 "instant": false,
401 "interval": "1m",
402 "intervalFactor": 2,
403+ {% raw %}
404 "legendFormat": "{{host}} - {{bond}} - {{interface}}",
405+ {% endraw %}
406 "metric": "bond_slave_failures",
407 "refId": "A",
408 "step": 4
409@@ -1286,7 +1364,9 @@
410 "format": "time_series",
411 "interval": "",
412 "intervalFactor": 2,
413+ {% raw %}
414 "legendFormat": "{{host}} - {{interface}}",
415+ {% endraw %}
416 "metric": "bond_slave_status",
417 "refId": "A",
418 "step": 4
419@@ -1365,7 +1445,9 @@
420 "format": "time_series",
421 "interval": "",
422 "intervalFactor": 2,
423+ {% raw %}
424 "legendFormat": "{{host}} - {{bond}}",
425+ {% endraw %}
426 "metric": "",
427 "refId": "A",
428 "step": 4
429@@ -1462,7 +1544,9 @@
430 "expr": "irate(diskio_reads{name=~\"bcache.*|[a-z]+\",host=~\"$host\"}[2m])",
431 "format": "time_series",
432 "intervalFactor": 2,
433+ {% raw %}
434 "legendFormat": "{{host}} {{name}}",
435+ {% endraw %}
436 "refId": "B",
437 "step": 2
438 }
439@@ -1543,7 +1627,9 @@
440 "expr": "irate(diskio_writes{name=~\"bcache.*|[a-z]+\",host=~\"$host\"}[2m])",
441 "format": "time_series",
442 "intervalFactor": 2,
443+ {% raw %}
444 "legendFormat": "{{host}} {{name}}",
445+ {% endraw %}
446 "refId": "B",
447 "step": 2
448 }
449@@ -1624,7 +1710,9 @@
450 "expr": "irate(diskio_read_bytes{name=~\"bcache.*|[a-z]+\",host=~\"$host\"}[2m])",
451 "format": "time_series",
452 "intervalFactor": 2,
453+ {% raw %}
454 "legendFormat": "{{host}} {{name}}",
455+ {% endraw %}
456 "refId": "B",
457 "step": 2
458 }
459@@ -1705,7 +1793,9 @@
460 "expr": "irate(diskio_write_bytes{name=~\"bcache.*|[a-z]+\",host=~\"$host\"}[2m])",
461 "format": "time_series",
462 "intervalFactor": 2,
463+ {% raw %}
464 "legendFormat": "{{host}} {{name}}",
465+ {% endraw %}
466 "refId": "B",
467 "step": 2
468 }
469@@ -1797,7 +1887,9 @@
470 "format": "time_series",
471 "interval": "",
472 "intervalFactor": 2,
473+ {% raw %}
474 "legendFormat": "{{host}} {{bcache_dev}}/{{backing_dev}}",
475+ {% endraw %}
476 "metric": "bcache_dirty_data",
477 "refId": "A",
478 "step": 4
479@@ -1877,7 +1969,9 @@
480 "format": "time_series",
481 "interval": "",
482 "intervalFactor": 2,
483+ {% raw %}
484 "legendFormat": "{{host}} {{bcache_dev}}/{{backing_dev}}",
485+ {% endraw %}
486 "metric": "bcache_cache_hit_ratio",
487 "refId": "A",
488 "step": 4
489@@ -1956,7 +2050,9 @@
490 "format": "time_series",
491 "interval": "",
492 "intervalFactor": 2,
493+ {% raw %}
494 "legendFormat": "{{host}} {{bcache_dev}}/{{backing_dev}}",
495+ {% endraw %}
496 "metric": "bcache_bypassed",
497 "refId": "A",
498 "step": 4
499@@ -2048,7 +2144,9 @@
500 "format": "time_series",
501 "interval": "",
502 "intervalFactor": 2,
503+ {% raw %}
504 "legendFormat": "{{host}}",
505+ {% endraw %}
506 "metric": "exec",
507 "refId": "A",
508 "step": 2
509@@ -2127,7 +2225,9 @@
510 "format": "time_series",
511 "interval": "",
512 "intervalFactor": 2,
513+ {% raw %}
514 "legendFormat": "{{host}} - Count",
515+ {% endraw %}
516 "metric": "conntrack_ip_conntrack_count",
517 "refId": "A",
518 "step": 2
519@@ -2184,18 +2284,38 @@
520 "templating": {
521 "list": [
522 {
523- "allValue": ".*",
524+ "allValue": "",
525 "current": {},
526 "datasource": "{{ datasource }}",
527 "hide": 0,
528- "includeAll": false,
529- "label": "non-juju hosts",
530+ "includeAll": true,
531+ "label": null,
532+ "multi": true,
533+ "name": "juju_model",
534+ "options": [],
535+ "query": "system_load1{}",
536+ "refresh": 1,
537+ "regex": ".*host=\"([^:]+).*$",
538+ "sort": 1,
539+ "tagValuesQuery": "",
540+ "tags": [],
541+ "tagsQuery": "",
542+ "type": "query",
543+ "useTags": false
544+ },
545+ {
546+ "allValue": "",
547+ "current": {},
548+ "datasource": "{{ datasource }}",
549+ "hide": 0,
550+ "includeAll": true,
551+ "label": null,
552 "multi": true,
553 "name": "host",
554 "options": [],
555- "query": "system_load1",
556+ "query": "system_load1{host=~\".*^($juju_model).*\"}",
557 "refresh": 1,
558- "regex": ".*host=\"([^\"]+)\".*$",
559+ "regex": ".*host=\"([^\"]+).*",
560 "sort": 1,
561 "tagValuesQuery": "",
562 "tags": [],

Subscribers

People subscribed via source and target branches