2015-01-23 09:40:48 -08:00
{{ template "head" . }}
2014-11-20 10:41:25 -08:00
2015-01-23 09:40:48 -08:00
{{ template "prom_right_table_head" }}
2014-11-20 10:41:25 -08:00
< tr > < th colspan = "2" > Overview< / th > < / tr >
< tr >
< td > User CPU< / td >
2015-10-09 09:58:43 -07:00
< 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 >
2014-11-20 10:41:25 -08:00
< / tr >
< tr >
< td > System CPU< / td >
2015-10-09 09:58:43 -07:00
< 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 >
2014-11-20 10:41:25 -08:00
< / 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 >
< / 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 >
< / tr >
< tr >
< th colspan = "2" > Network< / th >
< / tr >
2015-01-23 09:40:48 -08:00
{{ range printf "node_network_receive_bytes{job='node',instance='%s',device!='lo'}" .Params.instance | query | sortByLabel "device" }}
2014-11-20 10:41:25 -08:00
< tr >
< td > {{ .Labels.device }} Received< / td >
2015-10-09 09:58:43 -07:00
< 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 >
2014-11-20 10:41:25 -08:00
< / tr >
< tr >
< td > {{ .Labels.device }} Transmitted< / td >
2015-10-09 09:58:43 -07:00
< 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 >
2014-11-20 10:41:25 -08:00
< / tr >
{{ end }}
< / tr >
< tr >
< th colspan = "2" > Disks< / th >
< / tr >
2015-01-23 09:40:48 -08:00
{{ range printf "node_disk_io_time_ms{job='node',instance='%s',device!~'^(md\\d+$|dm-)'}" .Params.instance | query | sortByLabel "device" }}
2014-11-20 10:41:25 -08:00
< tr >
< td > {{ .Labels.device }} Utilization< / td >
2015-10-09 09:58:43 -07:00
< 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 >
2014-11-20 10:41:25 -08:00
< / tr >
{{ end }}
2015-01-23 09:40:48 -08:00
{{ range printf "node_disk_io_time_ms{job='node',instance='%s'}" .Params.instance | query | sortByLabel "device" }}
2014-11-20 10:41:25 -08:00
< tr >
< td > {{ .Labels.device }} Throughput< / td >
2015-10-09 09:58:43 -07:00
< td > {{ template "prom_query_drilldown" (args (printf "irate(node_disk_sectors_read{job='node',instance='%s',device='%s'}[5m]) * 512 + rate(node_disk_sectors_written{job='node',instance='%s',device='%s'}[5m]) * 512" .Labels.instance .Labels.device .Labels.instance .Labels.device) "B/s" "humanize") }}< / td >
2014-11-20 10:41:25 -08:00
< / tr >
{{ end }}
< tr >
< th colspan = "2" > Filesystem Fullness< / th >
< / tr >
2015-01-23 09:40:48 -08:00
{{ define "roughlyNearZero" }}
2015-02-19 02:06:23 -08:00
{{ if gt .1 . }}~0{{ else }}{{ printf "%.1f" . }}{{ end }}
2014-11-20 10:41:25 -08:00
{{ end }}
2015-07-22 09:20:14 -07:00
{{ range printf "node_filesystem_size{job='node',instance='%s'}" .Params.instance | query | sortByLabel "mountpoint" }}
2014-11-20 10:41:25 -08:00
< tr >
2015-07-22 09:20:14 -07:00
< 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 >
2014-11-20 10:41:25 -08:00
< / tr >
{{ end }}
< / tr >
2015-01-23 09:40:48 -08:00
{{ template "prom_right_table_tail" }}
2014-11-20 10:41:25 -08:00
2015-01-23 09:40:48 -08:00
{{ template "prom_content_head" . }}
2014-11-20 10:41:25 -08:00
< h1 > Node Overview - {{ reReplaceAll "(.*?://)([^:/]+?)(:\\d+)?/.*" "$2" .Params.instance }}< / h1 >
< h3 > CPU Usage< / h3 >
< div id = "cpuGraph" > < / div >
< script >
new PromConsole.Graph({
node: document.querySelector("#cpuGraph"),
2015-10-09 09:58:43 -07:00
expr: "sum by (mode)(irate(node_cpu{job='node',instance='{{ .Params.instance }}',mode!='idle'}[5m]))",
2014-11-20 10:41:25 -08:00
renderer: 'area',
2015-01-23 09:40:48 -08:00
max: {{ with printf "count(count by (cpu)(node_cpu{job='node',instance='%s'}))" .Params.instance | query }}{{ . | first | value }}{{ else}}undefined{{end}},
2014-11-20 10:41:25 -08:00
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yTitle: 'Cores'
})
< / script >
< h3 > Disk I/O Utilization< / h3 >
< div id = "diskioGraph" > < / div >
< script >
new PromConsole.Graph({
node: document.querySelector("#diskioGraph"),
expr: [
2015-10-09 09:58:43 -07:00
"irate(node_disk_io_time_ms{job='node',instance='{{ .Params.instance }}',device!~'^(md\\d+$|dm-)'}[5m]) / 1000 * 100",
2014-11-20 10:41:25 -08:00
],
min: 0,
name: '[[ device ]]',
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
yUnits: "%",
yTitle: 'Disk I/O Utilization'
})
< / script >
< h3 > Memory< / h3 >
< div id = "memoryGraph" > < / div >
< script >
new PromConsole.Graph({
node: document.querySelector("#memoryGraph"),
renderer: 'area',
expr: [
2015-01-23 09:40:48 -08:00
"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_MemFree{job='node',instance='{{ .Params.instance }}'}",
2014-11-20 10:41:25 -08:00
],
2015-08-11 12:03:20 -07:00
name: ["Cached", "Buffers", "Used", "Free"],
2014-11-20 10:41:25 -08:00
min: 0,
yUnits: "B",
yAxisFormatter: PromConsole.NumberFormatter.humanize1024,
yHoverFormatter: PromConsole.NumberFormatter.humanize1024,
yTitle: 'Memory'
})
< / script >
2015-01-23 09:40:48 -08:00
{{ template "prom_content_tail" . }}
2014-11-20 10:41:25 -08:00
2015-01-23 09:40:48 -08:00
{{ template "tail" }}