You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tracing): Correlate deep links with the navigation they trigger
Bridges `deeplinkIntegration` and `reactNavigationIntegration` so the idle
navigation span started after a deep link arrival is tagged with the link
that caused it. Previously the two timelines were unconnected — the
breadcrumb recorded `Linking.getInitialURL()` / the `'url'` event, but the
resulting navigation span had no way to know it had been triggered by a
deep link, making it impossible to measure the gap between "URL received"
and "navigation dispatched".
Approach mirrors the existing `pendingExpoRouterNavigation` hand-off:
* New `tracing/pendingDeepLink.ts` stores the raw URL plus a wall-clock
receive timestamp. `consumePendingDeepLink(maxAgeMs)` discards values
older than `routeChangeTimeoutMs` (default 1000ms) and clears the slot
in all cases so a stale link cannot leak onto a later, unrelated nav.
* `deeplinkIntegration` now calls `setPendingDeepLink` alongside its
existing breadcrumb. The raw URL is stored — sanitization is deferred
to attach time so `sendDefaultPii` is read at the right moment.
* `reactNavigationIntegration` consumes the pending value in two places:
- In `startIdleNavigationSpan`, covering the warm-open path (link
arrives, then navigation dispatches).
- In `updateLatestNavigationSpanWithCurrentRoute`, covering the cold
start path where `getInitialURL()` resolves *after* the initial
idle span has already been started in `afterAllSetup`.
Attachment is idempotent per span via a `deepLinkAppliedToLatestSpan`
flag, reset on discard and after each successful route change.
When attached, the span gets:
* `navigation.trigger`: `'deeplink'`
* `deeplink.url`: sanitized via the existing `sanitizeDeepLinkUrl`
(now exported from `integrations/deeplink.ts`), or raw when
`sendDefaultPii` is enabled
* `deeplink.received_at`: ms elapsed between URL receipt and the
moment the span is annotated — captures the dispatch delay
Tests cover warm open, cold-start ordering (span starts before pending
is set), single-consume semantics, PII gating, stale rejection, and the
"no deep link" baseline. Out of scope (and noted in the issue): wiring
the native TTID fallback start time to deep-link arrival instead of
navigation dispatch — that requires native-bridge plumbing.
Fixes#6159
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
11
11
### Features
12
12
13
+
- Correlate deep links with the navigation transaction they trigger. The next idle navigation span started within `routeChangeTimeoutMs` of a deep link arrival is tagged with `navigation.trigger: 'deeplink'`, `deeplink.url` (sanitized, respects `sendDefaultPii`), and `deeplink.received_at` (ms gap between URL received and navigation dispatched). Covers both cold start (`Linking.getInitialURL()`) and warm open (`'url'` event) paths ([#6159](https://github.com/getsentry/sentry-react-native/issues/6159))
13
14
- Add memory, CPU, and frame measurements to Android profiling ([#6250](https://github.com/getsentry/sentry-react-native/pull/6250))
14
15
- Add `enableAutoConsoleLogs` option to opt out of automatic `console.*` capture while keeping `enableLogs: true` for manual `Sentry.logger.*` calls ([#6235](https://github.com/getsentry/sentry-react-native/pull/6235))
15
16
- Instrument Expo Router `push`, `replace`, `navigate`, `back`, and `dismiss` (in addition to `prefetch`) with breadcrumbs and spans, and tag the resulting idle navigation span with the initiating `navigation.method` ([#6221](https://github.com/getsentry/sentry-react-native/pull/6221))
// src/js/feedback/integration.ts:21:5 - (ae-forgotten-export) The symbol "ScreenshotButtonProps" needs to be exported by the entry point index.d.ts
858
858
// src/js/feedback/integration.ts:23:5 - (ae-forgotten-export) The symbol "FeedbackFormTheme" needs to be exported by the entry point index.d.ts
859
859
// src/js/tracing/reactnativetracing.ts:90:3 - (ae-forgotten-export) The symbol "ReactNativeTracingState" needs to be exported by the entry point index.d.ts
860
-
// src/js/tracing/reactnavigation.ts:220:3 - (ae-forgotten-export) The symbol "RouteOverrideProvider" needs to be exported by the entry point index.d.ts
860
+
// src/js/tracing/reactnavigation.ts:222:3 - (ae-forgotten-export) The symbol "RouteOverrideProvider" needs to be exported by the entry point index.d.ts
861
861
862
862
// (No @packageDocumentation comment for this package)
0 commit comments