From 2804754eef1ef8a093d9fddea4245ecf20e06ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Tue, 14 Sep 2021 10:51:45 +0200 Subject: [PATCH 1/3] [RUMF-1020] enable intake v2 Tests have been reworked a bit, because they were not duplicated with and without the flag: those with the `support-intake-v2` flag enabled are still relevant. --- .../src/domain/configuration/configuration.ts | 2 +- .../domain/configuration/endpointBuilder.ts | 11 +- .../transportConfiguration.spec.ts | 155 +++++++----------- .../configuration/transportConfiguration.ts | 11 +- 4 files changed, 69 insertions(+), 110 deletions(-) diff --git a/packages/core/src/domain/configuration/configuration.ts b/packages/core/src/domain/configuration/configuration.ts index 3a5ba21acc..6254578861 100644 --- a/packages/core/src/domain/configuration/configuration.ts +++ b/packages/core/src/domain/configuration/configuration.ts @@ -114,7 +114,7 @@ export function buildConfiguration(initConfiguration: InitConfiguration, buildEn cookieOptions: buildCookieOptions(initConfiguration), isEnabled, service: initConfiguration.service, - ...computeTransportConfiguration(initConfiguration, buildEnv, isEnabled('support-intake-v2')), + ...computeTransportConfiguration(initConfiguration, buildEnv), ...DEFAULT_CONFIGURATION, } diff --git a/packages/core/src/domain/configuration/endpointBuilder.ts b/packages/core/src/domain/configuration/endpointBuilder.ts index 9b8c20186a..90d6379597 100644 --- a/packages/core/src/domain/configuration/endpointBuilder.ts +++ b/packages/core/src/domain/configuration/endpointBuilder.ts @@ -35,11 +35,7 @@ const INTAKE_V1_ALLOWED_SITES = [INTAKE_SITE_US, INTAKE_SITE_US3, INTAKE_SITE_EU type IntakeType = keyof typeof ENDPOINTS -export function createEndpointBuilder( - initConfiguration: InitConfiguration, - buildEnv: BuildEnv, - isIntakeV2Enabled?: boolean -) { +export function createEndpointBuilder(initConfiguration: InitConfiguration, buildEnv: BuildEnv) { const sdkVersion = buildEnv.sdkVersion const { site = INTAKE_SITE_US, @@ -108,10 +104,7 @@ export function createEndpointBuilder( } function shouldUseIntakeV2(endpointType?: EndpointType): boolean { - return ( - !!isIntakeV2Enabled && - (intakeApiVersion === 2 || !includes(INTAKE_V1_ALLOWED_SITES, site) || endpointType === 'sessionReplay') - ) + return intakeApiVersion === 2 || !includes(INTAKE_V1_ALLOWED_SITES, site) || endpointType === 'sessionReplay' } function shouldUseAlternateDomain(endpointType?: EndpointType): boolean { diff --git a/packages/core/src/domain/configuration/transportConfiguration.spec.ts b/packages/core/src/domain/configuration/transportConfiguration.spec.ts index f7939a91f6..fec1b6a4f3 100644 --- a/packages/core/src/domain/configuration/transportConfiguration.spec.ts +++ b/packages/core/src/domain/configuration/transportConfiguration.spec.ts @@ -46,8 +46,8 @@ describe('transportConfiguration', () => { }) describe('query parameters', () => { - it('should add new intake query parameters when "support-intake-v2" enabled', () => { - const configuration = computeTransportConfiguration({ clientToken, intakeApiVersion: 2 }, buildEnv, true) + it('should add new intake query parameters when intakeApiVersion 2 is used', () => { + const configuration = computeTransportConfiguration({ clientToken, intakeApiVersion: 2 }, buildEnv) expect(configuration.rumEndpoint).toMatch( `&dd-api-key=${clientToken}&dd-evp-origin-version=(.*)&dd-evp-origin=browser` ) @@ -111,7 +111,7 @@ describe('transportConfiguration', () => { }) }) - describe('isIntakeUrl when "support-intake-v2" disabled', () => { + describe('isIntakeUrl with intakeApiVersion: 1', () => { it('should not detect non intake request', () => { const configuration = computeTransportConfiguration({ clientToken }, buildEnv) expect(configuration.isIntakeUrl('https://www.foo.com')).toBe(false) @@ -121,7 +121,7 @@ describe('transportConfiguration', () => { const configuration = computeTransportConfiguration({ clientToken, site: 'datadoghq.eu' }, buildEnv) expect(configuration.isIntakeUrl(`https://rum-http-intake.logs.datadoghq.eu${v1IntakePath}?xxx`)).toBe(true) expect(configuration.isIntakeUrl(`https://browser-http-intake.logs.datadoghq.eu${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.eu${v1IntakePath}?xxx`)).toBe( + expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.eu/api/v2/replay?xxx`)).toBe( true ) }) @@ -131,7 +131,7 @@ describe('transportConfiguration', () => { expect(configuration.isIntakeUrl(`https://rum-http-intake.logs.datadoghq.com${v1IntakePath}?xxx`)).toBe(true) expect(configuration.isIntakeUrl(`https://browser-http-intake.logs.datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe( + expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com/api/v2/replay?xxx`)).toBe( true ) }) @@ -140,7 +140,7 @@ describe('transportConfiguration', () => { const configuration = computeTransportConfiguration({ clientToken, useAlternateIntakeDomains: true }, buildEnv) expect(configuration.isIntakeUrl(`https://rum.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) expect(configuration.isIntakeUrl(`https://logs.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe( + expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com/api/v2/replay?xxx`)).toBe( true ) }) @@ -149,7 +149,7 @@ describe('transportConfiguration', () => { const configuration = computeTransportConfiguration({ clientToken, useAlternateIntakeDomains: true }, buildEnv) expect(configuration.isIntakeUrl(`https://rum.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) expect(configuration.isIntakeUrl(`https://logs.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe( + expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com/api/v2/replay?xxx`)).toBe( true ) }) @@ -172,10 +172,10 @@ describe('transportConfiguration', () => { it('should handle sites with subdomains', () => { const configuration = computeTransportConfiguration({ clientToken, site: 'foo.datadoghq.com' }, buildEnv) - expect(configuration.isIntakeUrl(`https://rum.browser-intake-foo-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://logs.browser-intake-foo-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://rum.browser-intake-foo-datadoghq.com/api/v2/rum?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://logs.browser-intake-foo-datadoghq.com/api/v2/logs?xxx`)).toBe(true) expect( - configuration.isIntakeUrl(`https://session-replay.browser-intake-foo-datadoghq.com${v1IntakePath}?xxx`) + configuration.isIntakeUrl(`https://session-replay.browser-intake-foo-datadoghq.com/api/v2/replay?xxx`) ).toBe(true) }) @@ -196,41 +196,70 @@ describe('transportConfiguration', () => { expect(configuration.isIntakeUrl('https://www.proxy.com/foo')).toBe(false) }) - it('should detect replica intake request with alternate intake domains', () => { + it('should detect replica intake request with alternate intake domains and intake v2', () => { const configuration = computeTransportConfiguration( - { clientToken, site: 'foo.com', replica: { clientToken } }, + { clientToken, site: 'datadoghq.eu', replica: { clientToken } }, { ...buildEnv, buildMode: BuildMode.STAGING } ) - expect(configuration.isIntakeUrl(`https://rum.browser-intake-foo.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://logs.browser-intake-foo.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-foo.com${v1IntakePath}?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://rum-http-intake.logs.datadoghq.eu${v1IntakePath}?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://browser-http-intake.logs.datadoghq.eu${v1IntakePath}?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.eu/api/v2/replay?xxx`)).toBe( + true + ) - expect(configuration.isIntakeUrl(`https://rum.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://logs.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://rum.browser-intake-datadoghq.com/api/v2/rum?xxx`)).toBe(true) + expect(configuration.isIntakeUrl(`https://logs.browser-intake-datadoghq.com/api/v2/logs?xxx`)).toBe(true) }) - it('should force intake v1 when "support-intake-v2" disabled', () => { - const configuration = computeTransportConfiguration({ clientToken, intakeApiVersion: 2 }, buildEnv) - expect(configuration.isIntakeUrl(`https://rum-http-intake.logs.datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://browser-http-intake.logs.datadoghq.com${v1IntakePath}?xxx`)).toBe(true) - expect(configuration.isIntakeUrl(`https://session-replay.browser-intake-datadoghq.com${v1IntakePath}?xxx`)).toBe( - true - ) + describe('on us5', () => { + it('should force alternate domains intake v2', () => { + const configuration = computeTransportConfiguration({ clientToken, site: 'us5.datadoghq.com' }, buildEnv) + expect(configuration.isIntakeUrl('https://rum.browser-intake-us5-datadoghq.com/api/v2/rum?xxx')).toBe(true) + expect(configuration.isIntakeUrl('https://logs.browser-intake-us5-datadoghq.com/api/v2/logs?xxx')).toBe(true) + }) + }) + + describe('when session-replay on all env', () => { + it('should force alternate domains intake v2', () => { + let configuration = computeTransportConfiguration({ clientToken }, buildEnv) + expect(configuration.isIntakeUrl('https://session-replay.browser-intake-datadoghq.com/api/v2/replay?xxx')).toBe( + true + ) + + configuration = computeTransportConfiguration({ clientToken, site: 'datadoghq.eu' }, buildEnv) + expect(configuration.isIntakeUrl('https://session-replay.browser-intake-datadoghq.eu/api/v2/replay?xxx')).toBe( + true + ) + + configuration = computeTransportConfiguration({ clientToken, site: 'us3.datadoghq.com' }, buildEnv) + expect( + configuration.isIntakeUrl('https://session-replay.browser-intake-us3-datadoghq.com/api/v2/replay?xxx') + ).toBe(true) + + configuration = computeTransportConfiguration({ clientToken, site: 'ddog-gov.com' }, buildEnv) + expect(configuration.isIntakeUrl('https://session-replay.browser-intake-ddog-gov.com/api/v2/replay?xxx')).toBe( + true + ) + + configuration = computeTransportConfiguration({ clientToken, site: 'us5.datadoghq.com' }, buildEnv) + expect( + configuration.isIntakeUrl('https://session-replay.browser-intake-us5-datadoghq.com/api/v2/replay?xxx') + ).toBe(true) + }) }) }) - describe('isIntakeUrl when "support-intake-v2" enabled', () => { + describe('isIntakeUrl with intakeApiVersion: 2', () => { describe('when RUM or Logs', () => { describe('on us1 and eu1', () => { it('should detect classic domains intake v2', () => { - let configuration = computeTransportConfiguration({ clientToken, intakeApiVersion: 2 }, buildEnv, true) + let configuration = computeTransportConfiguration({ clientToken, intakeApiVersion: 2 }, buildEnv) expect(configuration.isIntakeUrl('https://rum-http-intake.logs.datadoghq.com/api/v2/rum?xxx')).toBe(true) expect(configuration.isIntakeUrl('https://browser-http-intake.logs.datadoghq.com/api/v2/logs?xxx')).toBe(true) configuration = computeTransportConfiguration( { clientToken, site: 'datadoghq.eu', intakeApiVersion: 2 }, - buildEnv, - true + buildEnv ) expect(configuration.isIntakeUrl('https://rum-http-intake.logs.datadoghq.eu/api/v2/rum?xxx')).toBe(true) expect(configuration.isIntakeUrl('https://browser-http-intake.logs.datadoghq.eu/api/v2/logs?xxx')).toBe(true) @@ -239,16 +268,14 @@ describe('transportConfiguration', () => { it('should detect alternate domains intake v2', () => { let configuration = computeTransportConfiguration( { clientToken, useAlternateIntakeDomains: true, intakeApiVersion: 2 }, - buildEnv, - true + buildEnv ) expect(configuration.isIntakeUrl('https://rum.browser-intake-datadoghq.com/api/v2/rum?xxx')).toBe(true) expect(configuration.isIntakeUrl('https://logs.browser-intake-datadoghq.com/api/v2/logs?xxx')).toBe(true) configuration = computeTransportConfiguration( { clientToken, site: 'datadoghq.eu', useAlternateIntakeDomains: true, intakeApiVersion: 2 }, - buildEnv, - true + buildEnv ) expect(configuration.isIntakeUrl('https://rum.browser-intake-datadoghq.eu/api/v2/rum?xxx')).toBe(true) expect(configuration.isIntakeUrl('https://logs.browser-intake-datadoghq.eu/api/v2/logs?xxx')).toBe(true) @@ -259,79 +286,19 @@ describe('transportConfiguration', () => { it('should detect alternate domains intake v2', () => { let configuration = computeTransportConfiguration( { clientToken, site: 'us3.datadoghq.com', intakeApiVersion: 2 }, - buildEnv, - true + buildEnv ) expect(configuration.isIntakeUrl('https://rum.browser-intake-us3-datadoghq.com/api/v2/rum?xxx')).toBe(true) expect(configuration.isIntakeUrl('https://logs.browser-intake-us3-datadoghq.com/api/v2/logs?xxx')).toBe(true) configuration = computeTransportConfiguration( { clientToken, site: 'ddog-gov.com', intakeApiVersion: 2 }, - buildEnv, - true + buildEnv ) expect(configuration.isIntakeUrl('https://rum.browser-intake-ddog-gov.com/api/v2/rum?xxx')).toBe(true) expect(configuration.isIntakeUrl('https://rum-http-intake.logs.ddog-gov.com/api/v2/logs?xxx')).toBe(false) }) }) - - describe('on us5', () => { - it('should force alternate domains intake v2', () => { - const configuration = computeTransportConfiguration( - { clientToken, site: 'us5.datadoghq.com' }, - buildEnv, - true - ) - expect(configuration.isIntakeUrl('https://rum.browser-intake-us5-datadoghq.com/api/v2/rum?xxx')).toBe(true) - expect(configuration.isIntakeUrl('https://logs.browser-intake-us5-datadoghq.com/api/v2/logs?xxx')).toBe(true) - }) - }) - }) - - describe('when session-replay on all env', () => { - it('should force alternate domains intake v2', () => { - let configuration = computeTransportConfiguration({ clientToken }, buildEnv, true) - expect(configuration.isIntakeUrl('https://session-replay.browser-intake-datadoghq.com/api/v2/replay?xxx')).toBe( - true - ) - - configuration = computeTransportConfiguration({ clientToken, site: 'datadoghq.eu' }, buildEnv, true) - expect(configuration.isIntakeUrl('https://session-replay.browser-intake-datadoghq.eu/api/v2/replay?xxx')).toBe( - true - ) - - configuration = computeTransportConfiguration({ clientToken, site: 'us3.datadoghq.com' }, buildEnv, true) - expect( - configuration.isIntakeUrl('https://session-replay.browser-intake-us3-datadoghq.com/api/v2/replay?xxx') - ).toBe(true) - - configuration = computeTransportConfiguration({ clientToken, site: 'ddog-gov.com' }, buildEnv, true) - expect(configuration.isIntakeUrl('https://session-replay.browser-intake-ddog-gov.com/api/v2/replay?xxx')).toBe( - true - ) - - configuration = computeTransportConfiguration({ clientToken, site: 'us5.datadoghq.com' }, buildEnv, true) - expect( - configuration.isIntakeUrl('https://session-replay.browser-intake-us5-datadoghq.com/api/v2/replay?xxx') - ).toBe(true) - }) - }) - - it('should detect replica intake request with alternate intake domains version 2', () => { - const configuration = computeTransportConfiguration( - { clientToken, site: 'foo.com', replica: { clientToken } }, - { ...buildEnv, buildMode: BuildMode.STAGING }, - true - ) - expect(configuration.isIntakeUrl('https://rum.browser-intake-foo.com/api/v2/rum?xxx')).toBe(true) - expect(configuration.isIntakeUrl('https://logs.browser-intake-foo.com/api/v2/logs?xxx')).toBe(true) - expect(configuration.isIntakeUrl('https://session-replay.browser-intake-foo.com/api/v2/replay?xxx')).toBe(true) - - expect(configuration.isIntakeUrl('https://rum.browser-intake-datadoghq.com/api/v2/rum?xxx')).toBe(true) - expect(configuration.isIntakeUrl('https://logs.browser-intake-datadoghq.com/api/v2/logs?xxx')).toBe(true) - expect(configuration.isIntakeUrl('https://session-replay.browser-intake-datadoghq.com/api/v2/replay?xxx')).toBe( - true - ) }) }) }) diff --git a/packages/core/src/domain/configuration/transportConfiguration.ts b/packages/core/src/domain/configuration/transportConfiguration.ts index 5e6f8626ac..bc5462fdc3 100644 --- a/packages/core/src/domain/configuration/transportConfiguration.ts +++ b/packages/core/src/domain/configuration/transportConfiguration.ts @@ -22,10 +22,9 @@ export interface ReplicaConfiguration { export function computeTransportConfiguration( initConfiguration: InitConfiguration, - buildEnv: BuildEnv, - isIntakeV2Enabled?: boolean + buildEnv: BuildEnv ): TransportConfiguration { - const endpointBuilder = createEndpointBuilder(initConfiguration, buildEnv, isIntakeV2Enabled) + const endpointBuilder = createEndpointBuilder(initConfiguration, buildEnv) const intakeUrls: string[] = ENDPOINTS_TYPES.map((endpointType) => endpointBuilder.buildIntakeUrl(endpointType)) const configuration: TransportConfiguration = { @@ -47,15 +46,15 @@ export function computeTransportConfiguration( } if (buildEnv.buildMode === BuildMode.STAGING && initConfiguration.replica !== undefined) { - const replicaConfiguration = { + const replicaConfiguration: InitConfiguration = { ...initConfiguration, site: INTAKE_SITE_US, applicationId: initConfiguration.replica.applicationId, clientToken: initConfiguration.replica.clientToken, useAlternateIntakeDomains: true, - intakeApiVersion: isIntakeV2Enabled ? 2 : (1 as 1 | 2), + intakeApiVersion: 2, } - const replicaEndpointBuilder = createEndpointBuilder(replicaConfiguration, buildEnv, isIntakeV2Enabled) + const replicaEndpointBuilder = createEndpointBuilder(replicaConfiguration, buildEnv) configuration.replica = { applicationId: initConfiguration.replica.applicationId, From dedd318c1dd5005c9519f88fa61b31818ef7d389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Tue, 14 Sep 2021 11:10:14 +0200 Subject: [PATCH 2/3] [RUMF-1020] add doc for `intakeApiVersion` and `useAlternateIntakeDomains` --- packages/logs/README.md | 23 +++++++++++++---------- packages/rum/README.md | 11 +++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/packages/logs/README.md b/packages/logs/README.md index 87d6603141..2ce3ff8e20 100644 --- a/packages/logs/README.md +++ b/packages/logs/README.md @@ -117,16 +117,18 @@ window.DD_LOGS.init({ The following parameters are available to configure the Datadog browser logs SDK to send logs to Datadog: -| Parameter | Type | Required | Default | Description | -| --------------------- | ------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------- | -| `clientToken` | String | Yes | | A [Datadog client token][2]. | -| `site` | String | Yes | `datadoghq.com` | The Datadog site of your organization. US: `datadoghq.com`, EU: `datadoghq.eu` | -| `service` | String | No | | The service name for your application. | -| `env` | String | No | | The application’s environment, for example: prod, pre-prod, staging, etc. | -| `version` | String | No | | The application’s version, for example: 1.2.3, 6c44da20, 2020.02.13, etc. | -| `forwardErrorsToLogs` | Boolean | No | `true` | Set to `false` to stop forwarding console.error logs, uncaught exceptions and network errors to Datadog. | -| `sampleRate` | Number | No | `100` | The percentage of sessions to track: `100` for all, `0` for none. Only tracked sessions send logs. | -| `silentMultipleInit` | Boolean | No | | Prevent logging errors while having multiple init. | +| Parameter | Type | Required | Default | Description | +| --------------------------- | ------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------- | +| `clientToken` | String | Yes | | A [Datadog client token][2]. | +| `site` | String | Yes | `datadoghq.com` | The Datadog site of your organization. US: `datadoghq.com`, EU: `datadoghq.eu` | +| `service` | String | No | | The service name for your application. | +| `env` | String | No | | The application’s environment, for example: prod, pre-prod, staging, etc. | +| `version` | String | No | | The application’s version, for example: 1.2.3, 6c44da20, 2020.02.13, etc. | +| `forwardErrorsToLogs` | Boolean | No | `true` | Set to `false` to stop forwarding console.error logs, uncaught exceptions and network errors to Datadog. | +| `sampleRate` | Number | No | `100` | The percentage of sessions to track: `100` for all, `0` for none. Only tracked sessions send logs. | +| `silentMultipleInit` | Boolean | No | | Prevent logging errors while having multiple init. | +| `useAlternateIntakeDomains` | Boolean | No | `false` | Use the new intake domains for sending Logs data. Make sure to update [CSP][6] headers before enabling. | +| `intakeApiVersion` | Number | No | `1` | Set to `2` to use the new intake API for sending Logs data. | Options that must have a matching configuration when using the `RUM` SDK: @@ -652,3 +654,4 @@ window.DD_LOGS && DD_LOGS.logger.setHandler(['', '']) [3]: https://www.npmjs.com/package/@datadog/browser-logs [4]: https://github.com/DataDog/browser-sdk/blob/main/packages/logs/BROWSER_SUPPORT.md [5]: /real_user_monitoring/guide/enrich-and-control-rum-data/ +[6]: /real_user_monitoring/faq/content_security_policy/ diff --git a/packages/rum/README.md b/packages/rum/README.md index f3ba3a8d17..3974580bee 100644 --- a/packages/rum/README.md +++ b/packages/rum/README.md @@ -219,6 +219,16 @@ Use a secure session cookie. This disables RUM events sent on insecure (non-HTTP **Default**:`false`
Use a secure cross-site session cookie. This allows the RUM SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`. +`useAlternateIntakeDomains` +: Optional
+**Default**:`false`
+Use the new intake domains for sending RUM and Session Replay data. Make sure to update [CSP][11] headers before enabling. + +`intakeApiVersion` +: Optional
+**Default**:`1`
+Set to `2` to use the new intake API for sending RUM and Session Replay data. + #### Example Init must be called to start the tracking: @@ -251,3 +261,4 @@ init(configuration: { [8]: https://github.com/DataDog/browser-sdk/blob/main/packages/rum/BROWSER_SUPPORT.md [9]: https://docs.datadoghq.com/real_user_monitoring/browser/tracking_user_actions#declaring-a-name-for-click-actions [10]: https://docs.datadoghq.com/real_user_monitoring/browser/modifying_data_and_context/?tab=npm#override-default-rum-view-names +[11]: https://docs.datadoghq.com/real_user_monitoring/faq/content_security_policy/ From 5683deecf2ae3a05597a2809d61ce4b514a225ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Tue, 14 Sep 2021 11:25:56 +0200 Subject: [PATCH 3/3] Revert "[RUMF-1020] add doc for `intakeApiVersion` and `useAlternateIntakeDomains`" This reverts commit dedd318c1dd5005c9519f88fa61b31818ef7d389. --- packages/logs/README.md | 23 ++++++++++------------- packages/rum/README.md | 11 ----------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/packages/logs/README.md b/packages/logs/README.md index 2ce3ff8e20..87d6603141 100644 --- a/packages/logs/README.md +++ b/packages/logs/README.md @@ -117,18 +117,16 @@ window.DD_LOGS.init({ The following parameters are available to configure the Datadog browser logs SDK to send logs to Datadog: -| Parameter | Type | Required | Default | Description | -| --------------------------- | ------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------- | -| `clientToken` | String | Yes | | A [Datadog client token][2]. | -| `site` | String | Yes | `datadoghq.com` | The Datadog site of your organization. US: `datadoghq.com`, EU: `datadoghq.eu` | -| `service` | String | No | | The service name for your application. | -| `env` | String | No | | The application’s environment, for example: prod, pre-prod, staging, etc. | -| `version` | String | No | | The application’s version, for example: 1.2.3, 6c44da20, 2020.02.13, etc. | -| `forwardErrorsToLogs` | Boolean | No | `true` | Set to `false` to stop forwarding console.error logs, uncaught exceptions and network errors to Datadog. | -| `sampleRate` | Number | No | `100` | The percentage of sessions to track: `100` for all, `0` for none. Only tracked sessions send logs. | -| `silentMultipleInit` | Boolean | No | | Prevent logging errors while having multiple init. | -| `useAlternateIntakeDomains` | Boolean | No | `false` | Use the new intake domains for sending Logs data. Make sure to update [CSP][6] headers before enabling. | -| `intakeApiVersion` | Number | No | `1` | Set to `2` to use the new intake API for sending Logs data. | +| Parameter | Type | Required | Default | Description | +| --------------------- | ------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------- | +| `clientToken` | String | Yes | | A [Datadog client token][2]. | +| `site` | String | Yes | `datadoghq.com` | The Datadog site of your organization. US: `datadoghq.com`, EU: `datadoghq.eu` | +| `service` | String | No | | The service name for your application. | +| `env` | String | No | | The application’s environment, for example: prod, pre-prod, staging, etc. | +| `version` | String | No | | The application’s version, for example: 1.2.3, 6c44da20, 2020.02.13, etc. | +| `forwardErrorsToLogs` | Boolean | No | `true` | Set to `false` to stop forwarding console.error logs, uncaught exceptions and network errors to Datadog. | +| `sampleRate` | Number | No | `100` | The percentage of sessions to track: `100` for all, `0` for none. Only tracked sessions send logs. | +| `silentMultipleInit` | Boolean | No | | Prevent logging errors while having multiple init. | Options that must have a matching configuration when using the `RUM` SDK: @@ -654,4 +652,3 @@ window.DD_LOGS && DD_LOGS.logger.setHandler(['', '']) [3]: https://www.npmjs.com/package/@datadog/browser-logs [4]: https://github.com/DataDog/browser-sdk/blob/main/packages/logs/BROWSER_SUPPORT.md [5]: /real_user_monitoring/guide/enrich-and-control-rum-data/ -[6]: /real_user_monitoring/faq/content_security_policy/ diff --git a/packages/rum/README.md b/packages/rum/README.md index 3974580bee..f3ba3a8d17 100644 --- a/packages/rum/README.md +++ b/packages/rum/README.md @@ -219,16 +219,6 @@ Use a secure session cookie. This disables RUM events sent on insecure (non-HTTP **Default**:`false`
Use a secure cross-site session cookie. This allows the RUM SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`. -`useAlternateIntakeDomains` -: Optional
-**Default**:`false`
-Use the new intake domains for sending RUM and Session Replay data. Make sure to update [CSP][11] headers before enabling. - -`intakeApiVersion` -: Optional
-**Default**:`1`
-Set to `2` to use the new intake API for sending RUM and Session Replay data. - #### Example Init must be called to start the tracking: @@ -261,4 +251,3 @@ init(configuration: { [8]: https://github.com/DataDog/browser-sdk/blob/main/packages/rum/BROWSER_SUPPORT.md [9]: https://docs.datadoghq.com/real_user_monitoring/browser/tracking_user_actions#declaring-a-name-for-click-actions [10]: https://docs.datadoghq.com/real_user_monitoring/browser/modifying_data_and_context/?tab=npm#override-default-rum-view-names -[11]: https://docs.datadoghq.com/real_user_monitoring/faq/content_security_policy/