Skip to content

Commit ccfdb00

Browse files
committed
Merge branch 'main' into nikita-tkachenko/rum-ci-visibility-integration
2 parents cb85d18 + 282082c commit ccfdb00

File tree

110 files changed

+2622
-3074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2622
-3074
lines changed

.eslintrc.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,16 @@ module.exports = {
186186
},
187187
overrides: [
188188
{
189-
files: ['**/*.types.ts', '**/types.ts'],
189+
files: ['**/*Event.types.ts'],
190190
rules: {
191-
camelcase: 'off',
191+
'@typescript-eslint/naming-convention': [
192+
'error',
193+
{
194+
leadingUnderscore: 'allow',
195+
selector: 'property',
196+
format: ['snake_case'],
197+
},
198+
],
192199
},
193200
},
194201
{

.gitlab-ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
variables:
2-
CURRENT_STAGING: staging-11
2+
CURRENT_STAGING: staging-13
33
APP: 'browser-sdk'
4-
CURRENT_CI_IMAGE: 60
4+
CURRENT_CI_IMAGE: 61
55
BUILD_STABLE_REGISTRY: '486234852809.dkr.ecr.us-east-1.amazonaws.com'
66
CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE'
77
GIT_REPOSITORY: '[email protected]:DataDog/browser-sdk.git'
88
MAIN_BRANCH: 'main'
9-
CHROME_PACKAGE_VERSION: 122.0.6261.57-1
9+
CHROME_PACKAGE_VERSION: 123.0.6312.58-1
1010

1111
cache:
1212
key:
@@ -299,6 +299,7 @@ deploy-prod-canary:
299299
- VERSION=$(node -p -e "require('./lerna.json').version")
300300
- yarn
301301
- yarn build:bundle
302+
- node ./scripts/deploy/check-monitors.js $UPLOAD_PATH
302303
- node ./scripts/deploy/deploy.js prod v${VERSION%%.*} $UPLOAD_PATH
303304
- node ./scripts/deploy/upload-source-maps.js v${VERSION%%.*} $UPLOAD_PATH
304305

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@
1616
1717
---
1818

19+
## v5.13.0
20+
21+
-[RUM-3542] Add trace context injection control in rum configuration ([#2656](https://github.com/DataDog/browser-sdk/pull/2656))
22+
- 🐛 [RUM-3599] do not define undefined instrumented method ([#2662](https://github.com/DataDog/browser-sdk/pull/2662))
23+
- 🐛 [RUM-3598] Ignore collecting requests to logs PCI intake as RUM resources ([#2655](https://github.com/DataDog/browser-sdk/pull/2655))
24+
-[RUM-2633] Optimize DOM iteration in the recorder ([#2657](https://github.com/DataDog/browser-sdk/pull/2657))
25+
26+
## v5.12.0
27+
28+
-[RUM-3546] Add support of PCI compliant intake for browser logs ([#2648](https://github.com/DataDog/browser-sdk/pull/2648))
29+
-[RUM 3352] Extra resource event attributes to enable performance CWV troubleshooting ([#2646](https://github.com/DataDog/browser-sdk/pull/2646))
30+
-[RUM-2885] Collect CSP disposition ([#2635](https://github.com/DataDog/browser-sdk/pull/2635))
31+
- 🐛 [RUM-3440] Fix INP CSS selector computation
32+
- 🐛 [RUM-3502] fix fetch(url) tracing ([#2642](https://github.com/DataDog/browser-sdk/pull/2642))
33+
- 🔧 Enforce snake case for event type properties ([#2649](https://github.com/DataDog/browser-sdk/pull/2649))
34+
- 🔊 [RUM-3501] add `tracking_consent` to configuration telemetry ([#2640](https://github.com/DataDog/browser-sdk/pull/2640))
35+
- 🔧 configure renovate to deduplicate subdependencies ([#2643](https://github.com/DataDog/browser-sdk/pull/2643))
36+
1937
## v5.11.0
2038

2139
-[RUM-3349] enable the consent management API ([#2634](https://github.com/DataDog/browser-sdk/pull/2634))

LICENSE-3rdparty.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ dev,karma-spec-reporter,MIT,Copyright 2015 Michael Lex
6363
dev,karma-webpack,MIT,Copyright JS Foundation and other contributors
6464
dev,lerna,MIT,Copyright 2015-present Lerna Contributors
6565
dev,minimatch,ISC,Copyright (c) Isaac Z. Schlueter and Contributors
66-
dev,node-fetch,MIT,Copyright 2016-2020 Node Fetch Team
6766
dev,node-forge,BSD,Copyright (c) 2010, Digital Bazaar, Inc.
6867
dev,npm-run-all,MIT,Copyright 2015 Toru Nagashima
6968
dev,pako,MIT,(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,29 @@ Datadog provides one CDN bundle per [site][70]:
4141
[2]: https://imgix.datadoghq.com/img/favicons/favicon-32x32.png
4242
[01]: https://badge.fury.io/js/%40datadog%2Fbrowser-logs.svg
4343
[02]: https://badge.fury.io/js/%40datadog%2Fbrowser-logs
44-
[03]: https://badgen.net/bundlephobia/minzip/@datadog/browser-logs
45-
[04]: https://bundlephobia.com/result?p=@datadog/browser-logs
44+
45+
[03]: https://deno.bundlejs.com/badge?q=@datadog/browser-logs&treeshake=[*]
46+
[04]: https://bundlejs.com/?q=@datadog/browser-logs&treeshake=[*]
4647
[08]: https://docs.datadoghq.com/logs/log_collection/javascript
4748
[11]: https://badge.fury.io/js/%40datadog%2Fbrowser-rum.svg
4849
[12]: https://badge.fury.io/js/%40datadog%2Fbrowser-rum
49-
[13]: https://badgen.net/bundlephobia/minzip/@datadog/browser-rum
50-
[14]: https://bundlephobia.com/result?p=@datadog/browser-rum
50+
[13]: https://deno.bundlejs.com/badge?q=@datadog/browser-rum&treeshake=[*]
51+
[14]: https://bundlejs.com/?q=@datadog/browser-rum&treeshake=[*]
5152
[18]: https://docs.datadoghq.com/real_user_monitoring/browser/
5253
[21]: https://badge.fury.io/js/%40datadog%2Fbrowser-rum-slim.svg
5354
[22]: https://badge.fury.io/js/%40datadog%2Fbrowser-rum-slim
54-
[23]: https://badgen.net/bundlephobia/minzip/@datadog/browser-rum-slim
55-
[24]: https://bundlephobia.com/result?p=@datadog/browser-rum-slim
55+
[23]: https://deno.bundlejs.com/badge?q=@datadog/browser-rum-slim&treeshake=[*]
56+
[24]: https://bundlejs.com/?q=@datadog/browser-rum-slim&treeshake=[*]
5657
[41]: https://badge.fury.io/js/%40datadog%2Fbrowser-core.svg
5758
[42]: https://badge.fury.io/js/%40datadog%2Fbrowser-core
58-
[43]: https://badgen.net/bundlephobia/minzip/@datadog/browser-core
59-
[44]: https://bundlephobia.com/result?p=@datadog/browser-core
59+
[43]: https://deno.bundlejs.com/badge?q=@datadog/browser-core&treeshake=[*]
60+
[44]: https://bundlejs.com/?q=@datadog/browser-core&treeshake=[*]
6061
[51]: https://badge.fury.io/js/%40datadog%2Fbrowser-rum-core.svg
6162
[52]: https://badge.fury.io/js/%40datadog%2Fbrowser-rum-core
62-
[53]: https://badgen.net/bundlephobia/minzip/@datadog/browser-rum-core
63-
[54]: https://bundlephobia.com/result?p=@datadog/browser-rum-core
63+
[53]: https://deno.bundlejs.com/badge?q=@datadog/browser-rum-core&treeshake=[*]
64+
[54]: https://bundlejs.com/?q=@datadog/browser-rum-core&treeshake=[*]
6465
[61]: https://badge.fury.io/js/%40datadog%2Fbrowser-worker.svg
6566
[62]: https://badge.fury.io/js/%40datadog%2Fbrowser-worker
66-
[63]: https://badgen.net/bundlephobia/minzip/@datadog/browser-worker
67-
[64]: https://bundlephobia.com/result?p=@datadog/browser-worker
67+
[63]: https://deno.bundlejs.com/badge?q=@datadog/browser-worker&treeshake=[*]
68+
[64]: https://bundlejs.com/?q=@datadog/browser-worker&treeshake=[*]
6869
[70]: https://docs.datadoghq.com/getting_started/site/

developer-extension/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
22
"name": "@datadog/browser-sdk-developer-extension",
3-
"version": "5.11.0",
3+
"version": "5.13.0",
44
"private": true,
55
"scripts": {
66
"build": "rm -rf dist && webpack --mode production",
77
"dev": "webpack --mode development --watch"
88
},
99
"devDependencies": {
10-
"@tabler/icons-react": "2.47.0",
11-
"@types/chrome": "0.0.262",
12-
"@types/react": "18.2.63",
13-
"@types/react-dom": "18.2.19",
10+
"@tabler/icons-react": "3.1.0",
11+
"@types/chrome": "0.0.263",
12+
"@types/react": "18.2.69",
13+
"@types/react-dom": "18.2.22",
1414
"@webextension-toolbox/webpack-webextension-plugin": "3.3.1",
1515
"copy-webpack-plugin": "12.0.2",
1616
"css-loader": "6.10.0",
1717
"html-webpack-plugin": "5.6.0",
1818
"style-loader": "3.3.4",
19-
"webpack": "5.90.3"
19+
"webpack": "5.91.0"
2020
},
2121
"dependencies": {
2222
"@datadog/browser-core": "workspace:*",
2323
"@datadog/browser-logs": "workspace:*",
2424
"@datadog/browser-rum": "workspace:*",
25-
"@mantine/core": "7.6.1",
26-
"@mantine/hooks": "7.6.1",
25+
"@mantine/core": "7.6.2",
26+
"@mantine/hooks": "7.6.2",
2727
"clsx": "2.1.0",
2828
"react": "18.2.0",
2929
"react-dom": "18.2.0"

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"npmClient": "yarn",
3-
"version": "5.11.0"
3+
"version": "5.13.0"
44
}

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@
3030
},
3131
"devDependencies": {
3232
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
33-
"@types/chrome": "0.0.262",
33+
"@types/chrome": "0.0.263",
3434
"@types/connect-busboy": "1.0.3",
3535
"@types/cors": "2.8.17",
3636
"@types/express": "4.17.21",
3737
"@types/jasmine": "3.10.18",
38-
"@typescript-eslint/eslint-plugin": "7.1.1",
39-
"@typescript-eslint/parser": "7.1.1",
40-
"@wdio/browserstack-service": "8.32.4",
41-
"@wdio/cli": "8.32.4",
42-
"@wdio/jasmine-framework": "8.32.4",
38+
"@typescript-eslint/eslint-plugin": "7.3.1",
39+
"@typescript-eslint/parser": "7.3.1",
40+
"@wdio/browserstack-service": "8.35.1",
41+
"@wdio/cli": "8.35.1",
42+
"@wdio/jasmine-framework": "8.35.1",
4343
"@wdio/junit-reporter": "8.32.4",
44-
"@wdio/local-runner": "8.32.4",
44+
"@wdio/local-runner": "8.35.1",
4545
"@wdio/spec-reporter": "8.32.4",
4646
"ajv": "6.12.6",
4747
"browserstack-local": "1.5.5",
@@ -54,11 +54,11 @@
5454
"eslint-module-utils": "2.8.1",
5555
"eslint-plugin-import": "2.29.1",
5656
"eslint-plugin-jasmine": "4.1.3",
57-
"eslint-plugin-jsdoc": "48.2.0",
57+
"eslint-plugin-jsdoc": "48.2.1",
5858
"eslint-plugin-local-rules": "2.0.1",
5959
"eslint-plugin-prefer-arrow": "1.2.3",
6060
"eslint-plugin-unicorn": "51.0.1",
61-
"express": "4.18.3",
61+
"express": "4.19.2",
6262
"glob": "10.3.10",
6363
"jasmine-core": "3.99.1",
6464
"json-schema-to-typescript": "bcaudan/json-schema-to-typescript#bcaudan/add-readonly-support",
@@ -73,25 +73,25 @@
7373
"karma-webpack": "5.0.0",
7474
"lerna": "8.1.2",
7575
"minimatch": "9.0.3",
76-
"node-fetch": "3.3.2",
7776
"npm-run-all": "4.1.5",
7877
"prettier": "3.2.5",
7978
"terser-webpack-plugin": "5.3.10",
8079
"ts-loader": "9.5.1",
8180
"ts-node": "10.9.2",
8281
"tsconfig-paths-webpack-plugin": "4.1.0",
8382
"typescript": "5.3.3",
84-
"webdriverio": "8.32.4",
85-
"webpack": "5.90.3",
83+
"webdriverio": "8.35.1",
84+
"webpack": "5.91.0",
8685
"webpack-cli": "5.1.4",
87-
"webpack-dev-middleware": "7.0.0"
86+
"webpack-dev-middleware": "7.1.0"
8887
},
8988
"resolutions": {
90-
"ansi-regex": "5.0.1"
89+
"ansi-regex": "5.0.1",
90+
"@mantine/core/type-fest": "4.14.0"
9191
},
9292
"volta": {
9393
"node": "18.19.1",
94-
"yarn": "1.22.21"
94+
"yarn": "1.22.22"
9595
},
9696
"packageManager": "[email protected]"
9797
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@datadog/browser-core",
3-
"version": "5.11.0",
3+
"version": "5.13.0",
44
"license": "Apache-2.0",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

packages/core/src/domain/configuration/configuration.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import type { RumEvent } from '../../../../rum-core/src'
2+
import { EXHAUSTIVE_INIT_CONFIGURATION, SERIALIZED_EXHAUSTIVE_INIT_CONFIGURATION } from '../../../test'
3+
import type { ExtractTelemetryConfiguration, MapInitConfigurationKey } from '../../../test'
24
import { display } from '../../tools/display'
35
import {
46
ExperimentalFeature,
@@ -7,7 +9,7 @@ import {
79
} from '../../tools/experimentalFeatures'
810
import { TrackingConsent } from '../trackingConsent'
911
import type { InitConfiguration } from './configuration'
10-
import { validateAndBuildConfiguration } from './configuration'
12+
import { serializeConfiguration, validateAndBuildConfiguration } from './configuration'
1113

1214
describe('validateAndBuildConfiguration', () => {
1315
const clientToken = 'some_client_token'
@@ -207,4 +209,15 @@ describe('validateAndBuildConfiguration', () => {
207209
expect(displaySpy).toHaveBeenCalledOnceWith('Tracking Consent should be either "granted" or "not-granted"')
208210
})
209211
})
212+
213+
describe('serializeConfiguration', () => {
214+
it('should serialize the configuration', () => {
215+
// By specifying the type here, we can ensure that serializeConfiguration is returning an
216+
// object containing all expected properties.
217+
const serializedConfiguration: ExtractTelemetryConfiguration<MapInitConfigurationKey<keyof InitConfiguration>> =
218+
serializeConfiguration(EXHAUSTIVE_INIT_CONFIGURATION)
219+
220+
expect(serializedConfiguration).toEqual(SERIALIZED_EXHAUSTIVE_INIT_CONFIGURATION)
221+
})
222+
})
210223
})

packages/core/src/domain/configuration/configuration.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ export const DefaultPrivacyLevel = {
2121
} as const
2222
export type DefaultPrivacyLevel = (typeof DefaultPrivacyLevel)[keyof typeof DefaultPrivacyLevel]
2323

24+
export const TraceContextInjection = {
25+
ALL: 'all',
26+
SAMPLED: 'sampled',
27+
} as const
28+
29+
export type TraceContextInjection = (typeof TraceContextInjection)[keyof typeof TraceContextInjection]
30+
2431
export interface InitConfiguration {
2532
// global options
2633
clientToken: string
@@ -178,7 +185,7 @@ export function validateAndBuildConfiguration(initConfiguration: InitConfigurati
178185
)
179186
}
180187

181-
export function serializeConfiguration(initConfiguration: InitConfiguration): Partial<RawTelemetryConfiguration> {
188+
export function serializeConfiguration(initConfiguration: InitConfiguration) {
182189
return {
183190
session_sample_rate: initConfiguration.sessionSampleRate,
184191
telemetry_sample_rate: initConfiguration.telemetrySampleRate,
@@ -193,5 +200,6 @@ export function serializeConfiguration(initConfiguration: InitConfiguration): Pa
193200
allow_fallback_to_local_storage: !!initConfiguration.allowFallbackToLocalStorage,
194201
store_contexts_across_pages: !!initConfiguration.storeContextsAcrossPages,
195202
allow_untrusted_events: !!initConfiguration.allowUntrustedEvents,
196-
}
203+
tracking_consent: initConfiguration.trackingConsent,
204+
} satisfies RawTelemetryConfiguration
197205
}

packages/core/src/domain/configuration/endpointBuilder.spec.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,42 @@ describe('endpointBuilder', () => {
145145
).not.toContain('flush_reason')
146146
})
147147
})
148+
149+
describe('PCI compliance intake with option', () => {
150+
beforeEach(() => {
151+
;(window as unknown as BuildEnvWindow).__BUILD_ENV__SDK_VERSION__ = 'some_version'
152+
resetExperimentalFeatures()
153+
})
154+
155+
it('should return PCI compliance intake endpoint if site is us1', () => {
156+
const config: InitConfiguration & { usePciIntake?: boolean } = {
157+
clientToken,
158+
usePciIntake: true,
159+
site: 'datadoghq.com',
160+
}
161+
expect(createEndpointBuilder(config, 'logs', []).build('xhr', DEFAULT_PAYLOAD)).toContain(
162+
'https://pci.browser-intake-datadoghq.com'
163+
)
164+
})
165+
it('should not return PCI compliance intake endpoint if site is not us1', () => {
166+
const config: InitConfiguration & { usePciIntake?: boolean } = {
167+
clientToken,
168+
usePciIntake: true,
169+
site: 'ap1.datadoghq.com',
170+
}
171+
expect(createEndpointBuilder(config, 'logs', []).build('xhr', DEFAULT_PAYLOAD)).not.toContain(
172+
'https://pci.browser-intake-datadoghq.com'
173+
)
174+
})
175+
it('should not return PCI compliance intake endpoint if and site is us1 and track is not logs', () => {
176+
const config: InitConfiguration & { usePciIntake?: boolean } = {
177+
clientToken,
178+
usePciIntake: true,
179+
site: 'datadoghq.com',
180+
}
181+
expect(createEndpointBuilder(config, 'rum', []).build('xhr', DEFAULT_PAYLOAD)).not.toContain(
182+
'https://pci.browser-intake-datadoghq.com'
183+
)
184+
})
185+
})
148186
})

packages/core/src/domain/configuration/endpointBuilder.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { normalizeUrl } from '../../tools/utils/urlPolyfill'
44
import { ExperimentalFeature, isExperimentalFeatureEnabled } from '../../tools/experimentalFeatures'
55
import { generateUUID } from '../../tools/utils/stringUtils'
66
import type { InitConfiguration } from './configuration'
7-
import { INTAKE_SITE_US1, INTAKE_SITE_FED_STAGING } from './intakeSites'
7+
import { INTAKE_SITE_US1, INTAKE_SITE_FED_STAGING, PCI_INTAKE_HOST_US1 } from './intakeSites'
88

99
// replaced at build time
1010
declare const __BUILD_ENV__SDK_VERSION__: string
@@ -55,13 +55,17 @@ function createEndpointUrlWithParametersBuilder(
5555
if (typeof proxy === 'function') {
5656
return (parameters) => proxy({ path, parameters })
5757
}
58-
const host = buildEndpointHost(initConfiguration)
58+
const host = buildEndpointHost(trackType, initConfiguration)
5959
return (parameters) => `https://${host}${path}?${parameters}`
6060
}
6161

62-
function buildEndpointHost(initConfiguration: InitConfiguration) {
62+
function buildEndpointHost(trackType: TrackType, initConfiguration: InitConfiguration & { usePciIntake?: boolean }) {
6363
const { site = INTAKE_SITE_US1, internalAnalyticsSubdomain } = initConfiguration
6464

65+
if (trackType === 'logs' && initConfiguration.usePciIntake && site === INTAKE_SITE_US1) {
66+
return PCI_INTAKE_HOST_US1
67+
}
68+
6569
if (internalAnalyticsSubdomain && site === INTAKE_SITE_US1) {
6670
return `${internalAnalyticsSubdomain}.${INTAKE_SITE_US1}`
6771
}

packages/core/src/domain/configuration/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export {
22
Configuration,
33
InitConfiguration,
44
DefaultPrivacyLevel,
5+
TraceContextInjection,
56
validateAndBuildConfiguration,
67
serializeConfiguration,
78
} from './configuration'

packages/core/src/domain/configuration/intakeSites.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export const INTAKE_SITE_FED_STAGING = 'dd0g-gov.com'
33
export const INTAKE_SITE_US1 = 'datadoghq.com'
44
export const INTAKE_SITE_EU1 = 'datadoghq.eu'
55
export const INTAKE_SITE_US1_FED = 'ddog-gov.com'
6+
7+
export const PCI_INTAKE_HOST_US1 = 'pci.browser-intake-datadoghq.com'

0 commit comments

Comments
 (0)