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

Set DATADOG_HOST according to DD_SITE or DD_DD_URL when MetricsProvider is enabled. Resolves #103 #104

Merged
merged 2 commits into from
May 30, 2020

Conversation

mantoine96
Copy link
Contributor

What does this PR do?

This PR creates a DATADOG_HOST environment variable that is defined when metricsProviderEnabled = true, as the client used to fetch the metrics from Datadog doesn't recognize either DD_SITE or DD_DD_URL.

It:

  • Create a const DatadogHost that corresponds to the DATADOG_HOST environment variable name
  • Adds a getDatadogHost method to pkg/controller/datadogagent/clusteragent.go
  • Creates the DATADOG_HOST environment variable when metricsProviderEnabled is true

Motivation

Addressing issue #103

Additional Notes

@mantoine96 mantoine96 requested a review from a team as a code owner May 28, 2020 14:23
@codecov-commenter
Copy link

codecov-commenter commented May 28, 2020

Codecov Report

Merging #104 into master will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   57.19%   57.29%   +0.10%     
==========================================
  Files          31       31              
  Lines        4175     4185      +10     
==========================================
+ Hits         2388     2398      +10     
  Misses       1606     1606              
  Partials      181      181              
Flag Coverage Δ
#unittests 57.29% <100.00%> (+0.10%) ⬆️
Impacted Files Coverage Δ
pkg/controller/datadogagent/clusteragent.go 75.17% <100.00%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7850164...bc438ba. Read the comment docs.

Copy link
Collaborator

@clamoriniere clamoriniere left a comment

Choose a reason for hiding this comment

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

Looks great!
Just a small comment.

Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>
@mantoine96
Copy link
Contributor Author

@clamoriniere Thanks! Addressed your requested change!

@clamoriniere clamoriniere merged commit 751bbe2 into DataDog:master May 30, 2020
gtseres pushed a commit to gtseres/datadog-operator that referenced this pull request Jun 1, 2020
…er is enabled. Resolves DataDog#103 (DataDog#104)

* Set DATADOG_HOST according to DD_SITE or DD_DD_URL when MetricsProvider is enabled. Resolves DataDog#103

Co-authored-by: Cedric Lamoriniere <cedric.lamoriniere@datadoghq.com>
@onpaws onpaws mentioned this pull request Aug 6, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants