Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"woke": "scripts/cli woke"
},
"devDependencies": {
"@datadog/rum-events-format": "DataDog/rum-events-format#commit=e18f1d3b6a018f00061239bf14fbfb748c9538a3",
"@datadog/rum-events-format": "DataDog/rum-events-format#commit=131bf26801ca82202df1ef5e0124551cdb656410",
"@eslint/js": "10.0.1",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@microsoft/api-extractor": "7.58.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,36 @@ export type TelemetryConfigurationEvent = CommonTelemetryProperties & {
* Whether a proxy is used for remote configuration
*/
use_remote_configuration_proxy?: boolean
/**
* Metadata of the remote configuration currently applied for this session
*/
remote_configuration?: {
/**
* Identifier of the remote configuration bundle this metadata belongs to
*/
config_id?: string
/**
* CDN version identifier of the applied configuration
*/
version_id?: string
/**
* CDN publish timestamp of the applied configuration, in ms from epoch
*/
last_modified?: number
/**
* Timestamp at which the device fetched and cached this configuration version, in ms from epoch
*/
last_synced?: number
/**
* Timestamp at which this configuration version was first observed as applied by the device, in ms from epoch. Stamped once and reused on every subsequent session that runs on the same version
*/
first_applied?: number
/**
* Identifier of the sync that produced this configuration version, used to deduplicate repeat sessions from the same device without a persistent identifier
*/
sync_id?: string
[k: string]: unknown
}
/**
* The percentage of sessions with Profiling enabled
*/
Expand All @@ -487,6 +517,14 @@ export type TelemetryConfigurationEvent = CommonTelemetryProperties & {
* Whether the beta track WebSockets feature is enabled
*/
beta_track_web_sockets?: boolean
/**
* Whether tracing feature's client-side-stats generation is enabled
*/
use_client_side_stats?: boolean
/**
* Whether trace sampling rules are configured
*/
use_trace_sampling_rules?: boolean
[k: string]: unknown
}
[k: string]: unknown
Expand Down Expand Up @@ -558,7 +596,7 @@ export type TelemetryBrowserFeaturesUsage =
/**
* Schema of mobile specific features usage
*/
export type TelemetryMobileFeaturesUsage = TrackWebView | AndroidNetworkInstrumentation
export type TelemetryMobileFeaturesUsage = TrackWebView | Timeseries | AndroidNetworkInstrumentation

/**
* Schema of common properties of Telemetry events
Expand Down Expand Up @@ -598,7 +636,7 @@ export interface CommonTelemetryProperties {
| 'unity'
| 'kotlin-multiplatform'
| 'electron'
| 'rum-cpp'
| 'cpp'
| 'maui'
/**
* The version of the SDK generating the telemetry event
Expand Down Expand Up @@ -995,6 +1033,13 @@ export interface TrackWebView {
feature: 'trackWebView'
[k: string]: unknown
}
export interface Timeseries {
/**
* Timeseries tracking enabled
*/
feature: 'timeseries'
[k: string]: unknown
}
export interface AndroidNetworkInstrumentation {
/**
* Android network instrumentation
Expand Down
33 changes: 28 additions & 5 deletions packages/browser-rum-core/src/rumEvent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export type RumActionEvent = CommonProperties &
/**
* View properties
*/
readonly view?: {
readonly view: {
/**
* Is the action starting in the foreground (focus in browser)
*/
Expand Down Expand Up @@ -178,6 +178,9 @@ export type RumTransitionEvent = CommonProperties & {
* RUM event type
*/
readonly type: 'transition'
readonly view: {
[k: string]: unknown
}
/**
* Stream properties
*/
Expand Down Expand Up @@ -487,7 +490,7 @@ export type RumErrorEvent = CommonProperties &
/**
* View properties
*/
readonly view?: {
readonly view: {
/**
* Is the error starting in the foreground (focus in browser)
*/
Expand Down Expand Up @@ -536,6 +539,9 @@ export type RumLongTaskEvent = CommonProperties &
* RUM event type
*/
readonly type: 'long_task'
readonly view: {
[k: string]: unknown
}
/**
* Long Task properties
*/
Expand Down Expand Up @@ -669,6 +675,9 @@ export type RumResourceEvent = CommonProperties &
* RUM event type
*/
readonly type: 'resource'
readonly view: {
[k: string]: unknown
}
/**
* Resource properties
*/
Expand Down Expand Up @@ -824,6 +833,10 @@ export type RumResourceEvent = CommonProperties &
* Delivery type of the resource
*/
readonly delivery_type?: 'cache' | 'navigational-prefetch' | 'other'
/**
* Whether the resource was served from the device's local cache
*/
readonly local_cache_hit?: boolean
/**
* The provider for this resource
*/
Expand Down Expand Up @@ -943,6 +956,9 @@ export type RumViewUpdateEvent = ViewContainerSchema &
* RUM event type
*/
readonly type: 'view_update'
readonly view: {
[k: string]: unknown
}
[k: string]: unknown
}
export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent
Expand Down Expand Up @@ -975,6 +991,9 @@ export type RumVitalEventCommonProperties = CommonProperties &
* RUM event type
*/
readonly type: 'vital'
readonly view: {
[k: string]: unknown
}
/**
* Vital properties
*/
Expand Down Expand Up @@ -1107,12 +1126,12 @@ export interface CommonProperties {
| 'unity'
| 'kotlin-multiplatform'
| 'electron'
| 'rum-cpp'
| 'cpp'
| 'maui'
/**
* View properties
*/
readonly view: {
readonly view?: {
/**
* UUID of the view
*/
Expand Down Expand Up @@ -1392,6 +1411,10 @@ export interface CommonProperties {
* The percentage of sessions with traced resources
*/
readonly trace_sample_rate?: number
/**
* Session Replay experimental features enabled in the SDK configuration
*/
readonly session_replay_experimental_features?: string[]
[k: string]: unknown
}
/**
Expand Down Expand Up @@ -1453,7 +1476,7 @@ export interface ViewContainerSchema {
| 'unity'
| 'kotlin-multiplatform'
| 'electron'
| 'rum-cpp'
| 'cpp'
| 'maui'
[k: string]: unknown
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ function decodeChangeRecord(
break
}

case ChangeType.AddRoleAnnotatedStrings:
case ChangeType.InputValue:
case ChangeType.InputSelection:
// These change types exist in the schema, but nothing generates them yet.
throw new Error(`Unsupported ChangeType: ${change[0]}`)

default:
change satisfies never
throw new Error(`Unsupported ChangeType: ${change[0] as any}`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { StringOrStringReference } from '../../../types'
import type { StringId } from '../itemIds'

export interface StringTable {
add(newString: string): void
decode(stringOrStringId: number | string): string
decode(value: StringOrStringReference): string
}

export function createStringTable(): StringTable {
Expand All @@ -11,13 +12,17 @@ export function createStringTable(): StringTable {
add(newString: string): void {
strings.set(strings.size as StringId, newString)
},
decode(stringOrStringId: number | string): string {
if (typeof stringOrStringId === 'string') {
return stringOrStringId
decode(value: StringOrStringReference): string {
if (typeof value === 'string') {
return value // A plain string literal.
}
const referencedString = strings.get(stringOrStringId as StringId)
if (typeof value === 'object') {
return value.string // A role-annotated string literal.
}

const referencedString = strings.get(value as StringId)
if (referencedString === undefined) {
throw new Error(`Reference to unknown string: ${stringOrStringId}`)
throw new Error(`Reference to unknown string: ${value}`)
}
return referencedString
},
Expand Down
Loading
Loading