mem

Reference for the `mem` collector.

mem · collector · run nanook doc mem for the same content in your terminal.

System memory and swap usage.

Metrics

MetricKindUnitDescription
mem.totalnumericbytestotal memory in bytes
mem.usednumericbytesused memory in bytes
mem.freenumericbytesfree memory in bytes
mem.availablenumericbytesavailable memory in bytes
mem.usagenumeric%memory usage percentage
swap.totalnumericbytestotal swap in bytes
swap.usednumericbytesused swap in bytes

Examples

Collect every 10s

[[collectors]]
name = "mem"
interval = 10

Low free memory

[[alerts]]
expr = "mem.free < 500MB"
count = 3
channel = "ops"

Memory saturation

[[alerts]]
expr = "mem.usage > 90%"
count = 6               # ~1 minute at 10s interval
channel = "ops"
escalate = { after = 600, channel = "oncall" }

Swap pressure

[[alerts]]
expr = "swap.used > 100MB"
count = 6
channel = "ops"