One of the statistic sources which is collected by node_exporter is the vmstat source. This is called the 'vmstat collector' by node_exporter, and it exports the linux
/proc/vmstat file statistics.
However, that is not the full story. I was looking for some specific vmstat statistics in the node exporter, and couldn't find these. The specific statistics I was looking for were 'allocstall*', 'pgscan*' and 'pgsteal*'. Because I was pretty sure these exist, I then gone to the linux system and looked in the
/proc/vmstat file. And there they were... That begs the question: what is going on?
It turns out that for each specific collector, there is a default setting which turns it on or off. Most collectors are turned on, some are turned off by default, such as collector.perf, collector.ntp, collector.cgroups to name a few.
On top of the enable or disable switch, some of the collectors have one or more configuration options. One of these is, you probably guessed it by now, the vmstat collector, or
collector.vmstat, for which the configuration switch is aptly named
collector.vmstat.fields, which makes it obvious that only certain fields can be selected.
collector.vmstat.fields setting with node_exporter version 1.5.0 is:
^(oom_kill|pgpg|pswp|pg.*fault).*. For those of you that speak regex, this makes it obvious: this does NOT include the statistics that I was searching for above, and the reason is this regex that filters only very specific fields.
To enable additional fields to be shown/exporter by node exporter, add the
--collector.vmstat.fields flag to the startup command of node exporter, and set the regex to include the additional fields: