Skip to content

RUM-8198 - Support custom view instrumentation types for cross-platform SDKs #3167

Merged
hamorillo merged 1 commit intodevelopfrom
hector.morilloprieto/RUM-8198
Feb 5, 2026
Merged

RUM-8198 - Support custom view instrumentation types for cross-platform SDKs #3167
hamorillo merged 1 commit intodevelopfrom
hector.morilloprieto/RUM-8198

Conversation

@hamorillo
Copy link
Contributor

What does this PR do?

Enables cross-platform SDKs (Flutter, React Native, Unity, etc.) to report custom view instrumentation types via the _dd.instrumentation_type attribute. Refactors internal ViewScopeInstrumentationType from enum to sealed interface for type safety while maintaining backward compatibility.

Motivation

Cross-platform SDKs need to report their specific navigation patterns in RUM telemetry to accurately track how views are instrumented. The previous enum-only approach couldn't accommodate arbitrary framework types like "flutter_navigator" or "react_native_navigator" without losing type safety.

Additional Notes

Sample app includes test fragment demonstrating cross-platform instrumentation types, those types are only for testing. Those are not real values.

Note: When testing this, remember that the sampling rate may drop some events. You can modify the specific ViewEnded sample rate and increase the Telemetry sample rate if necessary. In the sample app, it is already set to 100%.

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)

Enable cross-platform SDKs to report custom navigation patterns via the `_dd.instrumentation_type` attribute in RUM View Ended telemetry. The attribute takes precedence over native instrumentation types (Activity, Fragment, Compose, Manual), allowing Flutter, React Native, Unity, and other SDKs to accurately report their specific instrumentation methods.

Updated ViewEndedMetricDispatcher to accept String instead of enum, and implemented precedence logic in RumViewScope.tryResolveInstrumentationType().

Defaults to "manual" when not provided or empty.
@hamorillo hamorillo force-pushed the hector.morilloprieto/RUM-8198 branch from d1c3344 to eb90aa0 Compare February 4, 2026 14:21
@datadog-datadog-prod-us1

This comment has been minimized.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 34.78261% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.91%. Comparing base (39d8b4a) to head (eb90aa0).
⚠️ Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
...nternal/attributes/ViewScopeInstrumentationType.kt 0.00% 10 Missing ⚠️
.../android/rum/internal/domain/scope/RumViewScope.kt 0.00% 1 Missing and 3 partials ⚠️
.../kotlin/com/datadog/android/compose/Navigation3.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3167      +/-   ##
===========================================
- Coverage    70.96%   70.91%   -0.05%     
===========================================
  Files          912      912              
  Lines        33548    33557       +9     
  Branches      5640     5642       +2     
===========================================
- Hits         23804    23794      -10     
- Misses        8173     8187      +14     
- Partials      1571     1576       +5     
Files with missing lines Coverage Δ
...d/rum/internal/metric/ViewEndedMetricDispatcher.kt 96.83% <100.00%> (+5.65%) ⬆️
...droid/rum/tracking/ActivityViewTrackingStrategy.kt 85.45% <100.00%> (-1.82%) ⬇️
...droid/rum/tracking/FragmentViewTrackingStrategy.kt 85.71% <100.00%> (ø)
...oid/rum/tracking/NavigationViewTrackingStrategy.kt 86.96% <100.00%> (ø)
...roid/compose/internal/ComposeNavigationObserver.kt 90.48% <100.00%> (ø)
.../kotlin/com/datadog/android/compose/Navigation3.kt 13.79% <0.00%> (+0.31%) ⬆️
.../android/rum/internal/domain/scope/RumViewScope.kt 93.72% <0.00%> (-1.03%) ⬇️
...nternal/attributes/ViewScopeInstrumentationType.kt 0.00% <0.00%> (ø)

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hamorillo hamorillo marked this pull request as ready for review February 4, 2026 18:02
@hamorillo hamorillo requested a review from a team as a code owner February 4, 2026 18:02
0xnm
0xnm previously approved these changes Feb 5, 2026
@hamorillo hamorillo force-pushed the hector.morilloprieto/RUM-8198 branch from eb90aa0 to cb5388a Compare February 5, 2026 10:25
@hamorillo hamorillo requested a review from 0xnm February 5, 2026 10:26
@hamorillo
Copy link
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link

gh-worker-devflow-routing-ef8351 bot commented Feb 5, 2026

View all feedbacks in Devflow UI.

2026-02-05 10:32:49 UTC ℹ️ Start processing command /merge


2026-02-05 10:32:56 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
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.


2026-02-05 11:17:19 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in develop is approximately 1h (p90).


2026-02-05 11:53:51 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit bc84455:

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.

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.

3 participants