Skip to content

Commit

Permalink
Undefined error with env variable DATADOG_API_HOST (#103)
Browse files Browse the repository at this point in the history
This fixes an issue where setting the `DATADOG_API_HOST` environment variable instead of the `apiHost` option in JavaScript code caused an exception.
  • Loading branch information
npeters authored Oct 15, 2022
1 parent e116612 commit b842b55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ npm test
* This package no longer locks specific versions of its dependencies (instead, your package manager can choose any version that is compatible). This may help when deduplicating packages for faster installs or smaller bundles. (Thanks to @Mr0grog.)

* FIX: Don’t use `unref()` on timers in non-Node.js environments. This is a step towards browser compatibility, although we are not testing browser-based usage yet. (Thanks to @Mr0grog.)
* FIX: The `apiHost` option was broken in v0.10.0 and now works again. (Thanks to @Mr0grog.)
* FIX: The `apiHost` option was broken in v0.10.0 and now works again. (Thanks to @Mr0grog, @npeters.)
* FIX: Creating a second instance of `BufferedMetricsLogger` will not longer change the credentials used by previously created `BufferedMetricsLogger` instances.
* INTERNAL: Renamed the default branch in this repo to `main`. (Thanks to @dbader.)
* INTERNAL: Use GitHub actions for continuous integration. (Thanks to @Mr0grog.)
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function DataDogReporter(apiKey, appKey, apiHost) {
// Strip leading `app.` from the site in case someone copy/pasted the
// URL from their web browser. More details on correct configuration:
// https://docs.datadoghq.com/getting_started/site/#access-the-datadog-site
this.apiHost = apiHost.replace(/^app\./i, '');
this.apiHost = this.apiHost.replace(/^app\./i, '');
datadogApiClient.client.setServerVariables(configuration, {
site: this.apiHost
});
Expand Down

0 comments on commit b842b55

Please sign in to comment.