r/collectd: Ignore overlay filesystems

By default, the *df* pluggin for collectd, which monitors filesystem
usage, collects data about all mounted filesystems.  It can be
configured to ignore some filesystems, either by mount point, device, or
filesystem type.  We will uses this capability to avoid collecting data
about OverlayFS mounts, because by definition, they do not represent a
real filesystem, but one or more other mounted filesystems.  Collecting
data about these just creates useless metrics, especially on machines
that run containers.
btop
Dustin 2022-08-03 21:01:32 -05:00
parent 870baa3fcf
commit 8cab0b368e
3 changed files with 20 additions and 0 deletions

View File

@ -2,6 +2,8 @@ collectd_default_config: true
collectd_load_network_plugin: false
collectd_network_servers: []
collectd_network_listen: []
collectd_df_ignore_fstype:
- overlay
collectd_plugins: {}

View File

@ -50,6 +50,16 @@
- collectd-config
- collectd-typesdb
- name: ensure collectd df plugin is configured
template:
src: collectd-df.conf.j2
dest: /etc/collectd.d/df.conf
mode: 'u=rw,go=r'
notify: restart collectd
tags:
- collectd-config
- collectd-df
- name: ensure collectd unixsock plugin is configured
template:
src: collectd-unixsock.conf.j2

View File

@ -0,0 +1,8 @@
{% if collectd_df_ignore_fstype %}
<Plugin df>
{% for fstype in collectd_df_ignore_fstype %}
FSType {{ fstype }}
{% endfor %}
IgnoreSelected true
</Plugin>
{% endif %}