From 2d1de17faf3a511361d971255ec52093fe6732fa Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Fri, 7 Mar 2025 16:39:22 +0100 Subject: [PATCH] =?UTF-8?q?fix(appStart):=20Align=20span=C2=A0description?= =?UTF-8?q?=20with=20other=20platforms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++ .../src/js/tracing/integrations/appStart.ts | 2 +- .../tracing/integrations/appStart.test.ts | 36 +++++++++---------- .../tracing/reactnavigation.ttid.test.tsx | 6 ++-- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4158e3a41f..a4b903904e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ To learn more about the available configuration options visit [the documentation](https://docs.sentry.io/platforms/react-native/manual-setup/expo/expo-sagp/). +### Changes + +Change `Cold/Warm App Start` span description to `Cold/Warm Start` ([#4636](https://github.com/getsentry/sentry-react-native/pull/4636)) + ### Fixes - Various crashes and issues of Session Replay on Android. See the Android SDK version bump for more details. ([#4529](https://github.com/getsentry/sentry-react-native/pull/4529)) diff --git a/packages/core/src/js/tracing/integrations/appStart.ts b/packages/core/src/js/tracing/integrations/appStart.ts index 0f96557d4c..f6b31cfd05 100644 --- a/packages/core/src/js/tracing/integrations/appStart.ts +++ b/packages/core/src/js/tracing/integrations/appStart.ts @@ -295,7 +295,7 @@ export const appStartIntegration = ({ const op = appStart.type === 'cold' ? APP_START_COLD_OP : APP_START_WARM_OP; const appStartSpanJSON: SpanJSON = createSpanJSON({ op, - description: appStart.type === 'cold' ? 'Cold App Start' : 'Warm App Start', + description: appStart.type === 'cold' ? 'Cold Start' : 'Warm Start', start_timestamp: appStartTimestampSeconds, timestamp: appStartEndTimestampSeconds, trace_id: event.contexts.trace.trace_id, diff --git a/packages/core/test/tracing/integrations/appStart.test.ts b/packages/core/test/tracing/integrations/appStart.test.ts index 4337e3e2b3..37870481f2 100644 --- a/packages/core/test/tracing/integrations/appStart.test.ts +++ b/packages/core/test/tracing/integrations/appStart.test.ts @@ -151,7 +151,7 @@ describe('App Start Integration', () => { const actualEvent = await captureStandAloneAppStart(); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const bundleStartSpan = actualEvent!.spans!.find( ({ description }) => description === 'JS Bundle Execution Start', ); @@ -159,7 +159,7 @@ describe('App Start Integration', () => { expect(appStartRootSpan).toEqual( expect.objectContaining(>{ span_id: expect.any(String), - description: 'Cold App Start', + description: 'Cold Start', op: APP_START_COLD_OP, data: { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP, @@ -189,7 +189,7 @@ describe('App Start Integration', () => { const actualEvent = await captureStandAloneAppStart(); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const bundleStartSpan = actualEvent!.spans!.find( ({ description }) => description === 'JS Bundle Execution Before React Root', ); @@ -197,7 +197,7 @@ describe('App Start Integration', () => { expect(appStartRootSpan).toEqual( expect.objectContaining(>{ span_id: expect.any(String), - description: 'Cold App Start', + description: 'Cold Start', op: APP_START_COLD_OP, data: { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP, @@ -228,13 +228,13 @@ describe('App Start Integration', () => { const actualEvent = await captureStandAloneAppStart(); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const nativeSpan = actualEvent!.spans!.find(({ description }) => description === 'test native app start span'); expect(appStartRootSpan).toEqual( expect.objectContaining(>{ span_id: expect.any(String), - description: 'Cold App Start', + description: 'Cold Start', op: APP_START_COLD_OP, data: { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: APP_START_COLD_OP, @@ -465,14 +465,14 @@ describe('App Start Integration', () => { const actualEvent = await processEvent(getMinimalTransactionEvent()); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const bundleStartSpan = actualEvent!.spans!.find( ({ description }) => description === 'JS Bundle Execution Start', ); expect(appStartRootSpan).toEqual( expect.objectContaining(>{ - description: 'Cold App Start', + description: 'Cold Start', span_id: expect.any(String), op: APP_START_COLD_OP, origin: SPAN_ORIGIN_AUTO_APP_START, @@ -505,14 +505,14 @@ describe('App Start Integration', () => { const actualEvent = await processEvent(getMinimalTransactionEvent()); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const bundleStartSpan = actualEvent!.spans!.find( ({ description }) => description === 'JS Bundle Execution Before React Root', ); expect(appStartRootSpan).toEqual( expect.objectContaining(>{ - description: 'Cold App Start', + description: 'Cold Start', span_id: expect.any(String), op: APP_START_COLD_OP, origin: SPAN_ORIGIN_AUTO_APP_START, @@ -545,14 +545,14 @@ describe('App Start Integration', () => { const actualEvent = await processEvent(getMinimalTransactionEvent()); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const bundleStartSpan = actualEvent!.spans!.find( ({ description }) => description === 'JS Bundle Execution Before React Root', ); expect(appStartRootSpan).toEqual( expect.objectContaining(>{ - description: 'Cold App Start', + description: 'Cold Start', span_id: expect.any(String), op: APP_START_COLD_OP, origin: SPAN_ORIGIN_AUTO_APP_START, @@ -586,12 +586,12 @@ describe('App Start Integration', () => { const actualEvent = await processEvent(getMinimalTransactionEvent()); - const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold App Start'); + const appStartRootSpan = actualEvent!.spans!.find(({ description }) => description === 'Cold Start'); const nativeSpan = actualEvent!.spans!.find(({ description }) => description === 'test native app start span'); expect(appStartRootSpan).toEqual( expect.objectContaining(>{ - description: 'Cold App Start', + description: 'Cold Start', span_id: expect.any(String), op: APP_START_COLD_OP, origin: SPAN_ORIGIN_AUTO_APP_START, @@ -802,7 +802,7 @@ function expectEventWithAttachedColdAppStart({ spans: expect.arrayContaining([ { op: APP_START_COLD_OP, - description: 'Cold App Start', + description: 'Cold Start', start_timestamp: appStartTimeMilliseconds / 1000, timestamp: expect.any(Number), trace_id: expect.any(String), @@ -856,7 +856,7 @@ function expectEventWithAttachedWarmAppStart({ spans: expect.arrayContaining([ { op: APP_START_WARM_OP, - description: 'Warm App Start', + description: 'Warm Start', start_timestamp: appStartTimeMilliseconds / 1000, timestamp: expect.any(Number), trace_id: expect.any(String), @@ -913,7 +913,7 @@ function expectEventWithStandaloneColdAppStart( spans: expect.arrayContaining([ { op: APP_START_COLD_OP, - description: 'Cold App Start', + description: 'Cold Start', start_timestamp: appStartTimeMilliseconds / 1000, timestamp: expect.any(Number), trace_id: expect.any(String), @@ -962,7 +962,7 @@ function expectEventWithStandaloneWarmAppStart( spans: expect.arrayContaining([ { op: APP_START_WARM_OP, - description: 'Warm App Start', + description: 'Warm Start', start_timestamp: appStartTimeMilliseconds / 1000, timestamp: expect.any(Number), trace_id: expect.any(String), diff --git a/packages/core/test/tracing/reactnavigation.ttid.test.tsx b/packages/core/test/tracing/reactnavigation.ttid.test.tsx index a0245cff12..f66b484b78 100644 --- a/packages/core/test/tracing/reactnavigation.ttid.test.tsx +++ b/packages/core/test/tracing/reactnavigation.ttid.test.tsx @@ -255,7 +255,7 @@ describe('React Navigation - TTID', () => { type: 'transaction', spans: expect.arrayContaining([ expect.objectContaining>({ - description: 'Cold App Start', + description: 'Cold Start', }), expect.objectContaining>({ data: { @@ -289,7 +289,7 @@ describe('React Navigation - TTID', () => { type: 'transaction', spans: expect.arrayContaining([ expect.objectContaining>({ - description: 'Cold App Start', + description: 'Cold Start', }), expect.objectContaining>({ data: { @@ -319,7 +319,7 @@ describe('React Navigation - TTID', () => { type: 'transaction', spans: expect.arrayContaining([ expect.objectContaining>({ - description: 'Cold App Start', + description: 'Cold Start', }), ]), measurements: expect.objectContaining['measurements']>({