2018-05-08 10:10:29 +00:00
|
|
|
local g = import 'grafana-builder/grafana.libsonnet';
|
|
|
|
|
|
|
|
{
|
|
|
|
grafanaDashboards+:: {
|
|
|
|
'node-cluster-rsrc-use.json':
|
|
|
|
local legendLink = '%s/dashboard/file/k8s-node-rsrc-use.json' % $._config.grafana_prefix;
|
|
|
|
|
|
|
|
g.dashboard('USE Method / Cluster')
|
|
|
|
.addRow(
|
|
|
|
g.row('CPU')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('CPU Utilisation') +
|
2019-07-12 20:58:43 +00:00
|
|
|
g.queryPanel(|||
|
|
|
|
(
|
2019-07-17 21:54:31 +00:00
|
|
|
instance:node_cpu_utilisation:avg_rate1m{%(nodeExporterSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
*
|
2019-07-17 21:54:31 +00:00
|
|
|
instance:node_num_cpu:sum{%(nodeExporterSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
/ ignoring (instance) group_left
|
2019-07-17 21:54:31 +00:00
|
|
|
sum without (instance) (instance:node_num_cpu:sum{%(nodeExporterSelector)s})
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
2019-07-17 21:54:31 +00:00
|
|
|
||| % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
|
|
|
|
)
|
|
|
|
.addPanel(
|
2019-07-12 20:58:43 +00:00
|
|
|
// TODO: Is this a useful panel?
|
|
|
|
g.panel('CPU Saturation (load1 per CPU)') +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.queryPanel(|||
|
2019-07-12 20:58:43 +00:00
|
|
|
(
|
2019-07-17 21:54:31 +00:00
|
|
|
instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
/ ignoring (instance) group_left
|
2019-07-17 21:54:31 +00:00
|
|
|
count without (instance) (instance:node_load1_per_cpu:ratio{%(nodeExporterSelector)s})
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
2019-07-17 21:54:31 +00:00
|
|
|
||| % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
2019-07-12 20:58:43 +00:00
|
|
|
// TODO: Does `max: 1` make sense? The stack can go over 1 in high-load scenarios.
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Memory')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Memory Utilisation') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s}' % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
|
|
|
|
)
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Memory Saturation (Swap I/O)') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_memory_swap_io_bytes:sum_rate{%(nodeExporterSelector)s}' % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes('Bps') },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Disk')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Disk IO Utilisation') +
|
|
|
|
// Full utilisation would be all disks on each node spending an average of
|
2019-07-12 20:58:43 +00:00
|
|
|
// 1 second per second doing I/O, normalize by metric cardinality for stacked charts.
|
|
|
|
g.queryPanel(|||
|
|
|
|
(
|
2019-07-17 21:54:31 +00:00
|
|
|
instance:node_disk_io_time_seconds:sum_rate1m{%(nodeExporterSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
/ ignoring (instance) group_left
|
2019-07-17 21:54:31 +00:00
|
|
|
count without (instance) (instance:node_disk_io_time_seconds:sum_rate1m{%(nodeExporterSelector)s})
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
2019-07-17 21:54:31 +00:00
|
|
|
||| % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
|
|
|
|
)
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Disk IO Saturation') +
|
|
|
|
g.queryPanel(|||
|
2019-07-12 20:58:43 +00:00
|
|
|
(
|
2019-07-17 21:54:31 +00:00
|
|
|
instance:node_disk_io_time_weighted_seconds:sum_rate1m{%(nodeExporterSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
/ ignoring (instance) group_left
|
2019-07-17 21:54:31 +00:00
|
|
|
count without (instance) (instance:node_disk_io_time_weighted_seconds:sum_rate1m{%(nodeExporterSelector)s})
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
2019-07-17 21:54:31 +00:00
|
|
|
||| % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Network')
|
|
|
|
.addPanel(
|
2019-07-17 21:54:31 +00:00
|
|
|
g.panel('Net Utilisation (Bytes Receive/Transmit)') +
|
|
|
|
g.queryPanel(
|
|
|
|
[
|
|
|
|
'instance:node_network_receive_bytes:sum_rate1m{%(nodeExporterSelector)s}' % $._config,
|
|
|
|
'-instance:node_network_transmit_bytes:sum_rate1m{%(nodeExporterSelector)s}' % $._config,
|
|
|
|
],
|
|
|
|
['{{instance}} Receive', '{{instance}} Transmit'],
|
|
|
|
legendLink,
|
|
|
|
) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes('Bps') },
|
|
|
|
)
|
|
|
|
.addPanel(
|
2019-07-17 21:54:31 +00:00
|
|
|
g.panel('Net Saturation (Drops Receive/Transmit)') +
|
|
|
|
g.queryPanel(
|
|
|
|
[
|
|
|
|
'instance:node_network_receive_drop:sum_rate1m{%(nodeExporterSelector)s}' % $._config,
|
|
|
|
'-instance:node_network_transmit_drop:sum_rate1m{%(nodeExporterSelector)s}' % $._config,
|
|
|
|
],
|
|
|
|
['{{instance}} Receive', '{{instance}} Transmit'],
|
|
|
|
legendLink,
|
|
|
|
) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
2019-07-17 21:54:31 +00:00
|
|
|
{ yaxes: g.yaxes('rps') },
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Storage')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Disk Capacity') +
|
2019-07-12 20:58:43 +00:00
|
|
|
g.queryPanel(|||
|
|
|
|
(
|
|
|
|
sum without (device) (
|
|
|
|
max without (fstype, mountpoint) (
|
2019-07-16 17:34:27 +00:00
|
|
|
node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s} - node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
/ ignoring (instance) group_left
|
|
|
|
sum without (instance, device) (
|
|
|
|
max without (fstype, mountpoint) (
|
2019-07-16 17:34:27 +00:00
|
|
|
node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s}
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2019-07-16 17:34:27 +00:00
|
|
|
||| % $._config, '{{instance}}', legendLink) +
|
2018-05-08 10:10:29 +00:00
|
|
|
g.stack +
|
|
|
|
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
2018-05-11 13:40:20 +00:00
|
|
|
'node-rsrc-use.json':
|
|
|
|
g.dashboard('USE Method / Node')
|
2018-05-08 10:10:29 +00:00
|
|
|
.addTemplate('instance', 'up{%(nodeExporterSelector)s}' % $._config, 'instance')
|
|
|
|
.addRow(
|
|
|
|
g.row('CPU')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('CPU Utilisation') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_cpu_utilisation:avg_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Utilisation') +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('percentunit') },
|
|
|
|
)
|
|
|
|
.addPanel(
|
|
|
|
g.panel('CPU Saturation (Load1)') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_cpu_saturation_load1:{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Saturation') +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('percentunit') },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Memory')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Memory Utilisation') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_memory_utilisation:ratio{%(nodeExporterSelector)s, %(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Memory') +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('percentunit') },
|
|
|
|
)
|
|
|
|
.addPanel(
|
2019-07-12 20:58:43 +00:00
|
|
|
g.panel('Memory Saturation (pages swapped per second)') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_memory_swap_io_pages:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Swap IO') +
|
2019-07-12 20:58:43 +00:00
|
|
|
{ yaxes: g.yaxes('short') },
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Disk')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Disk IO Utilisation') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_disk_io_time_seconds:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Utilisation') +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('percentunit') },
|
|
|
|
)
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Disk IO Saturation') +
|
2019-07-17 21:54:31 +00:00
|
|
|
g.queryPanel('instance:node_disk_io_time_weighted_seconds:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Saturation') +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('percentunit') },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Net')
|
|
|
|
.addPanel(
|
2019-07-16 19:18:17 +00:00
|
|
|
g.panel('Net Utilisation (Bytes Receive/Transmit)') +
|
|
|
|
g.queryPanel(
|
2019-07-17 21:54:31 +00:00
|
|
|
[
|
|
|
|
'instance:node_network_receive_bytes:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
|
|
|
|
'-instance:node_network_transmit_bytes:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
|
|
|
|
],
|
2019-07-16 19:18:17 +00:00
|
|
|
['Receive', 'Transmit'],
|
|
|
|
) +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('Bps') },
|
|
|
|
)
|
|
|
|
.addPanel(
|
2019-07-16 19:18:17 +00:00
|
|
|
g.panel('Net Saturation (Drops Receive/Transmit)') +
|
|
|
|
g.queryPanel(
|
2019-07-17 21:54:31 +00:00
|
|
|
[
|
|
|
|
'instance:node_network_receive_drop:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
|
|
|
|
'-instance:node_network_transmit_drop:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
|
|
|
|
],
|
2019-07-16 19:18:17 +00:00
|
|
|
['Receive drops', 'Transmit drops'],
|
|
|
|
) +
|
|
|
|
{ yaxes: g.yaxes('rps') },
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
.addRow(
|
|
|
|
g.row('Disk')
|
|
|
|
.addPanel(
|
|
|
|
g.panel('Disk Utilisation') +
|
2019-07-12 20:58:43 +00:00
|
|
|
g.queryPanel(|||
|
|
|
|
1 -
|
|
|
|
(
|
2019-07-16 17:34:27 +00:00
|
|
|
sum(max without (mountpoint, fstype) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s}))
|
2019-07-12 20:58:43 +00:00
|
|
|
/
|
2019-07-16 17:34:27 +00:00
|
|
|
sum(max without (mountpoint, fstype) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s}))
|
2019-07-12 20:58:43 +00:00
|
|
|
)
|
2019-07-16 17:34:27 +00:00
|
|
|
||| % $._config, 'Disk') +
|
2018-05-08 10:10:29 +00:00
|
|
|
{ yaxes: g.yaxes('percentunit') },
|
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
}
|