[RUM-11677] [V3] Add custom navigation tracking options#1061
Merged
sbarrio merged 2 commits intoDec 10, 2025
Conversation
marco-saia-datadog
previously approved these changes
Dec 9, 2025
Base automatically changed from
sbarrio/internal/update-v3-with-latest-from-develop
to
feature/v3
December 9, 2025 08:53
The base branch was changed.
marco-saia-datadog
previously approved these changes
Dec 9, 2025
e9f158c to
4f1f09c
Compare
sbarrio
commented
Dec 9, 2025
| }; | ||
| DdRumReactNavigationTracking.viewNamePredicate = defaultViewNamePredicate; | ||
| DdRumReactNavigationTracking.viewTrackingPredicate = defaultViewTrackingPredicate; | ||
| DdRumReactNavigationTracking.paramsTrackingPredicate = defaultParamsPredicate; |
Contributor
Author
There was a problem hiding this comment.
FYI @marco-saia-datadog. I had forgotten this bit that resets the predicates when stopTracking is called from the previous version you had already reviewed. Apart from that everything is the same.
marco-saia-datadog
approved these changes
Dec 9, 2025
4f1f09c to
03545dc
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR modifies the automatic navigation tracking modules for React Navigation and React Native Navigation and exposes a new NavigationTrackingOptions parameter through the
startTracking/startTrackingViewsfunction.This options object allows to customize the view tracking logic via 3 new optional predicate functions:
ViewNamePredicate- a custom naming predicates that decide the display name of views tracked by RUM.ViewTrackingPredicate- a custom predicate that decides if a view needs to be tracked by RUM or not.ParamsTrackingPredicate- a custom predicate that decides which navigation parameters (if any) need to be tracked alongside the view on RUM.All of these are optional, and when not set the default behavior will be used for each one of them. The default behaviours are as follows:
ViewNamePredicate- directly forwards the view given name to RUM.ViewTrackingPredicate- tracks all views on RUM.ParamsTrackingPredicate- does not forward any parameters to RUM.Motivation
Many users have expressed the need to be able to customize their view tracking configuration. Hopefully these changes will give them the tools that they need to do so without having to rely on patching files directly.
Review checklist (to be filled by reviewers)