Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUMF-1068] Forward browser_sdk_version to mobile #1162

Merged
merged 8 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/domain/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ interface ReplicaUserConfiguration {
}

export type Configuration = typeof DEFAULT_CONFIGURATION &
TransportConfiguration & {
TransportConfiguration &
BuildEnv & {
cookieOptions: CookieOptions

service?: string
Expand All @@ -107,6 +108,7 @@ export function buildConfiguration(initConfiguration: InitConfiguration, buildEn
initConfiguration.beforeSend && catchUserErrors(initConfiguration.beforeSend, 'beforeSend threw an error:'),
cookieOptions: buildCookieOptions(initConfiguration),
service: initConfiguration.service,
...buildEnv,
amortemousque marked this conversation as resolved.
Show resolved Hide resolved
...computeTransportConfiguration(initConfiguration, buildEnv),
...DEFAULT_CONFIGURATION,
}
Expand Down
2 changes: 2 additions & 0 deletions packages/rum-core/src/domain/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function startRumAssembly(
session: {
plan: session.hasReplayPlan() ? RumSessionPlan.REPLAY : RumSessionPlan.LITE,
},
browser_sdk_version: configuration.sdkVersion,
amortemousque marked this conversation as resolved.
Show resolved Hide resolved
},
application: {
id: applicationId,
Expand All @@ -116,6 +117,7 @@ export function startRumAssembly(
if (!isEmptyObject(commonContext.user)) {
;(serverRumEvent.usr as Mutable<RumEvent['usr']>) = commonContext.user as User & Context
}

if (shouldSend(serverRumEvent, configuration.beforeSend, domainContext, eventRateLimiters)) {
if (isEmptyObject(serverRumEvent.context)) {
delete serverRumEvent.context
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 @@ -188,6 +188,7 @@ export interface RumContext {
session: {
plan: RumSessionPlan
}
browser_sdk_version: string
amortemousque marked this conversation as resolved.
Show resolved Hide resolved
}
}

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 @@ -180,6 +180,7 @@ function validateRumEventFormat(rawRumEvent: RawRumEvent) {
session: {
plan: RumSessionPlan.REPLAY,
},
browser_sdk_version: 'dev',
amortemousque marked this conversation as resolved.
Show resolved Hide resolved
},
application: {
id: fakeId,
Expand Down