Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion disk/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ files:
- name: file_system_whitelist
description: |
Instruct the check to only collect from matching file systems.

Character casing is ignored. For convenience, the regular expressions
start matching from the beginning and therefore to match anywhere you
must prepend `.*`. For exact matches append `$`.
Expand Down Expand Up @@ -54,6 +54,15 @@ files:
type: array
items:
type: string
- name: file_system_global_blacklist
Comment thread
ofek marked this conversation as resolved.
Outdated
description: |
Instruct the check to always add these patterns to `file_system_blacklist`.
value:
example:
- iso9660$
type: array
items:
type: string
- name: device_whitelist
description: |
Instruct the check to only collect from matching devices.
Expand Down Expand Up @@ -84,6 +93,14 @@ files:
type: array
items:
type: string
- name: device_global_blacklist
description: |
Instruct the check to always add these patterns to `device_blacklist`.
value:
example: []
type: array
items:
type: string
- name: mount_point_whitelist
description: |
Instruct the check to only collect from matching mount points.
Expand Down Expand Up @@ -113,6 +130,14 @@ files:
type: array
items:
type: string
- name: mount_point_global_blacklist
description: |
Instruct the check to always add these patterns to `mount_point_blacklist`.
value:
example: []
type: array
items:
type: string
- name: include_all_devices
description: |
Instruct the check to collect from all devices, including non-physical devices.
Expand Down
16 changes: 16 additions & 0 deletions disk/datadog_checks/disk/data/conf.yaml.default
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ instances:
# - rootfs$
# - autofs$

## @param file_system_global_blacklist - list of strings - optional
## Instruct the check to always add these patterns to `file_system_blacklist`.
#
# file_system_global_blacklist:
# - iso9660$

## @param device_whitelist - list of strings - optional
## Instruct the check to only collect from matching devices.
##
Expand All @@ -78,6 +84,11 @@ instances:
# - /dev/sde
# - '[FJ]:'

## @param device_global_blacklist - list of strings - optional
## Instruct the check to always add these patterns to `device_blacklist`.
#
# device_global_blacklist: []

## @param mount_point_whitelist - list of strings - optional
## Instruct the check to only collect from matching mount points.
##
Expand All @@ -101,6 +112,11 @@ instances:
# - /dev/sde
# - '[FJ]:'

## @param mount_point_global_blacklist - list of strings - optional
## Instruct the check to always add these patterns to `mount_point_blacklist`.
#
# mount_point_global_blacklist: []

## @param include_all_devices - boolean - optional - default: true
## Instruct the check to collect from all devices, including non-physical devices.
## Set this to false to exclude pseudo, memory, duplicate or inaccessible file systems.
Expand Down
26 changes: 22 additions & 4 deletions disk/datadog_checks/disk/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,13 @@ def collect_latency_metrics(self):
self.log.debug('Latency metrics not collected for %s: %s', disk_name, e)

def _compile_pattern_filters(self, instance):
# Force exclusion of CDROM (iso9660)
file_system_blacklist_extras = ['iso9660$']
device_blacklist_extras = []
mount_point_blacklist_extras = []
file_system_blacklist_extras = instance.get(
'file_system_global_blacklist', self.get_default_file_system_blacklist()
)
device_blacklist_extras = instance.get('device_global_blacklist', self.get_default_device_blacklist())
mount_point_blacklist_extras = instance.get(
'mount_point_global_blacklist', self.get_default_mount_mount_blacklist()
)

deprecation_message = '`%s` is deprecated and will be removed in a future release. Please use `%s` instead.'

Expand Down Expand Up @@ -421,3 +424,18 @@ def _get_devices_label_from_blkid_cache(self):
)

return devices_label

@staticmethod
def get_default_file_system_blacklist():
return [
# CDROM
'iso9660$',
Comment thread
pducolin marked this conversation as resolved.
]

@staticmethod
def get_default_device_blacklist():
return []

@staticmethod
def get_default_mount_mount_blacklist():
return []