2018-05-08 10:10:29 +00:00
|
|
|
{
|
|
|
|
prometheusRules+:: {
|
|
|
|
groups+: [
|
|
|
|
{
|
2018-08-06 08:46:28 +00:00
|
|
|
name: 'node-exporter.rules',
|
2018-05-08 10:10:29 +00:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
// This rule gives the number of CPUs per node.
|
|
|
|
record: 'instance:node_num_cpu:sum',
|
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
count without (cpu) (
|
|
|
|
sum without (mode) (
|
2018-11-19 15:00:48 +00:00
|
|
|
node_cpu_seconds_total{%(nodeExporterSelector)s}
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// CPU utilisation is % CPU is not idle.
|
|
|
|
record: 'instance:node_cpu_utilisation:avg1m',
|
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
1 - avg without (cpu, mode) (
|
|
|
|
rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle"}[1m])
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
{
|
2019-07-12 20:58:43 +00:00
|
|
|
// This is CPU saturation: 1min avg run queue length / number of CPUs.
|
|
|
|
// Can go over 1. >1 is bad.
|
|
|
|
record: 'instance:node_load1_per_cpu:ratio',
|
2018-05-08 10:10:29 +00:00
|
|
|
expr: |||
|
2019-07-10 18:07:20 +00:00
|
|
|
(
|
2019-07-12 20:58:43 +00:00
|
|
|
node_load1{%(nodeExporterSelector)s}
|
2018-05-08 10:10:29 +00:00
|
|
|
/
|
2019-07-12 20:58:43 +00:00
|
|
|
instance:node_num_cpu:sum{%(nodeExporterSelector)s}
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Memory utilisation per node, normalized by per-node memory
|
|
|
|
record: 'instance:node_memory_utilisation:ratio',
|
|
|
|
expr: |||
|
2018-05-10 09:35:48 +00:00
|
|
|
1 - (
|
2019-07-10 18:07:20 +00:00
|
|
|
node_memory_MemAvailable_bytes{%(nodeExporterSelector)s}
|
|
|
|
/
|
|
|
|
node_memory_MemTotal_bytes{%(nodeExporterSelector)s}
|
2018-05-10 09:35:48 +00:00
|
|
|
)
|
2018-07-13 13:01:01 +00:00
|
|
|
||| % $._config,
|
2018-05-08 10:10:29 +00:00
|
|
|
},
|
|
|
|
{
|
2019-07-12 20:58:43 +00:00
|
|
|
record: 'instance:node_memory_swap_io_pages:sum_rate',
|
2018-05-08 10:10:29 +00:00
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
(
|
2019-07-10 18:07:20 +00:00
|
|
|
rate(node_vmstat_pgpgin{%(nodeExporterSelector)s}[1m])
|
|
|
|
+
|
|
|
|
rate(node_vmstat_pgpgout{%(nodeExporterSelector)s}[1m])
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
{
|
2018-05-10 09:35:48 +00:00
|
|
|
// Disk utilisation (ms spent, 1 second irate())
|
|
|
|
record: 'instance:node_disk_utilisation:sum_irate',
|
2018-05-08 10:10:29 +00:00
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
sum without (device) (
|
2019-07-16 17:34:27 +00:00
|
|
|
irate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[1m])
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Disk saturation (ms spent, by rate() it's bound by 1 second)
|
2018-05-10 09:35:48 +00:00
|
|
|
record: 'instance:node_disk_saturation:sum_irate',
|
2018-05-08 10:10:29 +00:00
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
sum without (device) (
|
2019-07-16 17:34:27 +00:00
|
|
|
irate(node_disk_io_time_weighted_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[1m])
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
2019-07-12 20:58:43 +00:00
|
|
|
// TODO: For the following two rules, consider configurable filtering to exclude more network
|
|
|
|
// device names than just "lo".
|
2018-05-08 10:10:29 +00:00
|
|
|
{
|
|
|
|
record: 'instance:node_net_utilisation:sum_irate',
|
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
sum without (device) (
|
|
|
|
irate(node_network_receive_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m])
|
2019-07-10 18:07:20 +00:00
|
|
|
+
|
2019-07-12 20:58:43 +00:00
|
|
|
irate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m])
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
record: 'instance:node_net_saturation:sum_irate',
|
|
|
|
expr: |||
|
2019-07-12 20:58:43 +00:00
|
|
|
sum without (device) (
|
|
|
|
irate(node_network_receive_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m])
|
2019-07-10 18:07:20 +00:00
|
|
|
+
|
2019-07-12 20:58:43 +00:00
|
|
|
irate(node_network_transmit_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m])
|
2018-05-08 10:10:29 +00:00
|
|
|
)
|
|
|
|
||| % $._config,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}
|