Skip to content

Commit

Permalink
Handle timeout backward compatibility default_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTChen committed Aug 4, 2019
1 parent 3fec271 commit 1d4e10b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fluentd/datadog_checks/fluentd/fluentd.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ class Fluentd(AgentCheck):

def __init__(self, name, init_config, instances):
super(Fluentd, self).__init__(name, init_config, instances)
self.default_timeout = init_config.get('default_timeout', self.DEFAULT_TIMEOUT)
if not ('read_timeout' in self.instance or 'connect_timeout' in self.instance):
# `default_timeout` config option will be removed with Agent 5
self.http.options['timeout'] = (
self.instance.get('timeout')
or self.init_config.get('timeout')
or self.init_config.get('default_timeout')
or self.DEFAULT_TIMEOUT
)

"""Tracks basic fluentd metrics via the monitor_agent plugin
* number of retry_count
Expand Down

0 comments on commit 1d4e10b

Please sign in to comment.