Fix indentation

Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
beorn7 2019-07-10 20:07:20 +02:00
parent 9d7045e483
commit dec5b5b053
4 changed files with 74 additions and 46 deletions

View file

@ -7,11 +7,13 @@
{
alert: 'NodeFilesystemSpaceFillingUp',
expr: |||
predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 24*60*60) < 0
(
predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 24*60*60) < 0
and
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.4
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.4
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -24,11 +26,13 @@
{
alert: 'NodeFilesystemSpaceFillingUp',
expr: |||
predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 4*60*60) < 0
(
predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 4*60*60) < 0
and
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.2
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.2
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -41,9 +45,11 @@
{
alert: 'NodeFilesystemOutOfSpace',
expr: |||
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 5
(
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 5
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -56,9 +62,11 @@
{
alert: 'NodeFilesystemOutOfSpace',
expr: |||
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 3
(
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 3
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -71,11 +79,13 @@
{
alert: 'NodeFilesystemFilesFillingUp',
expr: |||
predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 24*60*60) < 0
(
predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 24*60*60) < 0
and
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.4
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.4
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -88,11 +98,13 @@
{
alert: 'NodeFilesystemFilesFillingUp',
expr: |||
predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 4*60*60) < 0
(
predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 4*60*60) < 0
and
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.2
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.2
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -105,9 +117,11 @@
{
alert: 'NodeFilesystemOutOfFiles',
expr: |||
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 5
(
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 5
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {
@ -120,9 +134,11 @@
{
alert: 'NodeFilesystemOutOfSpace',
expr: |||
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 3
(
node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 3
and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0
)
||| % $._config,
'for': '1h',
labels: {

View file

@ -47,10 +47,15 @@ local gauge = promgrafonnet.gauge;
)
.addTarget(prometheus.target(
|||
node_memory_MemTotal{%(nodeExporterSelector)s, instance="$instance"}
- node_memory_MemFree{%(nodeExporterSelector)s, instance="$instance"}
- node_memory_Buffers{%(nodeExporterSelector)s, instance="$instance"}
- node_memory_Cached{%(nodeExporterSelector)s, instance="$instance"}
(
node_memory_MemTotal{%(nodeExporterSelector)s, instance="$instance"}
-
node_memory_MemFree{%(nodeExporterSelector)s, instance="$instance"}
-
node_memory_Buffers{%(nodeExporterSelector)s, instance="$instance"}
-
node_memory_Cached{%(nodeExporterSelector)s, instance="$instance"}
)
||| % $._config, legendFormat='memory used'
))
.addTarget(prometheus.target('node_memory_Buffers{%(nodeExporterSelector)s, instance="$instance"}' % $._config, legendFormat='memory buffers'))
@ -60,10 +65,12 @@ local gauge = promgrafonnet.gauge;
local memoryGauge = gauge.new(
'Memory Usage',
|||
node_memory_MemAvailable{%(nodeExporterSelector)s, instance="$instance"}
(
node_memory_MemAvailable{%(nodeExporterSelector)s, instance="$instance"}
/
node_memory_MemTotal{%(nodeExporterSelector)s, instance="$instance"}
* 100
node_memory_MemTotal{%(nodeExporterSelector)s, instance="$instance"}
)
* 100
||| % $._config,
).withLowerBeingBetter();
@ -96,11 +103,13 @@ local gauge = promgrafonnet.gauge;
local diskSpaceUsage = gauge.new(
'Disk Space Usage',
|||
100 - (
sum(node_filesystem_free{%(nodeExporterSelector)s, device!="rootfs", instance="$instance"}
/
sum(node_filesystem_size{%(nodeExporterSelector)s, device!="rootfs", instance="$instance"}
) * 100
100 -
(
sum(node_filesystem_free{%(nodeExporterSelector)s, device!="rootfs", instance="$instance"}
/
sum(node_filesystem_size{%(nodeExporterSelector)s, device!="rootfs", instance="$instance"}
* 100
)
||| % $._config,
).withLowerBeingBetter();

View file

@ -44,9 +44,7 @@ local g = import 'grafana-builder/grafana.libsonnet';
g.panel('Disk IO Utilisation') +
// Full utilisation would be all disks on each node spending an average of
// 1 sec per second doing I/O, normalize by node count for stacked charts
g.queryPanel(|||
instance:node_disk_utilisation:sum_irate / scalar(sum(up{%(nodeExporterSelector)s}))
||| % $._config, '{{instance}}', legendLink) +
g.queryPanel('instance:node_disk_utilisation:sum_irate / scalar(sum(up{%(nodeExporterSelector)s}))' % $._config, '{{instance}}', legendLink) +
g.stack +
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
)

View file

@ -29,9 +29,11 @@
// Can go over 100%. >100% is bad.
record: 'instance:node_cpu_saturation_load1:',
expr: |||
sum by (instance) (node_load1{%(nodeExporterSelector)s})
(
sum by (instance) (node_load1{%(nodeExporterSelector)s})
/
instance:node_num_cpu:sum
instance:node_num_cpu:sum
)
||| % $._config,
},
{
@ -48,9 +50,9 @@
record: 'instance:node_memory_utilisation:ratio',
expr: |||
1 - (
node_memory_MemAvailable_bytes{%(nodeExporterSelector)s}
/
node_memory_MemTotal_bytes{%(nodeExporterSelector)s}
node_memory_MemAvailable_bytes{%(nodeExporterSelector)s}
/
node_memory_MemTotal_bytes{%(nodeExporterSelector)s}
)
||| % $._config,
},
@ -58,8 +60,9 @@
record: 'instance:node_memory_swap_io_bytes:sum_rate',
expr: |||
1e3 * sum by (instance) (
(rate(node_vmstat_pgpgin{%(nodeExporterSelector)s}[1m])
+ rate(node_vmstat_pgpgout{%(nodeExporterSelector)s}[1m]))
rate(node_vmstat_pgpgin{%(nodeExporterSelector)s}[1m])
+
rate(node_vmstat_pgpgout{%(nodeExporterSelector)s}[1m])
)
||| % $._config,
},
@ -85,8 +88,9 @@
record: 'instance:node_net_utilisation:sum_irate',
expr: |||
sum by (instance) (
(irate(node_network_receive_bytes_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m]) +
irate(node_network_transmit_bytes_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m]))
irate(node_network_receive_bytes_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m])
+
irate(node_network_transmit_bytes_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m])
)
||| % $._config,
},
@ -94,8 +98,9 @@
record: 'instance:node_net_saturation:sum_irate',
expr: |||
sum by (instance) (
(irate(node_network_receive_drop_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m]) +
irate(node_network_transmit_drop_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m]))
irate(node_network_receive_drop_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m])
+
irate(node_network_transmit_drop_total{%(nodeExporterSelector)s,device=~"eth[0-9]+"}[1m])
)
||| % $._config,
},