chef-datadog icon indicating copy to clipboard operation
chef-datadog copied to clipboard

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

Open haidangwa opened this issue 7 years ago • 2 comments

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')

haidangwa avatar Jul 13 '17 15:07 haidangwa

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.

olivielpeau avatar Feb 13 '18 17:02 olivielpeau

That sounds reasonable to replicate the logic you have. I'll take a look at our code. It shouldn't be difficult to replicate.

On Tue, Feb 13, 2018 at 9:58 AM, Olivier Vielpeau [email protected] wrote:

Hi @haidangwa https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DataDog/chef-datadog/issues/451#issuecomment-365350225, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2A7YQgVyjxgYsCaz6Mm81zrlfA2tdHks5tUc1IgaJpZM4OXL0z .

haidangwa avatar Feb 13 '18 19:02 haidangwa