RUM-8198 - Support custom view instrumentation types for cross-platform SDKs #3167
RUM-8198 - Support custom view instrumentation types for cross-platform SDKs #3167
Conversation
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.
d1c3344 to
eb90aa0
Compare
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is 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
🚀 New features to boost your workflow:
|
.../src/main/kotlin/com/datadog/android/sample/instrumentation/CustomInstrumentationFragment.kt
Outdated
Show resolved
Hide resolved
eb90aa0 to
cb5388a
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
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.
The expected merge time in
Tests failed on this commit bc84455: What to do next?
|
What does this PR do?
Enables cross-platform SDKs (Flutter, React Native, Unity, etc.) to report custom view instrumentation types via the
_dd.instrumentation_typeattribute. Refactors internalViewScopeInstrumentationTypefrom 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)