| 1 |
{{ template "head" . }} |
| 2 |
|
| 3 |
{{ template "prom_right_table_head" }} |
| 4 |
<tr><th colspan="2">Overview</th></tr> |
| 5 |
<tr> |
| 6 |
<td>User CPU</td> |
| 7 |
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(node_cpu_seconds_total{job='node',instance='%s',mode='user'}[5m])) * 100 / count(count by (cpu)(node_cpu_seconds_total{job='node',instance='%s'}))" .Params.instance .Params.instance) "%" "printf.1f") }}</td> |
| 8 |
</tr> |
| 9 |
<tr> |
| 10 |
<td>System CPU</td> |
| 11 |
<td>{{ template "prom_query_drilldown" (args (printf "sum(irate(node_cpu_seconds_total{job='node',instance='%s',mode='system'}[5m])) * 100 / count(count by (cpu)(node_cpu_seconds_total{job='node',instance='%s'}))" .Params.instance .Params.instance) "%" "printf.1f") }}</td> |
| 12 |
</tr> |
| 13 |
<tr> |
| 14 |
<td>Memory Total</td> |
| 15 |
<td>{{ template "prom_query_drilldown" (args (printf "node_memory_MemTotal_bytes{job='node',instance='%s'}" .Params.instance) "B" "humanize1024") }}</td> |
| 16 |
</tr> |
| 17 |
<tr> |
| 18 |
<td>Memory Free</td> |
| 19 |
<td>{{ template "prom_query_drilldown" (args (printf "node_memory_MemFree_bytes{job='node',instance='%s'}" .Params.instance) "B" "humanize1024") }}</td> |
| 20 |
</tr> |
| 21 |
<tr> |
| 22 |
<th colspan="2">Network</th> |
| 23 |
</tr> |
| 24 |
{{ range printf "node_network_receive_bytes_total{job='node',instance='%s',device!='lo'}" .Params.instance | query | sortByLabel "device" }} |
| 25 |
<tr> |
| 26 |
<td>{{ .Labels.device }} Received</td> |
| 27 |
<td>{{ template "prom_query_drilldown" (args (printf "irate(node_network_receive_bytes_total{job='node',instance='%s',device='%s'}[5m])" .Labels.instance .Labels.device) "B/s" "humanize") }}</td> |
| 28 |
</tr> |
| 29 |
<tr> |
| 30 |
<td>{{ .Labels.device }} Transmitted</td> |
| 31 |
<td>{{ template "prom_query_drilldown" (args (printf "irate(node_network_transmit_bytes_total{job='node',instance='%s',device='%s'}[5m])" .Labels.instance .Labels.device) "B/s" "humanize") }}</td> |
| 32 |
</tr> |
| 33 |
{{ end }} |
| 34 |
<tr> |
| 35 |
<th colspan="2">Disks</th> |
| 36 |
</tr> |
| 37 |
{{ range printf "node_disk_io_time_seconds_total{job='node',instance='%s',device!~'^(md\\\\d+$|dm-)'}" .Params.instance | query | sortByLabel "device" }} |
| 38 |
<tr> |
| 39 |
<td>{{ .Labels.device }} Utilization</td> |
| 40 |
<td>{{ template "prom_query_drilldown" (args (printf "irate(node_disk_io_time_seconds_total{job='node',instance='%s',device='%s'}[5m]) * 100" .Labels.instance .Labels.device) "%" "printf.1f") }}</td> |
| 41 |
</tr> |
| 42 |
{{ end }} |
| 43 |
{{ range printf "node_disk_io_time_seconds_total{job='node',instance='%s'}" .Params.instance | query | sortByLabel "device" }} |
| 44 |
<tr> |
| 45 |
<td>{{ .Labels.device }} Throughput</td> |
| 46 |
<td>{{ template "prom_query_drilldown" (args (printf "irate(node_disk_read_bytes_total{job='node',instance='%s',device='%s'}[5m]) + irate(node_disk_written_bytes_total{job='node',instance='%s',device='%s'}[5m])" .Labels.instance .Labels.device .Labels.instance .Labels.device) "B/s" "humanize") }}</td> |
| 47 |
</tr> |
| 48 |
{{ end }} |
| 49 |
<tr> |
| 50 |
<th colspan="2">Filesystem Fullness</th> |
| 51 |
</tr> |
| 52 |
{{ define "roughlyNearZero" }} |
| 53 |
{{ if gt .1 . }}~0{{ else }}{{ printf "%.1f" . }}{{ end }} |
| 54 |
{{ end }} |
| 55 |
{{ range printf "node_filesystem_size_bytes{job='node',instance='%s'}" .Params.instance | query | sortByLabel "mountpoint" }} |
| 56 |
<tr> |
| 57 |
<td>{{ .Labels.mountpoint }}</td> |
| 58 |
<td>{{ template "prom_query_drilldown" (args (printf "100 - node_filesystem_avail_bytes{job='node',instance='%s',mountpoint='%s'} / node_filesystem_size_bytes{job='node'} * 100" .Labels.instance .Labels.mountpoint) "%" "roughlyNearZero") }}</td> |
| 59 |
</tr> |
| 60 |
{{ end }} |
| 61 |
|
| 62 |
{{ template "prom_right_table_tail" }} |
| 63 |
|
| 64 |
{{ template "prom_content_head" . }} |
| 65 |
<h1>Node Overview - {{ reReplaceAll "(.*?://)([^:/]+?)(:\\d+)?/.*" "$2" .Params.instance }}</h1> |
| 66 |
|
| 67 |
<h3>CPU Usage</h3> |
| 68 |
<div id="cpuGraph"></div> |
| 69 |
<script> |
| 70 |
new PromConsole.Graph({ |
| 71 |
node: document.querySelector("#cpuGraph"), |
| 72 |
expr: "sum by (mode)(irate(node_cpu_seconds_total{job='node',instance='{{ .Params.instance }}',mode!='idle',mode!='iowait',mode!='steal'}[5m]))", |
| 73 |
renderer: 'area', |
| 74 |
max: {{ with printf "count(count by (cpu)(node_cpu_seconds_total{job='node',instance='%s'}))" .Params.instance | query }}{{ . | first | value }}{{ else}}undefined{{end}}, |
| 75 |
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix, |
| 76 |
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix, |
| 77 |
yTitle: 'Cores' |
| 78 |
}) |
| 79 |
</script> |
| 80 |
|
| 81 |
<h3>Disk I/O Utilization</h3> |
| 82 |
<div id="diskioGraph"></div> |
| 83 |
<script> |
| 84 |
new PromConsole.Graph({ |
| 85 |
node: document.querySelector("#diskioGraph"), |
| 86 |
expr: [ |
| 87 |
"irate(node_disk_io_time_seconds_total{job='node',instance='{{ .Params.instance }}',device!~'^(md\\\\d+$|dm-)'}[5m]) * 100", |
| 88 |
], |
| 89 |
min: 0, |
| 90 |
name: '[[ device ]]', |
| 91 |
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix, |
| 92 |
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix, |
| 93 |
yUnits: "%", |
| 94 |
yTitle: 'Disk I/O Utilization' |
| 95 |
}) |
| 96 |
</script> |
| 97 |
|
| 98 |
<h3>Memory</h3> |
| 99 |
<div id="memoryGraph"></div> |
| 100 |
<script> |
| 101 |
new PromConsole.Graph({ |
| 102 |
node: document.querySelector("#memoryGraph"), |
| 103 |
renderer: 'area', |
| 104 |
expr: [ |
| 105 |
"node_memory_Cached_bytes{job='node',instance='{{ .Params.instance }}'}", |
| 106 |
"node_memory_Buffers_bytes{job='node',instance='{{ .Params.instance }}'}", |
| 107 |
"node_memory_MemTotal_bytes{job='node',instance='{{ .Params.instance }}'} - node_memory_MemFree_bytes{job='node',instance='{{.Params.instance}}'} - node_memory_Buffers_bytes{job='node',instance='{{.Params.instance}}'} - node_memory_Cached_bytes{job='node',instance='{{.Params.instance}}'}", |
| 108 |
"node_memory_MemFree{job='node',instance='{{ .Params.instance }}'}", |
| 109 |
], |
| 110 |
name: ["Cached", "Buffers", "Used", "Free"], |
| 111 |
min: 0, |
| 112 |
yUnits: "B", |
| 113 |
yAxisFormatter: PromConsole.NumberFormatter.humanize1024, |
| 114 |
yHoverFormatter: PromConsole.NumberFormatter.humanize1024, |
| 115 |
yTitle: 'Memory' |
| 116 |
}) |
| 117 |
</script> |
| 118 |
|
| 119 |
{{ template "prom_content_tail" . }} |
| 120 |
|
| 121 |
{{ template "tail" }} |