Skip to content

RUM-7797 Anonymous RUM Identifier#2487

Merged
maciejburda merged 9 commits into
developfrom
maciey/RUM-7797/anonymous-id
Feb 12, 2025
Merged

RUM-7797 Anonymous RUM Identifier#2487
maciejburda merged 9 commits into
developfrom
maciey/RUM-7797/anonymous-id

Conversation

@maciejburda

@maciejburda maciejburda commented Jan 17, 2025

Copy link
Copy Markdown
Member

What and why?

Adds capability of tracking anonymous id (enabled by default). This data allows linking sessions coming from the same device.

How?

Following proposal from this RFC (internal) it reuses data store mechanism, and based on configuration it generates and reuses stored identifier.

This identifier is attached to UserInfo object (schema already updated), which is enriching other SDK events.

Motivation

This extra property adds ability to link sessions coming from the same device.

Additional Notes

The identifier is read asynchronously from a file, which means RUM events created immediately after calling RUM.enable() will not include it. However, this is not an issue since the anonymous_id belongs to the Session entity. As long as the anonymous_id is present in at least in one event, it is sufficient for linking.

Here's corresponding PR for iOS:
DataDog/dd-sdk-ios#2172

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

Comment thread features/dd-sdk-android-rum/src/main/kotlin/com/datadog/android/rum/Rum.kt Outdated
@satween

satween commented Jan 17, 2025

Copy link
Copy Markdown
Contributor

Running

./local_ci.sh -n -c -t -a  

from the root of the project will help you to overcome detekt problems.

Comment thread features/dd-sdk-android-rum/src/main/json/rum/_common-schema.json
Comment thread features/dd-sdk-android-rum/src/main/json/rum/_rect-schema.json Outdated
@maciejburda
maciejburda force-pushed the maciey/RUM-7797/anonymous-id branch from f95e57a to a141ebe Compare January 30, 2025 11:07
@maciejburda
maciejburda marked this pull request as ready for review January 31, 2025 10:55
@maciejburda
maciejburda requested review from a team as code owners January 31, 2025 10:55
@maciejburda

Copy link
Copy Markdown
Member Author

Relates to DataDog/dd-sdk-ios#2172

@maciejburda
maciejburda force-pushed the maciey/RUM-7797/anonymous-id branch from 572f49b to 4cc97fb Compare January 31, 2025 11:35
@maciejburda
maciejburda force-pushed the maciey/RUM-7797/anonymous-id branch from f5e3e1e to eb5cd6e Compare February 7, 2025 12:31
@maciejburda
maciejburda force-pushed the maciey/RUM-7797/anonymous-id branch from eb5cd6e to 39fa7b8 Compare February 7, 2025 12:44
@maciejburda
maciejburda requested a review from 0xnm February 7, 2025 14:13
0xnm
0xnm previously approved these changes Feb 7, 2025

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments, but nothing blocking for me.

satween
satween previously approved these changes Feb 7, 2025

@satween satween left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my comment above please, bisides that LGTM

@maciejburda
maciejburda dismissed stale reviews from satween and 0xnm via 0404a61 February 7, 2025 16:11
@codecov-commenter

codecov-commenter commented Feb 7, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 75.40984% with 15 lines in your changes missing coverage. Please review.

Project coverage is 70.13%. Comparing base (fc254cf) to head (d91b764).
Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
...roid/rum/internal/RumAnonymousIdentifierManager.kt 83.33% 6 Missing ⚠️
...kotlin/com/datadog/android/api/context/UserInfo.kt 40.00% 1 Missing and 2 partials ⚠️
...rum/src/main/kotlin/com/datadog/android/rum/Rum.kt 0.00% 2 Missing and 1 partial ⚠️
...tadog/android/core/internal/NoOpContextProvider.kt 0.00% 1 Missing ⚠️
...tadog/android/core/internal/NoOpInternalSdkCore.kt 0.00% 1 Missing ⚠️
...g/android/rum/internal/DatadogLateCrashReporter.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2487      +/-   ##
===========================================
+ Coverage    70.08%   70.13%   +0.05%     
===========================================
  Files          791      792       +1     
  Lines        29839    29895      +56     
  Branches      4992     5000       +8     
===========================================
+ Hits         20912    20965      +53     
- Misses        7554     7556       +2     
- Partials      1373     1374       +1     
Files with missing lines Coverage Δ
...n/com/datadog/android/core/internal/DatadogCore.kt 82.27% <100.00%> (+0.08%) ⬆️
...roid/core/internal/user/DatadogUserInfoProvider.kt 100.00% <100.00%> (ø)
...lin/com/datadog/android/rum/internal/RumFeature.kt 91.48% <100.00%> (-0.27%) ⬇️
...ndroid/rum/internal/domain/scope/RumActionScope.kt 97.83% <100.00%> (+0.01%) ⬆️
...roid/rum/internal/domain/scope/RumResourceScope.kt 95.49% <100.00%> (+0.03%) ⬆️
.../android/rum/internal/domain/scope/RumViewScope.kt 95.40% <100.00%> (+0.02%) ⬆️
...tadog/android/core/internal/NoOpContextProvider.kt 3.33% <0.00%> (ø)
...tadog/android/core/internal/NoOpInternalSdkCore.kt 8.86% <0.00%> (-0.11%) ⬇️
...g/android/rum/internal/DatadogLateCrashReporter.kt 85.96% <0.00%> (-0.56%) ⬇️
...kotlin/com/datadog/android/api/context/UserInfo.kt 58.33% <40.00%> (-3.03%) ⬇️
... and 2 more

... and 21 files with indirect coverage changes

@maciejburda

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow

dd-devflow Bot commented Feb 10, 2025

Copy link
Copy Markdown

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-02-10 10:42:45 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-02-10 14:15:09 UTC ℹ️ MergeQueue: merge request added to the queue

The median merge time in develop is 0s.


2025-02-10 15:01:58 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit a8f1e72:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.

satween
satween previously approved these changes Feb 10, 2025
ambushwork
ambushwork previously approved these changes Feb 10, 2025
jonathanmos
jonathanmos previously approved these changes Feb 11, 2025
@maciejburda
maciejburda dismissed stale reviews from jonathanmos, ambushwork, and satween via 9d1877f February 11, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants