From 283a16316aea3e4447922bd6cfcef427f0773a56 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 6 May 2020 11:25:21 -0700 Subject: [PATCH] Update datadog output documentation (#7467) --- plugins/outputs/datadog/README.md | 31 +++++++++++++++++++++++++----- plugins/outputs/datadog/datadog.go | 8 ++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/plugins/outputs/datadog/README.md b/plugins/outputs/datadog/README.md index 0563d6444..ad1c7a025 100644 --- a/plugins/outputs/datadog/README.md +++ b/plugins/outputs/datadog/README.md @@ -1,9 +1,30 @@ # Datadog Output Plugin -This plugin writes to the [Datadog Metrics API](http://docs.datadoghq.com/api/#metrics) -and requires an `apikey` which can be obtained [here](https://app.datadoghq.com/account/settings#api) -for the account. +This plugin writes to the [Datadog Metrics API][metrics] and requires an +`apikey` which can be obtained [here][apikey] for the account. -If the point value being sent cannot be converted to a float64, the metric is skipped. -Metrics are grouped by converting any `_` characters to `.` in the Point Name. \ No newline at end of file +### Configuration + +```toml +[[outputs.datadog]] + ## Datadog API key + apikey = "my-secret-key" + + ## Connection timeout. + # timeout = "5s" + + ## Write URL override; useful for debugging. + # url = "https://app.datadoghq.com/api/v1/series" +``` + +### Metrics + +Datadog metric names are formed by joining the Telegraf metric name and the field +key with a `.` character. + +Field values are converted to floating point numbers. Strings and floats that +cannot be sent over JSON, namely NaN and Inf, are ignored. + +[metrics]: https://docs.datadoghq.com/api/v1/metrics/#submit-metrics +[apikey]: https://app.datadoghq.com/account/settings#api diff --git a/plugins/outputs/datadog/datadog.go b/plugins/outputs/datadog/datadog.go index 736570726..2d1a93788 100644 --- a/plugins/outputs/datadog/datadog.go +++ b/plugins/outputs/datadog/datadog.go @@ -25,13 +25,13 @@ type Datadog struct { 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" + apikey = "my-secret-key" ## Connection timeout. # timeout = "5s" + + ## Write URL override; useful for debugging. + # url = "https://app.datadoghq.com/api/v1/series" ` type TimeSeries struct {