Skip to content

Commit

Permalink
Check dogstatsd mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
coignetp committed Aug 5, 2020
1 parent 6379c29 commit 3016db7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions consul/datadog_checks/consul/consul.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ def __init__(self, name, init_config, instances):

def _is_dogstatsd_configured(self):
""" Check if the agent has a consul dogstatsd profile configured """
for profile in datadog_agent.get_config('dogstatsd_mapper_profiles'):
if profile.get('name') == 'consul':
return True
dogstatsd_mapper = datadog_agent.get_config('dogstatsd_mapper_profiles')
if dogstatsd_mapper:
for profile in dogstatsd_mapper:
if profile.get('name') == 'consul':
return True
return False

def consul_request(self, endpoint):
Expand Down

0 comments on commit 3016db7

Please sign in to comment.