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

https://github.com/DataDog/chef-datadog/blob/master/attributes/default.rb#L34-L37 should be commented out #451

Open
haidangwa opened this issue Jul 13, 2017 · 2 comments

Comments

@haidangwa
Copy link

haidangwa commented Jul 13, 2017

https://github.com/DataDog/chef-datadog/blob/master/attributes/default.rb#L34-L37 show an example of configuring extra endpoints for an agent, like so:

default['datadog']['extra_endpoints']['prod']

However, we've never had the need for this actually being in our extra endpoints. This is slightly problematic when we're iterating through node['datadog']['extra_endpoints'] and we have to remember to skip the prod key. Multiply that by several times if we're iterating extra_endpoints more than once and one can see how this is asking for a bug.

We literally have dirty code like this to workaround the issue: node.rm('datadog', 'extra_endpoints', 'prod')

@olivielpeau
Copy link
Member

Hi @haidangwa, sorry I'm only looking at your issue now.

The cookbook's logic here is to ignore any endpoint defined in node['datadog']['extra_endpoints'] for which the nested key enabled is not explicitly set to true (https://github.com/DataDog/chef-datadog/blob/v2.13.0/recipes/dd-agent.rb#L70-L78).

This allows more flexibility if you're defining your endpoints at a high level (for example in the environment), but then want to enable/disable some of these endpoints at a lower level (for example per node or per role).

If your logic is using these attributes it should probably replicate that logic. Let me know how that sounds.

@haidangwa
Copy link
Author

haidangwa commented Feb 13, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants