Skip to content

Commit

Permalink
✨ [RUMF-1146] add 'source:browser' to all RUM events (#1271)
Browse files Browse the repository at this point in the history
* 📦 upgrade json-schema-to-typescript in yarn.lock

* 🏷️ [RUMF-1146] sync rum-event-format

* ✨ [RUMF-1146] add 'source:browser' to all RUM events
  • Loading branch information
BenoitZugmeyer authored Jan 17, 2022
1 parent 486faa2 commit c36718f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/rum-core/src/domain/assembly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ describe('rum assembly', () => {
expect(serverRumEvents[0].view.id).toBeDefined()
expect(serverRumEvents[0].date).toBeDefined()
expect(serverRumEvents[0].session.id).toBeDefined()
expect(serverRumEvents[0].source).toBe('browser')
})

it('should be overwritten by event attributes', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/rum-core/src/domain/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export function startRumAssembly(
},
date: timeStampNow(),
service: configuration.service,
source: 'browser',
session: {
id: session.id,
type: syntheticsContext ? SessionType.SYNTHETICS : ciTestContext ? SessionType.CI_TEST : SessionType.USER,
Expand Down
1 change: 1 addition & 0 deletions packages/rum-core/src/rawRumEvent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export interface RumContext {
id: string
}
service?: string
source: 'browser'
session: {
id: string
type: string
Expand Down
7 changes: 6 additions & 1 deletion packages/rum-core/src/rumEvent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export type RumErrorEvent = CommonProperties & {
/**
* Source type of the error (the language or platform impacting the error stacktrace format)
*/
readonly source_type?: 'android' | 'browser' | 'ios' | 'react-native'
readonly source_type?: 'android' | 'browser' | 'ios' | 'react-native' | 'flutter'
/**
* Resource properties of the error
*/
Expand Down Expand Up @@ -685,6 +685,10 @@ export interface CommonProperties {
readonly has_replay?: boolean
[k: string]: unknown
}
/**
* The source of this event
*/
readonly source?: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native'
/**
* View properties
*/
Expand Down Expand Up @@ -789,6 +793,7 @@ export interface CommonProperties {
* The identifier of the current CI Visibility test execution
*/
readonly test_execution_id: string
[k: string]: unknown
}
/**
* Internal properties
Expand Down
1 change: 1 addition & 0 deletions packages/rum-core/test/specHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ function validateRumEventFormat(rawRumEvent: RawRumEvent) {
id: fakeId,
},
date: 0 as TimeStamp,
source: 'browser',
session: {
id: fakeId,
type: 'user',
Expand Down
28 changes: 20 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,11 @@
dependencies:
"@types/node" "*"

"@types/lodash@^4.14.168":
version "4.14.178"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8"
integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==

"@types/mime-types@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.0.tgz#9ca52cda363f699c69466c2a6ccdaad913ea7a73"
Expand Down Expand Up @@ -1687,6 +1692,11 @@
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==

"@types/prettier@^2.1.5":
version "2.4.3"
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf"
integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w==

"@types/prop-types@*":
version "15.7.3"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
Expand Down Expand Up @@ -4753,6 +4763,11 @@ get-port@^5.1.1:
resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193"
integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==

get-stdin@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53"
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==

get-stream@^5.0.0, get-stream@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9"
Expand Down Expand Up @@ -5709,11 +5724,14 @@ json-schema-ref-parser@^9.0.6:
"@apidevtools/json-schema-ref-parser" "9.0.6"

json-schema-to-typescript@bcaudan/json-schema-to-typescript#bcaudan/add-readonly-support:
version "10.0.0"
resolved "https://codeload.github.com/bcaudan/json-schema-to-typescript/tar.gz/8e9db97005abc06e0b8ade219a787c477ef169af"
version "10.1.4"
resolved "https://codeload.github.com/bcaudan/json-schema-to-typescript/tar.gz/5a40ba26e12950677e242afeed0074bcbaa25da9"
dependencies:
"@types/json-schema" "^7.0.6"
"@types/lodash" "^4.14.168"
"@types/prettier" "^2.1.5"
cli-color "^2.0.0"
get-stdin "^8.0.0"
glob "^7.1.6"
glob-promise "^3.4.0"
is-glob "^4.0.1"
Expand All @@ -5724,7 +5742,6 @@ json-schema-to-typescript@bcaudan/json-schema-to-typescript#bcaudan/add-readonly
mkdirp "^1.0.4"
mz "^2.7.0"
prettier "^2.2.0"
stdin "0.0.1"

json-schema-traverse@^0.4.1:
version "0.4.1"
Expand Down Expand Up @@ -8532,11 +8549,6 @@ stack-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=

stdin@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/stdin/-/stdin-0.0.1.tgz#d3041981aaec3dfdbc77a1b38d6372e38f5fb71e"
integrity sha1-0wQZgarsPf28d6GzjWNy449ftx4=

stream-buffers@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-3.0.2.tgz#5249005a8d5c2d00b3a32e6e0a6ea209dc4f3521"
Expand Down

0 comments on commit c36718f

Please sign in to comment.