Skip to content

Commit

Permalink
Added debug logs for
Browse files Browse the repository at this point in the history
- every disk partition check from psutil
- excluded disk with size less than configured min disk size

Signed-off-by: Vivekanand Ilango <vivekanand.ilango@datadoghq.com>
  • Loading branch information
vivek-datadog committed Jun 5, 2023
1 parent b826b74 commit 50c2451
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions disk/datadog_checks/disk/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def check(self, _):
self.devices_label = self._get_devices_label()

for part in psutil.disk_partitions(all=self._include_all_devices):
self.log.debug('Checking device %s', part.device)
# we check all exclude conditions
if self.exclude_disk(part):
self.log.debug('Excluding device %s', part.device)
Expand Down Expand Up @@ -142,6 +143,7 @@ def check(self, _):

# Exclude disks with size less than min_disk_size
if disk_usage.total <= self._min_disk_size:
self.log.debug('Excluding device %s with total disk size %s', part.device, disk_usage.total)
if disk_usage.total > 0:
self.log.info('Excluding device %s with total disk size %s', part.device, disk_usage.total)
continue
Expand Down

0 comments on commit 50c2451

Please sign in to comment.