Skip to content

Correct route and dynamic param extraction for Expo Router #6157

@alwx

Description

@alwx

extractDynamicRouteParams() works but:

  • Transaction names are noisy/uninformative (index, (tabs)).
  • Dynamic param extraction almost never finds matching keys, so spans rarely carry route.params.* attributes.
  • useFullPathsForNavigationRoutes builds a path from nested navigators, but it joins React Navigation names, not Expo Router pathnames.

Here is what we can do: When Expo Router is active, derive the route from Expo Router's own state rather than from getCurrentRoute().name:

  • Use the Expo Router path (e.g. /profile/[id]) as the canonical span name and route.name attribute.
  • Extract dynamic params from the matched route pattern + the actual params object, including catch-all [...slug].
  • Keep query-string params off the span by default; gate them behind sendDefaultPii (matching the existing PII model in deeplink.ts and the current extractDynamicRouteParams contract).
  • Set route.path (templated) and, under sendDefaultPii, route.url (concrete).

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions