Skip to content

Commit

Permalink
Add anonymous identifier propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejburda committed Jan 17, 2025
1 parent 2b07723 commit ef1b21d
Show file tree
Hide file tree
Showing 28 changed files with 1,157 additions and 161 deletions.
175 changes: 160 additions & 15 deletions features/dd-sdk-android-rum/api/apiSurface

Large diffs are not rendered by default.

864 changes: 730 additions & 134 deletions features/dd-sdk-android-rum/api/dd-sdk-android-rum.api

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions features/dd-sdk-android-rum/src/main/json/rum/_common-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,30 @@
"type": "string",
"description": "Email of the user",
"readOnly": true
},
"anonymous_id": {
"type": "string",
"description": "Identifier of the user across sessions",
"readOnly": true
}
},
"readOnly": true
},
"account": {
"type": "object",
"description": "Account properties",
"additionalProperties": true,
"required": ["id"],
"properties": {
"id": {
"type": "string",
"description": "Identifier of the account",
"readOnly": true
},
"name": {
"type": "string",
"description": "Name of the account",
"readOnly": true
}
},
"readOnly": true
Expand Down
30 changes: 30 additions & 0 deletions features/dd-sdk-android-rum/src/main/json/rum/_rect-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/_rect-schema.json",
"title": "RumRect",
"type": "object",
"description": "Schema for DOMRect-like rectangles describing an element's bounding client rect",
"required": ["x", "y", "width", "height"],
"properties": {
"x": {
"type": "number",
"description": "The x coordinate of the element's origin",
"readOnly": true
},
"y": {
"type": "number",
"description": "The y coordinate of the element's origin",
"readOnly": true
},
"width": {
"type": "number",
"description": "The element's width",
"readOnly": true
},
"height": {
"type": "number",
"description": "The element's height",
"readOnly": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/_view-performance-schema.json",
"title": "ViewPerformanceData",
"type": "object",
"description": "Schema for view-level RUM performance data (Web Vitals, etc.)",
"properties": {
"cls": {
"type": "object",
"description": "Cumulative Layout Shift",
"required": ["score"],
"properties": {
"score": {
"type": "number",
"description": "Total layout shift score that occurred on the view",
"$comment": "Replaces the deprecated `view.cumulative_layout_shift`",
"minimum": 0,
"readOnly": true
},
"timestamp": {
"type": "integer",
"description": "Timestamp in ns of the largest layout shift contributing to CLS",
"$comment": "Replaces the deprecated `view.cumulative_layout_shift_time`",
"minimum": 0,
"readOnly": true
},
"target_selector": {
"type": "string",
"description": "CSS selector path of the first element (in document order) of the largest layout shift contributing to CLS",
"$comment": "Replaces the deprecated `view.cumulative_layout_shift_target_selector`",
"readOnly": true
},
"previous_rect": {
"description": "Bounding client rect of the element before the layout shift",
"allOf": [{ "$ref": "_rect-schema.json" }]
},
"current_rect": {
"description": "Bounding client rect of the element after the layout shift",
"allOf": [{ "$ref": "_rect-schema.json" }]
}
},
"readOnly": true
},
"fcp": {
"type": "object",
"description": "First Contentful Paint",
"required": ["timestamp"],
"properties": {
"timestamp": {
"type": "integer",
"description": "Timestamp in ns of the first rendering",
"$comment": "Replaces the deprecated `view.first_contentful_paint`",
"minimum": 0,
"readOnly": true
}
},
"readOnly": true
},
"fid": {
"type": "object",
"description": "First Input Delay",
"required": ["duration", "timestamp"],
"properties": {
"duration": {
"type": "integer",
"description": "Duration in ns of the first input event delay",
"$comment": "Replaces the deprecated `view.first_input_delay`",
"minimum": 0,
"readOnly": true
},
"timestamp": {
"type": "integer",
"description": "Timestamp in ns of the first input event",
"$comment": "Replaces the deprecated `view.first_input_time`",
"minimum": 0,
"readOnly": true
},
"target_selector": {
"type": "string",
"description": "CSS selector path of the first input target element",
"$comment": "Replaces the deprecated `view.first_input_target_selector`",
"readOnly": true
}
},
"readOnly": true
},
"inp": {
"type": "object",
"description": "Interaction to Next Paint",
"required": ["duration"],
"properties": {
"duration": {
"type": "integer",
"description": "Longest duration in ns between an interaction and the next paint",
"$comment": "Replaces the deprecated `view.interaction_to_next_paint`",
"minimum": 0,
"readOnly": true
},
"timestamp": {
"type": "integer",
"description": "Timestamp in ns of the start of the INP interaction",
"$comment": "Replaces the deprecated `view.interaction_to_next_paint_time`",
"minimum": 0,
"readOnly": true
},
"target_selector": {
"type": "string",
"description": "CSS selector path of the interacted element for the INP interaction",
"$comment": "Replaces the deprecated `view.interaction_to_next_paint_target_selector`",
"readOnly": true
}
},
"readOnly": true
},
"lcp": {
"type": "object",
"description": "Largest Contentful Paint",
"required": ["timestamp"],
"properties": {
"timestamp": {
"type": "integer",
"description": "Timestamp in ns of the largest contentful paint",
"$comment": "Replaces the deprecated `view.largest_contentful_paint`",
"minimum": 0,
"readOnly": true
},
"target_selector": {
"type": "string",
"description": "CSS selector path of the largest contentful paint element",
"$comment": "Replaces the deprecated `view.largest_contentful_paint_target_selector`",
"readOnly": true
}
},
"readOnly": true
}
}
}
13 changes: 13 additions & 0 deletions features/dd-sdk-android-rum/src/main/json/rum/action-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,19 @@
"readOnly": true
}
}
},
"name_source": {
"type": "string",
"description": "The strategy of how the auto click action name is computed",
"enum": [
"custom_attribute",
"mask_placeholder",
"standard_attribute",
"text_content",
"mask_disallowed",
"blank"
],
"readOnly": false
}
},
"readOnly": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@
"description": "Network protocol used to fetch the resource (e.g., 'http/1.1', 'h2')",
"readOnly": true
},
"delivery_type": {
"type": "string",
"description": "Delivery type of the resource",
"enum": ["cache", "navigational-prefetch", "other"],
"readOnly": true
},
"provider": {
"type": "object",
"description": "The provider for this resource",
Expand Down
40 changes: 28 additions & 12 deletions features/dd-sdk-android-rum/src/main/json/rum/view-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,70 +66,82 @@
},
"first_contentful_paint": {
"type": "integer",
"description": "Duration in ns to the first rendering",
"description": "Duration in ns to the first rendering (deprecated in favor of `view.performance.fcp.timestamp`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"largest_contentful_paint": {
"type": "integer",
"description": "Duration in ns to the largest contentful paint",
"description": "Duration in ns to the largest contentful paint (deprecated in favor of `view.performance.lcp.timestamp`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"largest_contentful_paint_target_selector": {
"type": "string",
"description": "CSS selector path of the largest contentful paint element",
"description": "CSS selector path of the largest contentful paint element (deprecated in favor of `view.performance.lcp.target_selector`)",
"deprecated": true,
"readOnly": true
},
"first_input_delay": {
"type": "integer",
"description": "Duration in ns of the first input event delay",
"description": "Duration in ns of the first input event delay (deprecated in favor of `view.performance.fid.duration`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"first_input_time": {
"type": "integer",
"description": "Duration in ns to the first input",
"description": "Duration in ns to the first input (deprecated in favor of `view.performance.fid.timestamp`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"first_input_target_selector": {
"type": "string",
"description": "CSS selector path of the first input target element",
"description": "CSS selector path of the first input target element (deprecated in favor of `view.performance.fid.target_selector`)",
"deprecated": true,
"readOnly": true
},
"interaction_to_next_paint": {
"type": "integer",
"description": "Longest duration in ns between an interaction and the next paint",
"description": "Longest duration in ns between an interaction and the next paint (deprecated in favor of `view.performance.inp.duration`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"interaction_to_next_paint_time": {
"type": "integer",
"description": "Duration in ns between start of the view and start of the INP",
"description": "Duration in ns between start of the view and start of the INP (deprecated in favor of `view.performance.inp.timestamp`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"interaction_to_next_paint_target_selector": {
"type": "string",
"description": "CSS selector path of the interacted element corresponding to INP",
"description": "CSS selector path of the interacted element corresponding to INP (deprecated in favor of `view.performance.inp.target_selector`)",
"deprecated": true,
"readOnly": true
},
"cumulative_layout_shift": {
"type": "number",
"description": "Total layout shift score that occurred on the view",
"description": "Total layout shift score that occurred on the view (deprecated in favor of `view.performance.cls.score`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"cumulative_layout_shift_time": {
"type": "integer",
"description": "Duration in ns between start of the view and start of the largest layout shift contributing to CLS",
"description": "Duration in ns between start of the view and start of the largest layout shift contributing to CLS (deprecated in favor of `view.performance.cls.timestamp`)",
"deprecated": true,
"minimum": 0,
"readOnly": true
},
"cumulative_layout_shift_target_selector": {
"type": "string",
"description": "CSS selector path of the first element (in document order) of the largest layout shift contributing to CLS",
"description": "CSS selector path of the first element (in document order) of the largest layout shift contributing to CLS (deprecated in favor of `view.performance.cls.target_selector`)",
"deprecated": true,
"readOnly": true
},
"dom_complete": {
Expand Down Expand Up @@ -346,6 +358,10 @@
"js_refresh_rate": {
"description": "The JavaScript refresh rate for React Native",
"allOf": [{ "$ref": "_perf-metric-schema.json" }]
},
"performance": {
"description": "Performance data. (Web Vitals, etc.)",
"allOf": [{ "$ref": "_view-performance-schema.json" }]
}
},
"readOnly": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ internal class DatadogLateCrashReporter(
user?.id,
user?.name,
user?.email,
user?.anonymousId,
additionalUserProperties
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ internal class RumActionScope(
id = user.id,
name = user.name,
email = user.email,
anonymousId = user.anonymousId,
additionalProperties = user.additionalProperties.toMutableMap()
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ internal class RumResourceScope(
id = user.id,
name = user.name,
email = user.email,
anonymousId = user.anonymousId,
additionalProperties = user.additionalProperties.toMutableMap()
)
} else {
Expand Down Expand Up @@ -400,6 +401,7 @@ internal class RumResourceScope(
id = user.id,
name = user.name,
email = user.email,
anonymousId = user.anonymousId,
additionalProperties = user.additionalProperties.toMutableMap()
)
} else {
Expand Down
Loading

0 comments on commit ef1b21d

Please sign in to comment.