Version 0.12.0
Datadog-metrics now automatically retries failed metric submissions and uses promises for asynchronous actions! There are a handful of other deprecations and small improvements.
Breaking Changes:
- The
DatadogReporter
constructor now takes an options object instead of positional arguments. Using this constructor directly is pretty rare, so this should not affect most users. (#138)
New Features:
-
Promises: asynchronous actions now use promises instead of callbacks. Callbacks are deprecated, but still work — they’ll be fully removed in v0.13.0. This affects:
- The
flush()
method now returns a promise. - 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 afterseries
argument.
(See #125)
- The
-
Retries: flushes to Datadog’s API are now retried automatically. This can help you work around intermittent network issues or rate limits. To adjust retries, use the
retries
andretryBackoff
options.metrics.init({ // How many times to retry. To disable retries, set this to 0. retries: 2, // How long (in seconds) to wait between retries. Subsequent retries // wait exponentially longer. retryBackoff: 1 });
(See #138)
-
Environment variables: you can now use either
DATADOG_
orDD_
prefixes for environment variables (previously, onlyDATADOG_
worked). For example, you can set your API key viaDATADOG_API_KEY
orDD_API_KEY
. (#137)
Deprecations:
-
The
appKey
option is no longer supported. Application keys (as opposed to API keys) are not actually needed for sending metrics or distributions to the Datadog API. Including it in your configuration adds no benefits, but risks exposing a sensitive credential. (#127) -
The
DATADOG_API_HOST
environment variable is now deprecated. Please useDATADOG_SITE
orDD_SITE
instead (theapiHost
option was renamed tosite
in v0.11.0, but theDATADOG_API_HOST
environment variable was accidentally left as-is). (#134)