@ -8,9 +8,9 @@
< script >
new PromConsole.Graph({
node: document.querySelector("#cpuGraph"),
expr: "sum by (mode)(irate(node_cpu{job='node',instance='{{ .Params.instance }}',mode!='idle'}[5m]))",
expr: "sum by (mode)(irate(node_cpu_seconds_total {job='node',instance='{{ .Params.instance }}',mode!='idle'}[5m]))",
renderer: 'area',
max: {{ with printf "count(count by (cpu)(node_cpu{job='node',instance='%s'}))" .Params.instance | query }}{{ . | first | value }}{{ else}}undefined{{end}},
max: {{ with printf "count(count by (cpu)(node_cpu_seconds_total {job='node',instance='%s'}))" .Params.instance | query }}{{ . | first | value }}{{ else}}undefined{{end}},
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yTitle: 'Cores'
@ -23,7 +23,7 @@
new PromConsole.Graph({
node: document.querySelector("#diskioGraph"),
expr: [
"irate(node_disk_io_time_ms {job='node',instance='{{ .Params.instance }}',device!~'^(md\\\\d+$|dm-)'}[5m]) / 1000 * 100",
"irate(node_disk_io_time_seconds_total {job='node',instance='{{ .Params.instance }}',device!~'^(md\\\\d+$|dm-)'}[5m]) * 100",
],
min: 0,
name: '[[ device ]]',
@ -41,9 +41,9 @@
node: document.querySelector("#memoryGraph"),
renderer: 'area',
expr: [
"node_memory_Cached{job='node',instance='{{ .Params.instance }}'}",
"node_memory_Buffers{job='node',instance='{{ .Params.instance }}'}",
"node_memory_MemTotal{job='node',instance='{{ .Params.instance }}'} - node_memory_MemFree{job='node',instance='{{.Params.instance}}'} - node_memory_Buffers{job='node',instance='{{.Params.instance}}'} - node_memory_Cached{job='node',instance='{{.Params.instance}}'}",
"node_memory_Cached_bytes {job='node',instance='{{ .Params.instance }}'}",
"node_memory_Buffers_bytes {job='node',instance='{{ .Params.instance }}'}",
"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}}'}",
"node_memory_MemFree{job='node',instance='{{ .Params.instance }}'}",
],
name: ["Cached", "Buffers", "Used", "Free"],
@ -59,47 +59,47 @@
< tr > < th colspan = "2" > Overview< / th > < / tr >
< tr >
< td > User CPU< / td >
< td > {{ template "prom_query_drilldown" (args (printf "sum(irate(node_cpu{job='node',instance='%s',mode='user'}[5m])) * 100 / count(count by (cpu)(node_cpu{job='node',instance='%s'}))" .Params.instance .Params.instance) "%" "printf.1f") }}< / td >
< 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 >
< / tr >
< tr >
< td > System CPU< / td >
< td > {{ template "prom_query_drilldown" (args (printf "sum(irate(node_cpu{job='node',instance='%s',mode='system'}[5m])) * 100 / count(count by (cpu)(node_cpu{job='node',instance='%s'}))" .Params.instance .Params.instance) "%" "printf.1f") }}< / td >
< 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 >
< / tr >
< tr >
< td > Memory Total< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_memory_MemTotal{job='node',instance='%s'}" .Params.instance) "B" "humanize1024") }}< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_memory_MemTotal_bytes {job='node',instance='%s'}" .Params.instance) "B" "humanize1024") }}< / td >
< / tr >
< tr >
< td > Memory Free< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_memory_MemFree{job='node',instance='%s'}" .Params.instance) "B" "humanize1024") }}< / td >
< td > {{ template "prom_query_drilldown" (args (printf "node_memory_MemFree_bytes {job='node',instance='%s'}" .Params.instance) "B" "humanize1024") }}< / td >
< / tr >
< tr >
< th colspan = "2" > Network< / th >
< / tr >
{{ range printf "node_network_receive_bytes{job='node',instance='%s',device!='lo'}" .Params.instance | query | sortByLabel "device" }}
{{ range printf "node_network_receive_bytes_total {job='node',instance='%s',device!='lo'}" .Params.instance | query | sortByLabel "device" }}
< tr >
< td > {{ .Labels.device }} Received< / td >
< td > {{ template "prom_query_drilldown" (args (printf "irate(node_network_receive_bytes{job='node',instance='%s',device='%s'}[5m])" .Labels.instance .Labels.device) "B/s" "humanize") }}< / td >
< 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 >
< / tr >
< tr >
< td > {{ .Labels.device }} Transmitted< / td >
< td > {{ template "prom_query_drilldown" (args (printf "irate(node_network_transmit_bytes{job='node',instance='%s',device='%s'}[5m])" .Labels.instance .Labels.device) "B/s" "humanize") }}< / td >
< 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 >
< / tr >
{{ end }}
< / tr >
< tr >
< th colspan = "2" > Disks< / th >
< / 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_seconds_total {job='node',instance='%s',device!~'^(md\\\\d+$|dm-)'}" .Params.instance | query | sortByLabel "device" }}
< tr >
< 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_seconds_total {job='node',instance='%s',device='%s'}[5m]) * 100" .Labels.instance .Labels.device) "%" "printf.1f") }}< / td >
< / tr >
{{ end }}
{{ range printf "node_disk_io_time_ms {job='node',instance='%s'}" .Params.instance | query | sortByLabel "device" }}
{{ range printf "node_disk_io_time_seconds_total {job='node',instance='%s'}" .Params.instance | query | sortByLabel "device" }}
< tr >
< td > {{ .Labels.device }} Throughput< / td >
< td > {{ template "prom_query_drilldown" (args (printf "irate(node_disk_sectors_read {job='node',instance='%s',device='%s'}[5m]) * 512 + irate(node_disk_sectors_ written{job='node',instance='%s',device='%s'}[5m]) * 512 " .Labels.instance .Labels.device .Labels.instance .Labels.device) "B/s" "humanize") }}< / td >
< 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 >
< / tr >
{{ end }}
< tr >
@ -108,10 +108,10 @@
{{ define "roughlyNearZero" }}
{{ if gt .1 . }}~0{{ else }}{{ printf "%.1f" . }}{{ end }}
{{ end }}
{{ range printf "node_filesystem_size{job='node',instance='%s'}" .Params.instance | query | sortByLabel "mountpoint" }}
{{ range printf "node_filesystem_size_bytes {job='node',instance='%s'}" .Params.instance | query | sortByLabel "mountpoint" }}
< tr >
< td > {{ .Labels.mountpoint }}< / td >
< td > {{ template "prom_query_drilldown" (args (printf "100 - node_filesystem_free {job='node',instance='%s',mountpoint='%s'} / node_filesystem_size{job='node'} * 100" .Labels.instance .Labels.mountpoint) "%" "roughlyNearZero") }}< / td >
< 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 >
< / tr >
{{ end }}
< / tr >