Added `_excluding_lo` to name of network rules that exclude lo

Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
beorn7 2019-07-22 20:21:52 +02:00
parent 36dc7451c9
commit 79f0357e38
2 changed files with 12 additions and 14 deletions

View File

@ -90,8 +90,8 @@ local g = import 'grafana-builder/grafana.libsonnet';
g.panel('Net Utilisation (Bytes Receive/Transmit)') + g.panel('Net Utilisation (Bytes Receive/Transmit)') +
g.queryPanel( g.queryPanel(
[ [
'instance:node_network_receive_bytes:rate1m{%(nodeExporterSelector)s}' % $._config, 'instance:node_network_receive_bytes_excluding_lo:rate1m{%(nodeExporterSelector)s}' % $._config,
'-instance:node_network_transmit_bytes:rate1m{%(nodeExporterSelector)s}' % $._config, '-instance:node_network_transmit_bytes_excluding_lo:rate1m{%(nodeExporterSelector)s}' % $._config,
], ],
['{{instance}} Receive', '{{instance}} Transmit'], ['{{instance}} Receive', '{{instance}} Transmit'],
legendLink, legendLink,
@ -103,8 +103,8 @@ local g = import 'grafana-builder/grafana.libsonnet';
g.panel('Net Saturation (Drops Receive/Transmit)') + g.panel('Net Saturation (Drops Receive/Transmit)') +
g.queryPanel( g.queryPanel(
[ [
'instance:node_network_receive_drop:rate1m{%(nodeExporterSelector)s}' % $._config, 'instance:node_network_receive_drop_excluding_lo:rate1m{%(nodeExporterSelector)s}' % $._config,
'-instance:node_network_transmit_drop:rate1m{%(nodeExporterSelector)s}' % $._config, '-instance:node_network_transmit_drop_excluding_lo:rate1m{%(nodeExporterSelector)s}' % $._config,
], ],
['{{instance}} Receive', '{{instance}} Transmit'], ['{{instance}} Receive', '{{instance}} Transmit'],
legendLink, legendLink,
@ -187,8 +187,8 @@ local g = import 'grafana-builder/grafana.libsonnet';
g.panel('Net Utilisation (Bytes Receive/Transmit)') + g.panel('Net Utilisation (Bytes Receive/Transmit)') +
g.queryPanel( g.queryPanel(
[ [
'instance:node_network_receive_bytes:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'instance:node_network_receive_bytes_excluding_lo:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
'-instance:node_network_transmit_bytes:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, '-instance:node_network_transmit_bytes_excluding_lo:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
], ],
['Receive', 'Transmit'], ['Receive', 'Transmit'],
) + ) +
@ -198,8 +198,8 @@ local g = import 'grafana-builder/grafana.libsonnet';
g.panel('Net Saturation (Drops Receive/Transmit)') + g.panel('Net Saturation (Drops Receive/Transmit)') +
g.queryPanel( g.queryPanel(
[ [
'instance:node_network_receive_drop:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'instance:node_network_receive_drop_excluding_lo:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
'-instance:node_network_transmit_drop:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, '-instance:node_network_transmit_drop_excluding_lo:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config,
], ],
['Receive drops', 'Transmit drops'], ['Receive drops', 'Transmit drops'],
) + ) +

View File

@ -73,10 +73,8 @@
rate(node_disk_io_time_weighted_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[1m]) rate(node_disk_io_time_weighted_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[1m])
||| % $._config, ||| % $._config,
}, },
// TODO: For the following rules, consider configurable filtering to exclude more network
// device names than just "lo".
{ {
record: 'instance:node_network_receive_bytes:rate1m', record: 'instance:node_network_receive_bytes_excluding_lo:rate1m',
expr: ||| expr: |||
sum without (device) ( sum without (device) (
rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m]) rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m])
@ -84,7 +82,7 @@
||| % $._config, ||| % $._config,
}, },
{ {
record: 'instance:node_network_transmit_bytes:rate1m', record: 'instance:node_network_transmit_bytes_excluding_lo:rate1m',
expr: ||| expr: |||
sum without (device) ( sum without (device) (
rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m]) rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m])
@ -93,7 +91,7 @@
}, },
// TODO: Find out if those drops ever happen on modern switched networks. // TODO: Find out if those drops ever happen on modern switched networks.
{ {
record: 'instance:node_network_receive_drop:rate1m', record: 'instance:node_network_receive_drop_excluding_lo:rate1m',
expr: ||| expr: |||
sum without (device) ( sum without (device) (
rate(node_network_receive_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m]) rate(node_network_receive_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m])
@ -101,7 +99,7 @@
||| % $._config, ||| % $._config,
}, },
{ {
record: 'instance:node_network_transmit_drop:rate1m', record: 'instance:node_network_transmit_drop_excluding_lo:rate1m',
expr: ||| expr: |||
sum without (device) ( sum without (device) (
rate(node_network_transmit_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m]) rate(node_network_transmit_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m])