From f2d10b7bd12e10b57209f3a1651d1f37b33e08b1 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:28:50 +0100 Subject: [PATCH] fix(react-navigation): Make `navigation.processing` span title more explicit (#4423) --- CHANGELOG.md | 4 ++++ packages/core/src/js/tracing/reactnavigation.ts | 4 ++-- packages/core/test/tracing/reactnavigation.ttid.test.tsx | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5344ba768a..c56caa15a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ ## Unreleased +### Changes + +- Rename `navigation.processing` span to more expressive `Navigation dispatch to screen A mounted/navigation cancelled` ([#4423](https://github.com/getsentry/sentry-react-native/pull/4423)) + ### Dependencies - Bump CLI from v2.39.1 to v2.40.0 ([#4412](https://github.com/getsentry/sentry-react-native/pull/4412)) diff --git a/packages/core/src/js/tracing/reactnavigation.ts b/packages/core/src/js/tracing/reactnavigation.ts index 6fb08890ed..dd33424b9c 100644 --- a/packages/core/src/js/tracing/reactnavigation.ts +++ b/packages/core/src/js/tracing/reactnavigation.ts @@ -203,7 +203,7 @@ export const reactNavigationIntegration = ({ if (enableTimeToInitialDisplay) { navigationProcessingSpan = startInactiveSpan({ op: 'navigation.processing', - name: 'Navigation processing', + name: 'Navigation dispatch to navigation cancelled or screen mounted', startTime: latestNavigationSpan && spanToJSON(latestNavigationSpan).start_timestamp, }); navigationProcessingSpan.setAttribute( @@ -274,7 +274,7 @@ export const reactNavigationIntegration = ({ }); } - navigationProcessingSpan?.updateName(`Processing navigation to ${route.name}`); + navigationProcessingSpan?.updateName(`Navigation dispatch to screen ${route.name} mounted`); navigationProcessingSpan?.setStatus({ code: SPAN_STATUS_OK }); navigationProcessingSpan?.end(stateChangedTimestamp); navigationProcessingSpan = undefined; diff --git a/packages/core/test/tracing/reactnavigation.ttid.test.tsx b/packages/core/test/tracing/reactnavigation.ttid.test.tsx index 7c0637b896..a0245cff12 100644 --- a/packages/core/test/tracing/reactnavigation.ttid.test.tsx +++ b/packages/core/test/tracing/reactnavigation.ttid.test.tsx @@ -204,7 +204,7 @@ describe('React Navigation - TTID', () => { 'sentry.origin': SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION, 'sentry.source': 'custom', }, - description: 'Processing navigation to New Screen', + description: 'Navigation dispatch to screen New Screen mounted', op: 'navigation.processing', origin: SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION, status: 'ok', @@ -232,7 +232,7 @@ describe('React Navigation - TTID', () => { 'sentry.origin': SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION, 'sentry.source': 'custom', }, - description: 'Processing navigation to Initial Screen', + description: 'Navigation dispatch to screen Initial Screen mounted', op: 'navigation.processing', origin: SPAN_ORIGIN_AUTO_NAVIGATION_REACT_NAVIGATION, status: 'ok',