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.
This commit is contained in:
@@ -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: {}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
8
roles/collectd/templates/collectd-df.conf.j2
Normal file
8
roles/collectd/templates/collectd-df.conf.j2
Normal 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 %}
|
||||
Reference in New Issue
Block a user