You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow environment variables to be prefixed with either `DATADOG_` (old behavior) or `DD_` (new) in order to use the same configuration names as the Datadog Agent. Fixes#135.
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -50,8 +50,7 @@ There's also a longer [tutorial](https://dbader.org/blog/monitoring-your-nodejs-
50
50
51
51
### Datadog API key
52
52
53
-
Make sure the `DATADOG_API_KEY` environment variable is set to your Datadog
54
-
API key (you can also set it via the `apiKey` option in code). You can find the API key under [Integrations > APIs](https://app.datadoghq.com/account/settings#api). *Please note the API key is different from an **application key**. For more details, see [Datadog’s “API and Application Keys” docs](https://docs.datadoghq.com/account_management/api-app-keys/).*
53
+
Make sure the `DATADOG_API_KEY` or `DD_API_KEY` environment variable is set to your Datadog API key (you can also set it via the `apiKey` option in code). You can find the API key under [Integrations > APIs](https://app.datadoghq.com/account/settings#api). *Please note the API key is different from an **application key**. For more details, see [Datadog’s “API and Application Keys” docs](https://docs.datadoghq.com/account_management/api-app-keys/).*
55
54
56
55
### Module setup
57
56
@@ -121,10 +120,11 @@ Where `options` is an object and can contain the following:
* You can also set this via the `DATADOG_SITE` environment variable.
123
+
* You can also set this via the `DATADOG_SITE`or `DD_SITE`environment variable.
125
124
*`apiKey`: Sets the Datadog API key. (optional)
126
125
* It's usually best to keep this in an environment variable.
127
-
Datadog-metrics looks for the API key in `DATADOG_API_KEY` by default.
126
+
Datadog-metrics looks for the API key in the `DATADOG_API_KEY` or
127
+
`DD_API_KEY` environment variable by default.
128
128
* You must either set this option or the environment variable. An API key
129
129
is required to send metrics.
130
130
* Make sure not to confuse this with your _application_ key! For more
@@ -339,6 +339,8 @@ Contributions are always welcome! For more info on how to contribute or develop
339
339
* The `flush()` method now returns a promise.
340
340
* The `report(series)` method on any custom reporters should now return a promise. For now, datadog-metrics will use the old callback-based behavior if the method signature has callbacks listed after `series` argument.
341
341
342
+
* Environment variables can now be prefixed with *either*`DATADOG_` or `DD_` (previously, only `DATADOG_` worked) in order to match configuration with the Datadog agent. For example, you can set your API key via `DATADOG_API_KEY` or `DD_API_KEY`.
343
+
342
344
**Bug Fixes:**
343
345
344
346
* Support setting the `site` option via the `DATADOG_SITE` environment variable. The `apiHost` option was renamed to `site` in v0.11.0, but the `DATADOG_API_HOST` environment variable was accidentally left as-is. The old environment variable name is now deprecated, and will be removed at the same time as the `apiHost` option is removed.
0 commit comments