From 7599e3240c0f085ebd24d56e1d0ed2768ca22481 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Waheed <42172960+abdullahwaheed@users.noreply.github.com> Date: Mon, 13 May 2024 22:46:23 +0500 Subject: [PATCH] fix: set session sample rate configurable and defaults to 0 (#29) * fix: set session sample rate configurable and defaults to 0 * 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 ffc867d..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: 50, - sessionReplaySampleRate: 100, + 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: 100, + sessionSampleRate: parseInt(process.env.DATADOG_LOGS_SESSION_SAMPLE_RATE || 0, 10), service: process.env.DATADOG_SERVICE, }); }