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

Add support for 'site' option. #582

Merged
merged 9 commits into from
Apr 26, 2019
Merged

Add support for 'site' option. #582

merged 9 commits into from
Apr 26, 2019

Conversation

remeh
Copy link
Contributor

@remeh remeh commented Feb 18, 2019

Agent 6.9.0 has a new option site to configure on which site (US/EU) the Agent data should be sent, simplifying the configuration process by avoiding to type complete URLs in the url configuration field.

This pull-requests adds the attribute site in the Chef cookbook in order to use this option by default instead of the url one.

Note that it doesn't remove anything about the url configuration field has it's still supported and has priority on the site value.

The use of DATADOG_HOST has been removed: it was used by the chef-handler-datadog recipe to set the datadog host to use, however, the ruby lib dogapi-rb used already has a correct default value if DATADOG_HOST was not set and on top of that: DataDog/chef-handler-datadog#103 makes sure that a default value is set directly inside the recipe instead of in the ruby lib dogapi-rb.

@remeh remeh added this to the 2.17.0 milestone Feb 18, 2019
@remeh remeh added the feature label Feb 18, 2019
@remeh remeh force-pushed the remeh/site-option branch from d3aaed9 to c346b10 Compare February 18, 2019 11:02
attributes/default.rb Outdated Show resolved Hide resolved
attributes/default.rb Outdated Show resolved Hide resolved
attributes/default.rb Show resolved Hide resolved
@remeh remeh force-pushed the remeh/site-option branch from bef1e43 to 9339625 Compare February 20, 2019 18:45
Copy link
Member

@olivielpeau olivielpeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments, let me know what you think.

I think we should avoid storing values in the run_state (see related comments). If we do end up using it, I think we should use the key ['datadog']['dd_url'] instead.

recipes/dd-agent.rb Outdated Show resolved Hide resolved
recipes/dd-handler.rb Outdated Show resolved Hide resolved
attributes/default.rb Outdated Show resolved Hide resolved
@remeh remeh modified the milestones: 2.17.0, 3.0 Feb 26, 2019
For dd-handler:
  - Use node['datadog']['url']
  - If nil, use https://app.datadoghq.com

For Agent 5:
  - Use node['datadog']['url']
  - If nil, use https://app.datadoghq.com

For Agent 6 (additional endpoints):
  - Use node['datadog']['site'] value to infer an intake url
  - If nil, use node['datadog']['url']
  - If nil, use https://app.datadoghq.com

For Agent 6 (dd_url / site):
  - Let the Agent decide by not setting the value in datadog.yaml
@remeh remeh force-pushed the remeh/site-option branch from 977ee66 to 500afa8 Compare February 26, 2019 13:41
Copy link
Member

@olivielpeau olivielpeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! 😄

A few inline nits, and let's change the default value of the attribute node['datadog']['process_agent']['url'] to nil. When it's set, the attribute is only written for the Agent v6's datadog.yaml so there should be no need for additional changes.

attributes/default.rb Outdated Show resolved Hide resolved
recipes/dd-handler.rb Outdated Show resolved Hide resolved
attributes/default.rb Show resolved Hide resolved
@olivielpeau
Copy link
Member

also, can you add a short explanation in the PR description about why you can remove DATADOG_HOST?

@remeh remeh merged commit dc81934 into master Apr 26, 2019
@remeh remeh deleted the remeh/site-option branch April 26, 2019 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants