Skip to content

Commit 20e90c9

Browse files
committed
Add timeout config on _collect_inode_metrics
1 parent 670ec6f commit 20e90c9

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

disk/datadog_checks/disk/disk.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,14 @@ def _collect_inodes_metrics(self, mountpoint):
235235
metrics = {}
236236
# we need to timeout this, too.
237237
try:
238-
inodes = timeout(5)(os.statvfs)(mountpoint)
238+
inodes = timeout(self._timeout)(os.statvfs)(mountpoint)
239239
except TimeoutException:
240-
self.log.warning(u'Timeout while retrieving the disk usage of `%s` mountpoint. Skipping...', mountpoint)
240+
self.log.warning(
241+
u'Timeout after %d seconds while retrieving the disk usage of `%s` mountpoint. '
242+
u'You might want to change the timeout length in the settings.',
243+
self._timeout,
244+
mountpoint,
245+
)
241246
return metrics
242247
except Exception as e:
243248
self.log.warning('Unable to get disk metrics for %s: %s', mountpoint, e)

0 commit comments

Comments
 (0)