Skip to content

Commit e422f97

Browse files
🔉 report missing configuration options (#3832)
* update rum-events-schema * report missing configuration options as telemetry
1 parent 45bf5fd commit e422f97

File tree

5 files changed

+83
-10
lines changed

5 files changed

+83
-10
lines changed

‎packages/core/src/domain/telemetry/telemetryEvent.types.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ export type TelemetryConfigurationEvent = CommonTelemetryProperties & {
205205
* Whether the allowed tracing urls list is used
206206
*/
207207
use_allowed_tracing_urls?: boolean
208+
/**
209+
* Whether the allowed GraphQL urls list is used
210+
*/
211+
use_allowed_graph_ql_urls?: boolean
212+
/**
213+
* Whether GraphQL payload tracking is used for at least one GraphQL endpoint
214+
*/
215+
use_track_graph_ql_payload?: boolean
208216
/**
209217
* A list of selected tracing propagators
210218
*/
@@ -443,6 +451,18 @@ export type TelemetryConfigurationEvent = CommonTelemetryProperties & {
443451
* The id of the remote configuration
444452
*/
445453
remote_configuration_id?: string
454+
/**
455+
* Whether a proxy is used for remote configuration
456+
*/
457+
use_remote_configuration_proxy?: boolean
458+
/**
459+
* The percentage of sessions with Profiling enabled
460+
*/
461+
profiling_sample_rate?: number
462+
/**
463+
* Whether trace baggage is propagated to child spans
464+
*/
465+
propagate_trace_baggage?: boolean
446466
[k: string]: unknown
447467
}
448468
[k: string]: unknown

‎packages/rum-core/src/domain/configuration/configuration.spec.ts‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,22 +540,18 @@ describe('serializeRumConfiguration', () => {
540540
remoteConfigurationProxy: 'config',
541541
plugins: [{ name: 'foo', getConfigurationTelemetry: () => ({ bar: true }) }],
542542
trackFeatureFlagsForEvents: ['vital'],
543-
profilingSampleRate: 0,
543+
profilingSampleRate: 42,
544544
propagateTraceBaggage: true,
545545
}
546546

547547
type MapRumInitConfigurationKey<Key extends string> = Key extends keyof InitConfiguration
548548
? MapInitConfigurationKey<Key>
549-
: Key extends 'workerUrl' | 'allowedTracingUrls' | 'excludedActivityUrls'
549+
: Key extends 'workerUrl' | 'allowedTracingUrls' | 'excludedActivityUrls' | 'remoteConfigurationProxy'
550550
? `use_${CamelToSnakeCase<Key>}`
551551
: Key extends 'trackLongTasks'
552552
? 'track_long_task' // oops
553-
: Key extends
554-
| 'applicationId'
555-
| 'subdomain'
556-
| 'remoteConfigurationProxy'
557-
| 'profilingSampleRate'
558-
| 'propagateTraceBaggage'
553+
: // The following options are not reported as telemetry. Please avoid adding more of them.
554+
Key extends 'applicationId' | 'subdomain'
559555
? never
560556
: CamelToSnakeCase<Key>
561557
// By specifying the type here, we can ensure that serializeConfiguration is returning an
@@ -569,6 +565,7 @@ describe('serializeRumConfiguration', () => {
569565
session_replay_sample_rate: 60,
570566
trace_sample_rate: 50,
571567
trace_context_injection: TraceContextInjection.ALL,
568+
propagate_trace_baggage: true,
572569
use_allowed_tracing_urls: true,
573570
selected_tracing_propagators: ['tracecontext', 'datadog'],
574571
use_excluded_activity_urls: true,
@@ -586,6 +583,8 @@ describe('serializeRumConfiguration', () => {
586583
plugins: [{ name: 'foo', bar: true }],
587584
track_feature_flags_for_events: ['vital'],
588585
remote_configuration_id: '123',
586+
use_remote_configuration_proxy: true,
587+
profiling_sample_rate: 42,
589588
})
590589
})
591590
})

‎packages/rum-core/src/domain/configuration/configuration.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ export function serializeRumConfiguration(configuration: RumInitConfiguration) {
394394
start_session_replay_recording_manually: configuration.startSessionReplayRecordingManually,
395395
trace_sample_rate: configuration.traceSampleRate,
396396
trace_context_injection: configuration.traceContextInjection,
397+
propagate_trace_baggage: configuration.propagateTraceBaggage,
397398
action_name_attribute: configuration.actionNameAttribute,
398399
use_allowed_tracing_urls:
399400
Array.isArray(configuration.allowedTracingUrls) && configuration.allowedTracingUrls.length > 0,
@@ -415,6 +416,8 @@ export function serializeRumConfiguration(configuration: RumInitConfiguration) {
415416
})),
416417
track_feature_flags_for_events: configuration.trackFeatureFlagsForEvents,
417418
remote_configuration_id: configuration.remoteConfigurationId,
419+
profiling_sample_rate: configuration.profilingSampleRate,
420+
use_remote_configuration_proxy: !!configuration.remoteConfigurationProxy,
418421
...baseSerializedConfiguration,
419422
} satisfies RawTelemetryConfiguration
420423
}

‎packages/rum-core/src/rumEvent.types.ts‎

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,8 @@ export type RumResourceEvent = CommonProperties &
826826
* Schema of all properties of a View event
827827
*/
828828
export type RumViewEvent = CommonProperties &
829-
ViewContainerSchema & {
829+
ViewContainerSchema &
830+
StreamSchema & {
830831
/**
831832
* RUM event type
832833
*/
@@ -1644,6 +1645,16 @@ export interface CommonProperties {
16441645
context?: {
16451646
[k: string]: unknown
16461647
}
1648+
/**
1649+
* Stream properties
1650+
*/
1651+
stream?: {
1652+
/**
1653+
* UUID of the stream
1654+
*/
1655+
readonly id: string
1656+
[k: string]: unknown
1657+
}
16471658
[k: string]: unknown
16481659
}
16491660
/**
@@ -1727,6 +1738,46 @@ export interface ProfilingInternalContextSchema {
17271738
| 'unexpected-exception'
17281739
[k: string]: unknown
17291740
}
1741+
/**
1742+
* Stream schema for media streaming properties
1743+
*/
1744+
export interface StreamSchema {
1745+
/**
1746+
* Stream properties
1747+
*/
1748+
readonly stream?: {
1749+
/**
1750+
* current bitrate at the time of collection
1751+
*/
1752+
bitrate?: number
1753+
/**
1754+
* How long is the content (VOD only) (in ms)
1755+
*/
1756+
readonly duration?: number
1757+
/**
1758+
* Stream format
1759+
*/
1760+
readonly format?: string
1761+
/**
1762+
* current frames per second at the time of collection
1763+
*/
1764+
fps?: number
1765+
/**
1766+
* Stream resolution
1767+
*/
1768+
readonly resolution?: string
1769+
/**
1770+
* current timestamp at the time of collection
1771+
*/
1772+
timestamp?: number
1773+
/**
1774+
* how much did the media progress since the last context update (in ms)
1775+
*/
1776+
watch_time?: number
1777+
[k: string]: unknown
1778+
}
1779+
[k: string]: unknown
1780+
}
17301781
/**
17311782
* Schema of properties for a technical performance metric
17321783
*/

0 commit comments

Comments
 (0)