From 7bbc47c3e2e371bd0af8742af87853b06a48e29a Mon Sep 17 00:00:00 2001 From: Andrea Catalucci <133665309+acatalucci-synth@users.noreply.github.com> Date: Thu, 28 Sep 2023 21:57:58 +0200 Subject: [PATCH] chore: update api usage (#112) Recent versions of `@datadog/datadog-api-client` have deprecated one of the configuration methods we use, so this updates the minimum required version of that package and switches to the new configuration method. (There are no other breaking changes or differences in Node.js requirements, so this is safe.) --- README.md | 6 ++++++ lib/reporters.js | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7084a6b..923cfc3 100644 --- a/README.md +++ b/README.md @@ -300,8 +300,14 @@ npm test * (In Development) + **New Features:** + * Nothing yet! + **Fixes & Maintenance:** + + * Resolve a deprecation warning from the underlying datadog-api-client library. This also updates the minimum required version of that library. (Thanks to @acatalucci-synth & @fcsonline in #112.) + [View diff](https://github.com/dbader/node-datadog-metrics/compare/v0.10.2...main) * 0.11.0 (2022-02-21) diff --git a/lib/reporters.js b/lib/reporters.js index 9dc3590..330d513 100644 --- a/lib/reporters.js +++ b/lib/reporters.js @@ -47,7 +47,7 @@ class DatadogReporter { // URL from their web browser. More details on correct configuration: // https://docs.datadoghq.com/getting_started/site/#access-the-datadog-site this.site = this.site.replace(/^app\./i, ''); - datadogApiClient.client.setServerVariables(configuration, { + configuration.setServerVariables({ site: this.site }); } diff --git a/package.json b/package.json index 1e9ac83..ab7c4b8 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "typescript": "^4.8.4" }, "dependencies": { - "@datadog/datadog-api-client": "^1.3.0", + "@datadog/datadog-api-client": "^1.16.0", "debug": "^4.1.0" }, "engines": {