-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
#4624 Add the ability to specify a custom datadog URL #4800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this will be a nice addition
plugins/outputs/datadog/datadog.go
Outdated
func (d *Datadog) Connect() error { | ||
if d.Apikey == "" { | ||
return fmt.Errorf("apikey is a required field for datadog output") | ||
} | ||
|
||
if d.URL == "" { | ||
d.URL = datadog_api |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this in the init() function and then it will be overridden automatically when the plugin in loaded.
plugins/outputs/datadog/datadog.go
Outdated
client *http.Client | ||
} | ||
|
||
var sampleConfig = ` | ||
## Datadog API key | ||
apikey = "my-secret-key" # required. | ||
|
||
# The base endpoint URL can optionally be specified but it defaults to: | ||
url = "https://app.datadoghq.com/api/v1/series" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment this line out since it won't usually need to be set:
## The base endpoint URL can optionally be specified but it defaults to:
# url = "https://app.datadoghq.com/api/v1/series"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url = "https://app.datadoghq.com/api/v1/series" | |
url = "https://app.datadoghq.com/api/v1/series" |
If the user is using an open source datadog-agent, this will be very useful to specify the url if they don't want to send the metrics to datadoghq.
For example:
/var/lib/dcos/telegraf/telegraf.d
[centos@x.x.x.x telegraf.d]$ cat datadog.conf
# Transmit all metrics to Datadog
[[outputs.datadog]]
## Datadog API key
apikey = "redacted"
## Connection timeout
# timeout = "5s"
## URL
url = "http://custom_url:443/api/v1/metrics"```
981fdf0
to
b987934
Compare
@danielnelson I've incorporated your feedback, thanks for your time! |
closes #4624
Required for all PRs:
The existing tests covered this behavior