@datadog/browser-core
Advanced tools
Comparing version 4.29.1 to 4.30.0
@@ -9,3 +9,3 @@ "use strict"; | ||
var publicApi = (0, utils_1.assign)({ | ||
version: "4.29.1", | ||
version: "4.30.0", | ||
// This API method is intentionally not monitored, since the only thing executed is the | ||
@@ -12,0 +12,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and |
@@ -13,3 +13,7 @@ import type { CookieOptions } from '../../browser/cookie'; | ||
beforeSend?: GenericBeforeSendCallback | undefined; | ||
/** | ||
* @deprecated use sessionSampleRate instead | ||
*/ | ||
sampleRate?: number | undefined; | ||
sessionSampleRate?: number | undefined; | ||
telemetrySampleRate?: number | undefined; | ||
@@ -41,3 +45,3 @@ silentMultipleInit?: boolean | undefined; | ||
cookieOptions: CookieOptions; | ||
sampleRate: number; | ||
sessionSampleRate: number; | ||
telemetrySampleRate: number; | ||
@@ -44,0 +48,0 @@ telemetryConfigurationSampleRate: number; |
@@ -21,4 +21,5 @@ "use strict"; | ||
} | ||
if (initConfiguration.sampleRate !== undefined && !(0, utils_1.isPercentage)(initConfiguration.sampleRate)) { | ||
display_1.display.error('Sample Rate should be a number between 0 and 100'); | ||
var sessionSampleRate = (_a = initConfiguration.sessionSampleRate) !== null && _a !== void 0 ? _a : initConfiguration.sampleRate; | ||
if (sessionSampleRate !== undefined && !(0, utils_1.isPercentage)(sessionSampleRate)) { | ||
display_1.display.error('Session Sample Rate should be a number between 0 and 100'); | ||
return; | ||
@@ -40,3 +41,3 @@ } | ||
cookieOptions: buildCookieOptions(initConfiguration), | ||
sampleRate: (_a = initConfiguration.sampleRate) !== null && _a !== void 0 ? _a : 100, | ||
sessionSampleRate: sessionSampleRate !== null && sessionSampleRate !== void 0 ? sessionSampleRate : 100, | ||
telemetrySampleRate: (_b = initConfiguration.telemetrySampleRate) !== null && _b !== void 0 ? _b : 20, | ||
@@ -80,4 +81,5 @@ telemetryConfigurationSampleRate: (_c = initConfiguration.telemetryConfigurationSampleRate) !== null && _c !== void 0 ? _c : 5, | ||
function serializeConfiguration(configuration) { | ||
var _a; | ||
return { | ||
session_sample_rate: configuration.sampleRate, | ||
session_sample_rate: (_a = configuration.sessionSampleRate) !== null && _a !== void 0 ? _a : configuration.sampleRate, | ||
telemetry_sample_rate: configuration.telemetrySampleRate, | ||
@@ -84,0 +86,0 @@ telemetry_configuration_sample_rate: configuration.telemetryConfigurationSampleRate, |
@@ -25,3 +25,3 @@ "use strict"; | ||
build: function (api, retry) { | ||
var tags = ["sdk_version:".concat("4.29.1"), "api:".concat(api)].concat(configurationTags); | ||
var tags = ["sdk_version:".concat("4.30.0"), "api:".concat(api)].concat(configurationTags); | ||
if (retry) { | ||
@@ -34,3 +34,3 @@ tags.push("retry_count:".concat(retry.count), "retry_after:".concat(retry.lastFailureStatus)); | ||
"dd-api-key=".concat(clientToken), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.29.1")), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.30.0")), | ||
'dd-evp-origin=browser', | ||
@@ -37,0 +37,0 @@ "dd-request-id=".concat((0, utils_1.generateUUID)()), |
@@ -53,2 +53,4 @@ import type { Context } from '../../tools/context'; | ||
use_allowed_tracing_origins?: boolean | undefined; | ||
use_allowed_tracing_urls?: boolean | undefined; | ||
selected_tracing_propagators?: ("datadog" | "b3" | "b3multi" | "tracecontext")[] | undefined; | ||
default_privacy_level?: string | undefined; | ||
@@ -59,2 +61,3 @@ use_excluded_activity_urls?: boolean | undefined; | ||
track_interactions?: boolean | undefined; | ||
track_user_interactions?: boolean | undefined; | ||
forward_errors_to_logs?: boolean | undefined; | ||
@@ -61,0 +64,0 @@ forward_console_logs?: string[] | "all" | undefined; |
@@ -46,3 +46,3 @@ "use strict"; | ||
service: telemetryService, | ||
version: "4.29.1", | ||
version: "4.30.0", | ||
source: 'browser', | ||
@@ -49,0 +49,0 @@ _dd: { |
@@ -151,6 +151,14 @@ /** | ||
/** | ||
* Whether the allowed tracing origins list is used | ||
* Whether the allowed tracing origins list is used (deprecated in favor of use_allowed_tracing_urls) | ||
*/ | ||
use_allowed_tracing_origins?: boolean; | ||
/** | ||
* Whether the allowed tracing urls list is used | ||
*/ | ||
use_allowed_tracing_urls?: boolean; | ||
/** | ||
* A list of selected tracing propagators | ||
*/ | ||
selected_tracing_propagators?: ('datadog' | 'b3' | 'b3multi' | 'tracecontext')[]; | ||
/** | ||
* Session replay default privacy level | ||
@@ -172,6 +180,10 @@ */ | ||
/** | ||
* Whether user actions are tracked | ||
* Whether user actions are tracked (deprecated in favor of track_user_interactions) | ||
*/ | ||
track_interactions?: boolean; | ||
/** | ||
* Whether user actions are tracked | ||
*/ | ||
track_user_interactions?: boolean; | ||
/** | ||
* Whether console.error logs, uncaught exceptions and network errors are tracked | ||
@@ -178,0 +190,0 @@ */ |
@@ -6,3 +6,3 @@ import { catchUserErrors } from '../tools/catchUserErrors'; | ||
var publicApi = assign({ | ||
version: "4.29.1", | ||
version: "4.30.0", | ||
// This API method is intentionally not monitored, since the only thing executed is the | ||
@@ -9,0 +9,0 @@ // user-provided 'callback'. All SDK usages executed in the callback should be monitored, and |
@@ -13,3 +13,7 @@ import type { CookieOptions } from '../../browser/cookie'; | ||
beforeSend?: GenericBeforeSendCallback | undefined; | ||
/** | ||
* @deprecated use sessionSampleRate instead | ||
*/ | ||
sampleRate?: number | undefined; | ||
sessionSampleRate?: number | undefined; | ||
telemetrySampleRate?: number | undefined; | ||
@@ -41,3 +45,3 @@ silentMultipleInit?: boolean | undefined; | ||
cookieOptions: CookieOptions; | ||
sampleRate: number; | ||
sessionSampleRate: number; | ||
telemetrySampleRate: number; | ||
@@ -44,0 +48,0 @@ telemetryConfigurationSampleRate: number; |
@@ -18,4 +18,5 @@ import { getCurrentSite } from '../../browser/cookie'; | ||
} | ||
if (initConfiguration.sampleRate !== undefined && !isPercentage(initConfiguration.sampleRate)) { | ||
display.error('Sample Rate should be a number between 0 and 100'); | ||
var sessionSampleRate = (_a = initConfiguration.sessionSampleRate) !== null && _a !== void 0 ? _a : initConfiguration.sampleRate; | ||
if (sessionSampleRate !== undefined && !isPercentage(sessionSampleRate)) { | ||
display.error('Session Sample Rate should be a number between 0 and 100'); | ||
return; | ||
@@ -37,3 +38,3 @@ } | ||
cookieOptions: buildCookieOptions(initConfiguration), | ||
sampleRate: (_a = initConfiguration.sampleRate) !== null && _a !== void 0 ? _a : 100, | ||
sessionSampleRate: sessionSampleRate !== null && sessionSampleRate !== void 0 ? sessionSampleRate : 100, | ||
telemetrySampleRate: (_b = initConfiguration.telemetrySampleRate) !== null && _b !== void 0 ? _b : 20, | ||
@@ -75,4 +76,5 @@ telemetryConfigurationSampleRate: (_c = initConfiguration.telemetryConfigurationSampleRate) !== null && _c !== void 0 ? _c : 5, | ||
export function serializeConfiguration(configuration) { | ||
var _a; | ||
return { | ||
session_sample_rate: configuration.sampleRate, | ||
session_sample_rate: (_a = configuration.sessionSampleRate) !== null && _a !== void 0 ? _a : configuration.sampleRate, | ||
telemetry_sample_rate: configuration.telemetrySampleRate, | ||
@@ -79,0 +81,0 @@ telemetry_configuration_sample_rate: configuration.telemetryConfigurationSampleRate, |
@@ -22,3 +22,3 @@ import { timeStampNow } from '../../tools/timeUtils'; | ||
build: function (api, retry) { | ||
var tags = ["sdk_version:".concat("4.29.1"), "api:".concat(api)].concat(configurationTags); | ||
var tags = ["sdk_version:".concat("4.30.0"), "api:".concat(api)].concat(configurationTags); | ||
if (retry) { | ||
@@ -31,3 +31,3 @@ tags.push("retry_count:".concat(retry.count), "retry_after:".concat(retry.lastFailureStatus)); | ||
"dd-api-key=".concat(clientToken), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.29.1")), | ||
"dd-evp-origin-version=".concat(encodeURIComponent("4.30.0")), | ||
'dd-evp-origin=browser', | ||
@@ -34,0 +34,0 @@ "dd-request-id=".concat(generateUUID()), |
@@ -53,2 +53,4 @@ import type { Context } from '../../tools/context'; | ||
use_allowed_tracing_origins?: boolean | undefined; | ||
use_allowed_tracing_urls?: boolean | undefined; | ||
selected_tracing_propagators?: ("datadog" | "b3" | "b3multi" | "tracecontext")[] | undefined; | ||
default_privacy_level?: string | undefined; | ||
@@ -59,2 +61,3 @@ use_excluded_activity_urls?: boolean | undefined; | ||
track_interactions?: boolean | undefined; | ||
track_user_interactions?: boolean | undefined; | ||
forward_errors_to_logs?: boolean | undefined; | ||
@@ -61,0 +64,0 @@ forward_console_logs?: string[] | "all" | undefined; |
@@ -43,3 +43,3 @@ import { ConsoleApiName } from '../../tools/display'; | ||
service: telemetryService, | ||
version: "4.29.1", | ||
version: "4.30.0", | ||
source: 'browser', | ||
@@ -46,0 +46,0 @@ _dd: { |
@@ -151,6 +151,14 @@ /** | ||
/** | ||
* Whether the allowed tracing origins list is used | ||
* Whether the allowed tracing origins list is used (deprecated in favor of use_allowed_tracing_urls) | ||
*/ | ||
use_allowed_tracing_origins?: boolean; | ||
/** | ||
* Whether the allowed tracing urls list is used | ||
*/ | ||
use_allowed_tracing_urls?: boolean; | ||
/** | ||
* A list of selected tracing propagators | ||
*/ | ||
selected_tracing_propagators?: ('datadog' | 'b3' | 'b3multi' | 'tracecontext')[]; | ||
/** | ||
* Session replay default privacy level | ||
@@ -172,6 +180,10 @@ */ | ||
/** | ||
* Whether user actions are tracked | ||
* Whether user actions are tracked (deprecated in favor of track_user_interactions) | ||
*/ | ||
track_interactions?: boolean; | ||
/** | ||
* Whether user actions are tracked | ||
*/ | ||
track_user_interactions?: boolean; | ||
/** | ||
* Whether console.error logs, uncaught exceptions and network errors are tracked | ||
@@ -178,0 +190,0 @@ */ |
{ | ||
"name": "@datadog/browser-core", | ||
"version": "4.29.1", | ||
"version": "4.30.0", | ||
"license": "Apache-2.0", | ||
@@ -24,3 +24,3 @@ "main": "cjs/index.js", | ||
}, | ||
"gitHead": "14b6b0d10999b8ab3b85c113da4e0399cb064295" | ||
"gitHead": "fada5c570ec088b6df967f1eee32c887bd138ec8" | ||
} |
@@ -41,7 +41,7 @@ import type { RumEvent } from '../../../../rum-core/src' | ||
it('requires sampleRate to be a percentage', () => { | ||
it('requires deprecated sampleRate to be a percentage', () => { | ||
expect( | ||
validateAndBuildConfiguration({ clientToken, sampleRate: 'foo' } as unknown as InitConfiguration) | ||
).toBeUndefined() | ||
expect(displaySpy).toHaveBeenCalledOnceWith('Sample Rate should be a number between 0 and 100') | ||
expect(displaySpy).toHaveBeenCalledOnceWith('Session Sample Rate should be a number between 0 and 100') | ||
@@ -52,3 +52,3 @@ displaySpy.calls.reset() | ||
).toBeUndefined() | ||
expect(displaySpy).toHaveBeenCalledOnceWith('Sample Rate should be a number between 0 and 100') | ||
expect(displaySpy).toHaveBeenCalledOnceWith('Session Sample Rate should be a number between 0 and 100') | ||
@@ -60,2 +60,19 @@ displaySpy.calls.reset() | ||
it('requires sessionSampleRate to be a percentage', () => { | ||
expect( | ||
validateAndBuildConfiguration({ clientToken, sessionSampleRate: 'foo' } as unknown as InitConfiguration) | ||
).toBeUndefined() | ||
expect(displaySpy).toHaveBeenCalledOnceWith('Session Sample Rate should be a number between 0 and 100') | ||
displaySpy.calls.reset() | ||
expect( | ||
validateAndBuildConfiguration({ clientToken, sessionSampleRate: 200 } as unknown as InitConfiguration) | ||
).toBeUndefined() | ||
expect(displaySpy).toHaveBeenCalledOnceWith('Session Sample Rate should be a number between 0 and 100') | ||
displaySpy.calls.reset() | ||
validateAndBuildConfiguration({ clientToken: 'yes', sessionSampleRate: 1 }) | ||
expect(displaySpy).not.toHaveBeenCalled() | ||
}) | ||
it('requires telemetrySampleRate to be a percentage', () => { | ||
@@ -62,0 +79,0 @@ expect( |
@@ -22,3 +22,7 @@ import type { CookieOptions } from '../../browser/cookie' | ||
beforeSend?: GenericBeforeSendCallback | undefined | ||
/** | ||
* @deprecated use sessionSampleRate instead | ||
*/ | ||
sampleRate?: number | undefined | ||
sessionSampleRate?: number | undefined | ||
telemetrySampleRate?: number | undefined | ||
@@ -65,3 +69,3 @@ silentMultipleInit?: boolean | undefined | ||
cookieOptions: CookieOptions | ||
sampleRate: number | ||
sessionSampleRate: number | ||
telemetrySampleRate: number | ||
@@ -89,4 +93,5 @@ telemetryConfigurationSampleRate: number | ||
if (initConfiguration.sampleRate !== undefined && !isPercentage(initConfiguration.sampleRate)) { | ||
display.error('Sample Rate should be a number between 0 and 100') | ||
const sessionSampleRate = initConfiguration.sessionSampleRate ?? initConfiguration.sampleRate | ||
if (sessionSampleRate !== undefined && !isPercentage(sessionSampleRate)) { | ||
display.error('Session Sample Rate should be a number between 0 and 100') | ||
return | ||
@@ -116,3 +121,3 @@ } | ||
cookieOptions: buildCookieOptions(initConfiguration), | ||
sampleRate: initConfiguration.sampleRate ?? 100, | ||
sessionSampleRate: sessionSampleRate ?? 100, | ||
telemetrySampleRate: initConfiguration.telemetrySampleRate ?? 20, | ||
@@ -167,3 +172,3 @@ telemetryConfigurationSampleRate: initConfiguration.telemetryConfigurationSampleRate ?? 5, | ||
return { | ||
session_sample_rate: configuration.sampleRate, | ||
session_sample_rate: configuration.sessionSampleRate ?? configuration.sampleRate, | ||
telemetry_sample_rate: configuration.telemetrySampleRate, | ||
@@ -170,0 +175,0 @@ telemetry_configuration_sample_rate: configuration.telemetryConfigurationSampleRate, |
@@ -153,6 +153,14 @@ /* eslint-disable */ | ||
/** | ||
* Whether the allowed tracing origins list is used | ||
* Whether the allowed tracing origins list is used (deprecated in favor of use_allowed_tracing_urls) | ||
*/ | ||
use_allowed_tracing_origins?: boolean | ||
/** | ||
* Whether the allowed tracing urls list is used | ||
*/ | ||
use_allowed_tracing_urls?: boolean | ||
/** | ||
* A list of selected tracing propagators | ||
*/ | ||
selected_tracing_propagators?: ('datadog' | 'b3' | 'b3multi' | 'tracecontext')[] | ||
/** | ||
* Session replay default privacy level | ||
@@ -174,6 +182,10 @@ */ | ||
/** | ||
* Whether user actions are tracked | ||
* Whether user actions are tracked (deprecated in favor of track_user_interactions) | ||
*/ | ||
track_interactions?: boolean | ||
/** | ||
* Whether user actions are tracked | ||
*/ | ||
track_user_interactions?: boolean | ||
/** | ||
* Whether console.error logs, uncaught exceptions and network errors are tracked | ||
@@ -180,0 +192,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1019362
20386