Skip to content

Commit

Permalink
docs/node-mixin: Improve memory pressure rule
Browse files Browse the repository at this point in the history
The `instance:node_memory_swap_io_pages:rate1m` rule was intended to
measure the amount of memory pressure a system is under, but its name is
a bit misleading (it specifically refers to swap), and the rate of
`node_vmstat_pgmajfault` is a better metric for memory pressure
(see prometheus#1524).

This commit renames `instance:node_memory_swap_io_pages:rate1m` to
`instance:node_vmstat_pgmajfault:rate1m`, and defines it as
`rate(node_vmstat_pgmajfault{%(nodeExporterSelector)s}[1m])`. The
dashboards are updated accordingly.

Signed-off-by: Benoît Knecht <[email protected]>
  • Loading branch information
BenoitKnecht authored and oblitorum committed Apr 9, 2024
1 parent 54fe723 commit d698337
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/node-mixin/dashboards/use.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ local g = import 'grafana-builder/grafana.libsonnet';
{ yaxes: g.yaxes({ format: 'percentunit', max: 1 }) },
)
.addPanel(
g.panel('Memory Saturation (Swapped Pages)') +
g.queryPanel('instance:node_memory_swap_io_pages:rate1m{%(nodeExporterSelector)s}' % $._config, '{{instance}}', legendLink) +
g.panel('Memory Saturation (Major Page Faults)') +
g.queryPanel('instance:node_vmstat_pgmajfault:rate1m{%(nodeExporterSelector)s}' % $._config, '{{instance}}', legendLink) +
g.stack +
{ yaxes: g.yaxes('rps') },
)
Expand Down Expand Up @@ -201,8 +201,8 @@ local g = import 'grafana-builder/grafana.libsonnet';
{ yaxes: g.yaxes('percentunit') },
)
.addPanel(
g.panel('Memory Saturation (pages swapped per second)') +
g.queryPanel('instance:node_memory_swap_io_pages:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Swap IO') +
g.panel('Memory Saturation (Major Page Faults)') +
g.queryPanel('instance:node_vmstat_pgmajfault:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Major page faults') +
{
yaxes: g.yaxes('short'),
legend+: { show: false },
Expand Down
8 changes: 2 additions & 6 deletions docs/node-mixin/rules/rules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@
||| % $._config,
},
{
record: 'instance:node_memory_swap_io_pages:rate1m',
record: 'instance:node_vmstat_pgmajfault:rate1m',
expr: |||
(
rate(node_vmstat_pgpgin{%(nodeExporterSelector)s}[1m])
+
rate(node_vmstat_pgpgout{%(nodeExporterSelector)s}[1m])
)
rate(node_vmstat_pgmajfault{%(nodeExporterSelector)s}[1m])
||| % $._config,
},
{
Expand Down

0 comments on commit d698337

Please sign in to comment.