Skip to content

Commit fbd5b1b

Browse files
committed
Update rum schema
1 parent fc39b65 commit fbd5b1b

File tree

14 files changed

+1066
-333
lines changed

14 files changed

+1066
-333
lines changed

features/dd-sdk-android-rum/api/apiSurface

Lines changed: 122 additions & 37 deletions
Large diffs are not rendered by default.

features/dd-sdk-android-rum/api/dd-sdk-android-rum.api

Lines changed: 699 additions & 266 deletions
Large diffs are not rendered by default.

features/dd-sdk-android-rum/src/main/json/rum/_common-schema.json

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
"description": "UUID of the application",
2323
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
2424
"readOnly": true
25+
},
26+
"current_locale": {
27+
"type": "string",
28+
"description": "The user's current locale as a language tag (language + region), computed from their preferences and the app's supported languages, e.g. 'es-FR'.",
29+
"readOnly": true
2530
}
2631
},
2732
"readOnly": true
@@ -44,6 +49,11 @@
4449
"description": "Generated unique ID of the application build. Unlike version or build_version this field is not meant to be coming from the user, but rather generated by the tooling for each build.",
4550
"readOnly": true
4651
},
52+
"ddtags": {
53+
"type": "string",
54+
"description": "Tags of the event in key:value format, separated by commas (e.g. 'env:prod,version:1.2.3')",
55+
"readOnly": true
56+
},
4757
"session": {
4858
"type": "object",
4959
"description": "Session properties",
@@ -286,7 +296,6 @@
286296
"device": {
287297
"type": "object",
288298
"description": "Device properties",
289-
"required": ["type"],
290299
"properties": {
291300
"type": {
292301
"type": "string",
@@ -313,6 +322,39 @@
313322
"type": "string",
314323
"description": "The CPU architecture of the device that is reporting the error",
315324
"readOnly": true
325+
},
326+
"locale": {
327+
"type": "string",
328+
"description": "The user’s locale as a language tag combining language and region, e.g. 'en-US'.",
329+
"readOnly": true
330+
},
331+
"locales": {
332+
"type": "array",
333+
"description": "Ordered list of the user’s preferred system languages as IETF language tags.",
334+
"items": {
335+
"type": "string"
336+
},
337+
"readOnly": true
338+
},
339+
"time_zone": {
340+
"type": "string",
341+
"description": "The device’s current time zone identifier, e.g. 'Europe/Berlin'.",
342+
"readOnly": true
343+
},
344+
"battery_level": {
345+
"type": "number",
346+
"description": "Current battery level of the device (0.0 to 1.0).",
347+
"readOnly": true
348+
},
349+
"power_saving_mode": {
350+
"type": "boolean",
351+
"description": "Whether the device is in power saving mode.",
352+
"readOnly": true
353+
},
354+
"brightness_level": {
355+
"type": "number",
356+
"description": "Current screen brightness level (0.0 to 1.0).",
357+
"readOnly": true
316358
}
317359
}
318360
},
@@ -371,13 +413,25 @@
371413
"minimum": 0,
372414
"maximum": 100,
373415
"readOnly": true
416+
},
417+
"profiling_sample_rate": {
418+
"type": "number",
419+
"description": "The percentage of views profiled",
420+
"minimum": 0,
421+
"maximum": 100,
422+
"readOnly": true
374423
}
375424
}
376425
},
377426
"browser_sdk_version": {
378427
"type": "string",
379428
"description": "Browser SDK version",
380429
"readOnly": true
430+
},
431+
"sdk_name": {
432+
"type": "string",
433+
"description": "SDK name (e.g. 'logs', 'rum', 'rum-slim', etc.)",
434+
"readOnly": true
381435
}
382436
},
383437
"readOnly": true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rum/_profiling-internal-context-schema.json",
4+
"title": "ProfilingInternalContextSchema",
5+
"type": "object",
6+
"description": "RUM Profiler Internal Context schema",
7+
"properties": {
8+
"status": {
9+
"type": "string",
10+
"description": "Used to track the status of the RUM Profiler.\n\nThey are defined in order of when they can happen, from the moment the SDK is initialized to the moment the Profiler is actually running.\n\n- `starting`: The Profiler is starting (i.e., when the SDK just started). This is the initial status.\n- `running`: The Profiler is running.\n- `stopped`: The Profiler is stopped.\n- `error`: The Profiler encountered an error. See `error_reason` for more details.",
11+
"enum": ["starting", "running", "stopped", "error"],
12+
"readOnly": true
13+
},
14+
"error_reason": {
15+
"type": "string",
16+
"description": "The reason the Profiler encountered an error. This attribute is only present if the status is `error`.\n\nPossible values:\n- `not-supported-by-browser`: The browser does not support the Profiler (i.e., `window.Profiler` is not available).\n- `failed-to-lazy-load`: The Profiler script failed to be loaded by the browser (may be a connection issue or the chunk was not found).\n- `missing-document-policy-header`: The Profiler failed to start because its missing `Document-Policy: js-profiling` HTTP response header.\n- `unexpected-exception`: An exception occurred when starting the Profiler.",
17+
"enum": [
18+
"not-supported-by-browser",
19+
"failed-to-lazy-load",
20+
"missing-document-policy-header",
21+
"unexpected-exception"
22+
],
23+
"readOnly": true
24+
}
25+
}
26+
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "rum/_view-accessibility-schema.json",
4+
"title": "ViewAccessibilityProperties",
5+
"type": "object",
6+
"description": "Compact representation of accessibility features for a view",
7+
"readOnly": true,
8+
"properties": {
9+
"text_size": {
10+
"type": "string",
11+
"description": "User’s preferred text scale relative to the default system size.",
12+
"readOnly": true
13+
},
14+
"screen_reader_enabled": {
15+
"type": "boolean",
16+
"description": "Indicates whether a screen reader is currently active.",
17+
"readOnly": true
18+
},
19+
"bold_text_enabled": {
20+
"type": "boolean",
21+
"description": "Indicates whether the system-wide bold text accessibility setting is enabled.",
22+
"readOnly": true
23+
},
24+
"reduce_transparency_enabled": {
25+
"type": "boolean",
26+
"description": "Indicates whether the system-wide reduce transparency setting is enabled.",
27+
"readOnly": true
28+
},
29+
"reduce_motion_enabled": {
30+
"type": "boolean",
31+
"description": "Indicates whether the system-wide reduce motion setting is enabled.",
32+
"readOnly": true
33+
},
34+
"button_shapes_enabled": {
35+
"type": "boolean",
36+
"description": "Indicates whether the system-wide button shapes setting is enabled.",
37+
"readOnly": true
38+
},
39+
"invert_colors_enabled": {
40+
"type": "boolean",
41+
"description": "Indicates whether the system-wide color inversion setting is enabled.",
42+
"readOnly": true
43+
},
44+
"increase_contrast_enabled": {
45+
"type": "boolean",
46+
"description": "Indicates whether the system-wide increase contrast setting is enabled.",
47+
"readOnly": true
48+
},
49+
"assistive_switch_enabled": {
50+
"type": "boolean",
51+
"description": "Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.",
52+
"readOnly": true
53+
},
54+
"assistive_touch_enabled": {
55+
"type": "boolean",
56+
"description": "Indicates whether the system-wide AssistiveTouch feature is currently enabled.",
57+
"readOnly": true
58+
},
59+
"video_autoplay_enabled": {
60+
"type": "boolean",
61+
"description": "Indicates whether the video autoplay setting is enabled in the system or application.",
62+
"readOnly": true
63+
},
64+
"closed_captioning_enabled": {
65+
"type": "boolean",
66+
"description": "Indicates whether closed captioning is enabled for media playback.",
67+
"readOnly": true
68+
},
69+
"mono_audio_enabled": {
70+
"type": "boolean",
71+
"description": "Indicates whether the system-wide mono audio setting is enabled.",
72+
"readOnly": true
73+
},
74+
"shake_to_undo_enabled": {
75+
"type": "boolean",
76+
"description": "Indicates whether the Shake to Undo feature is enabled.",
77+
"readOnly": true
78+
},
79+
"reduced_animations_enabled": {
80+
"type": "boolean",
81+
"description": "Indicates whether the user prefers reduced animations or cross-fade transitions.",
82+
"readOnly": true
83+
},
84+
"should_differentiate_without_color": {
85+
"type": "boolean",
86+
"description": "Indicates whether the system should differentiate interface elements without relying solely on color.",
87+
"readOnly": true
88+
},
89+
"grayscale_enabled": {
90+
"type": "boolean",
91+
"description": "Indicates whether the device display is currently using grayscale mode.",
92+
"readOnly": true
93+
},
94+
"single_app_mode_enabled": {
95+
"type": "boolean",
96+
"description": "Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.",
97+
"readOnly": true
98+
},
99+
"on_off_switch_labels_enabled": {
100+
"type": "boolean",
101+
"description": "Indicates whether on/off switch labels are enabled in the system settings.",
102+
"readOnly": true
103+
},
104+
"speak_screen_enabled": {
105+
"type": "boolean",
106+
"description": "Indicates whether the Speak Screen feature is enabled.",
107+
"readOnly": true
108+
},
109+
"speak_selection_enabled": {
110+
"type": "boolean",
111+
"description": "Indicates whether the text-to-speech selection feature is enabled.",
112+
"readOnly": true
113+
}
114+
}
115+
}

features/dd-sdk-android-rum/src/main/json/rum/error-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"category": {
102102
"type": "string",
103103
"description": "The specific category of the error. It provides a high-level grouping for different types of errors.",
104-
"enum": ["ANR", "App Hang", "Exception", "Watchdog Termination", "Memory Warning"],
104+
"enum": ["ANR", "App Hang", "Exception", "Watchdog Termination", "Memory Warning", "Network"],
105105
"readOnly": true
106106
},
107107
"handling": {

features/dd-sdk-android-rum/src/main/json/rum/long_task-schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@
169169
"type": "boolean",
170170
"description": "Whether the long task should be discarded or indexed",
171171
"readOnly": true
172+
},
173+
"profiling": {
174+
"type": "object",
175+
"description": "Profiling context",
176+
"allOf": [{ "$ref": "./_profiling-internal-context-schema.json" }]
172177
}
173178
},
174179
"readOnly": true

features/dd-sdk-android-rum/src/main/json/rum/resource-schema.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,18 @@
324324
"pattern": "^[0-9]+$",
325325
"readOnly": true
326326
},
327-
"trace_id": {
327+
"parent_span_id": {
328328
"type": "string",
329-
"description": "trace identifier in decimal format",
329+
"description": "parent span identifier in decimal format",
330330
"pattern": "^[0-9]+$",
331331
"readOnly": true
332332
},
333+
"trace_id": {
334+
"type": "string",
335+
"description": "trace identifier, either a 64 bit decimal number or a 128 bit hexadecimal number padded with 0s",
336+
"pattern": "^[0-9]{1,20}|[0-9a-fA-F]{32}$",
337+
"readOnly": true
338+
},
333339
"rule_psr": {
334340
"type": "number",
335341
"description": "trace sample rate in decimal format",

features/dd-sdk-android-rum/src/main/json/rum/view-schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@
397397
"performance": {
398398
"description": "Performance data. (Web Vitals, etc.)",
399399
"allOf": [{ "$ref": "_view-performance-schema.json" }]
400+
},
401+
"accessibility": {
402+
"description": "Accessibility properties of the view",
403+
"allOf": [{ "$ref": "_view-accessibility-schema.json" }]
400404
}
401405
},
402406
"readOnly": true
@@ -521,6 +525,11 @@
521525
"readOnly": true
522526
}
523527
}
528+
},
529+
"profiling": {
530+
"type": "object",
531+
"description": "Profiling context",
532+
"allOf": [{ "$ref": "./_profiling-internal-context-schema.json" }]
524533
}
525534
},
526535
"readOnly": true

features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumEventExt.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ internal fun NetworkInfo.toErrorConnectivity(): ErrorEvent.Connectivity {
239239

240240
internal fun NetworkInfo.toLongTaskConnectivity(): LongTaskEvent.Connectivity {
241241
val status = if (isConnected()) {
242-
LongTaskEvent.Status.CONNECTED
242+
LongTaskEvent.ConnectivityStatus.CONNECTED
243243
} else {
244-
LongTaskEvent.Status.NOT_CONNECTED
244+
LongTaskEvent.ConnectivityStatus.NOT_CONNECTED
245245
}
246246
val interfaces = when (connectivity) {
247247
NetworkInfo.Connectivity.NETWORK_ETHERNET -> listOf(LongTaskEvent.Interface.ETHERNET)
@@ -276,9 +276,9 @@ internal fun NetworkInfo.toLongTaskConnectivity(): LongTaskEvent.Connectivity {
276276

277277
internal fun NetworkInfo.toViewConnectivity(): ViewEvent.Connectivity {
278278
val status = if (isConnected()) {
279-
ViewEvent.Status.CONNECTED
279+
ViewEvent.ConnectivityStatus.CONNECTED
280280
} else {
281-
ViewEvent.Status.NOT_CONNECTED
281+
ViewEvent.ConnectivityStatus.NOT_CONNECTED
282282
}
283283
val interfaces = when (connectivity) {
284284
NetworkInfo.Connectivity.NETWORK_ETHERNET -> listOf(ViewEvent.Interface.ETHERNET)

0 commit comments

Comments
 (0)