Skip to content

Commit dc85436

Browse files
committed
[disk] Improve denylisting messages and defaults
1 parent f9fac0c commit dc85436

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

disk/datadog_checks/disk/data/conf.yaml.default

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,19 @@ instances:
4444
## start matching from the beginning and therefore to match anywhere you
4545
## must prepend `.*`. For exact matches append `$`.
4646
##
47+
## Some Linux kernel RAM-based filesystems are included here by default;
48+
## remove them and adjust permissions if you want to keep track of them.
49+
##
50+
## Add the 'overlay' filesystem here to ignore Docker volumes on the host.
51+
##
4752
## When conflicts arise, this will override `file_system_whitelist`.
4853
#
49-
# file_system_blacklist:
50-
# - tmpfs$
51-
# - rootfs$
52-
# - autofs$
54+
file_system_blacklist:
55+
- configfs$
56+
- debugfs$
57+
- securityfs$
58+
- sysfs$
59+
- tracefs$
5360

5461
## @param device_whitelist - list of strings - optional
5562
## Instruct the check to only collect from matching devices.
@@ -83,7 +90,7 @@ instances:
8390
## anywhere you must prepend `.*`. For exact matches append `$`.
8491
#
8592
# mount_point_whitelist:
86-
# - /dev/sda[1-3]
93+
# - /mnt/device
8794
# - 'C:'
8895

8996
## @param mount_point_blacklist - list of strings - optional

disk/datadog_checks/disk/disk.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ def check(self, instance):
8888
)
8989
continue
9090
except Exception as e:
91-
self.log.warning('Unable to get disk metrics for %s: %s', part.mountpoint, e)
91+
self.log.warning(
92+
u'Unable to get disk metrics for %s: %s. '
93+
u'You can exclude this mountpoint in the settings if it is invalid.',
94+
part.mountpoint,
95+
e,
96+
)
9297
continue
9398

9499
# Exclude disks with size less than min_disk_size
@@ -147,7 +152,6 @@ def _exclude_disk(self, device, file_system, mount_point):
147152
"""
148153
Return True for disks we don't want or that match regex in the config file
149154
"""
150-
self.log.debug('_exclude_disk: %s, %s, %s', device, file_system, mount_point)
151155

152156
if not device or device == 'none':
153157
device = None
@@ -245,7 +249,12 @@ def _collect_inodes_metrics(self, mountpoint):
245249
)
246250
return metrics
247251
except Exception as e:
248-
self.log.warning('Unable to get disk metrics for %s: %s', mountpoint, e)
252+
self.log.warning(
253+
u'Unable to get disk metrics for %s: %s. '
254+
u'You can exclude this mountpoint in the settings if it is invalid.',
255+
mountpoint,
256+
e,
257+
)
249258
return metrics
250259

251260
if inodes.f_files != 0:

0 commit comments

Comments
 (0)