From d921f14de7a732c70e8a3dc0eb5407cb35c4d13f Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Waheed Date: Mon, 13 May 2024 21:14:58 +0500 Subject: [PATCH 1/2] fix: set session sample rate configurable and defaults to 0 --- src/DatadogLoggingService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DatadogLoggingService.js b/src/DatadogLoggingService.js index ffc867d..2fe26f7 100644 --- a/src/DatadogLoggingService.js +++ b/src/DatadogLoggingService.js @@ -35,8 +35,8 @@ class DatadogLoggingService extends NewRelicLoggingService { service: process.env.DATADOG_SERVICE, env: process.env.DATADOG_ENV, version: process.env.DATADOG_VERSION, - sessionSampleRate: 50, - sessionReplaySampleRate: 100, + sessionSampleRate: parseInt(process.env.SESSION_SAMPLE_RATE || 0, 10), + sessionReplaySampleRate: parseInt(process.env.SESSION_REPLAY_SAMPLE_RATE || 0, 10), trackUserInteractions: true, trackResources: true, trackLongTasks: true, @@ -47,7 +47,7 @@ class DatadogLoggingService extends NewRelicLoggingService { site: process.env.DATADOG_SITE, env: process.env.DATADOG_ENV, forwardErrorsToLogs: true, - sessionSampleRate: 100, + sessionSampleRate: parseInt(process.env.SESSION_SAMPLE_RATE || 0, 10), service: process.env.DATADOG_SERVICE, }); } From 093f64e7fe542c0a6eef5c83e02cfdbaecacfad4 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Waheed Date: Mon, 13 May 2024 22:33:17 +0500 Subject: [PATCH 2/2] refactor: updated names to use datadog prefix --- src/DatadogLoggingService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DatadogLoggingService.js b/src/DatadogLoggingService.js index 2fe26f7..e2c6a5f 100644 --- a/src/DatadogLoggingService.js +++ b/src/DatadogLoggingService.js @@ -35,8 +35,8 @@ class DatadogLoggingService extends NewRelicLoggingService { service: process.env.DATADOG_SERVICE, env: process.env.DATADOG_ENV, version: process.env.DATADOG_VERSION, - sessionSampleRate: parseInt(process.env.SESSION_SAMPLE_RATE || 0, 10), - sessionReplaySampleRate: parseInt(process.env.SESSION_REPLAY_SAMPLE_RATE || 0, 10), + sessionSampleRate: parseInt(process.env.DATADOG_SESSION_SAMPLE_RATE || 0, 10), + sessionReplaySampleRate: parseInt(process.env.DATADOG_SESSION_REPLAY_SAMPLE_RATE || 0, 10), trackUserInteractions: true, trackResources: true, trackLongTasks: true, @@ -47,7 +47,7 @@ class DatadogLoggingService extends NewRelicLoggingService { site: process.env.DATADOG_SITE, env: process.env.DATADOG_ENV, forwardErrorsToLogs: true, - sessionSampleRate: parseInt(process.env.SESSION_SAMPLE_RATE || 0, 10), + sessionSampleRate: parseInt(process.env.DATADOG_LOGS_SESSION_SAMPLE_RATE || 0, 10), service: process.env.DATADOG_SERVICE, }); }