Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check to consul.yaml.erb for 'tags:' #479

merged 1 commit into from Nov 29, 2017


None yet
2 participants
Copy link

grogancolin commented Oct 11, 2017

I noticed when you don't pass a tag to
default['datadog']['consul']['instances'], it prints an empty tags section.

  - url:
    new_leader_checks: false
    catalog_checks: true
    service_whitelist: []

This messes up with this line in the check.

The consul check is then failing with

2017-10-11 10:52:32 UTC | ERROR | dd.collector | checks.consul( | Check 'consul' instance #0 failed
Traceback (most recent call last):
  File "/opt/datadog-agent/agent/checks/", line 797, in run
  File "/opt/datadog-agent/agent/checks.d/", line 240, in check
    for tag in instance.get('tags', []):
TypeError: 'NoneType' object is not iterable

This adds an extra check to the template so it also checks if the 'tags' section actually has elements.

Added check to consul.yaml.erb for 'tags:'
I noticed when you don't pass a tag to
`default['datadog']['consul']['instances']`, it prints an empty


section in the yaml.
This messes up with the templated code, as to the yaml parser,
    the tag exists, it's just not an array, so
    [this](] line fails.
Copy link

olivielpeau left a comment

👌 Good catch @grogancolin, thanks!

@olivielpeau olivielpeau added this to the 2.13.0 milestone Nov 29, 2017

@olivielpeau olivielpeau merged commit 584ee00 into DataDog:master Nov 29, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.