Skip to content

Commit 0817d83

Browse files
committed
feat(tracing): Track standalone app start adoption
When `_experiments.enableStandaloneAppStartTracing` is enabled, also add a no-op `StandaloneAppStart` integration to the default integrations list so the name flows through to `event.sdk.integrations`. Refs: #6415
1 parent b8e6cc6 commit 0817d83

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

packages/core/src/js/integrations/default.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ import {
4646
viewHierarchyIntegration,
4747
} from './exports';
4848

49+
const STANDALONE_APP_START_INTEGRATION_NAME = 'StandaloneAppStart';
50+
4951
/**
5052
* Returns the default ReactNative integrations based on the current environment.
5153
*
@@ -114,6 +116,9 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
114116
const hasTracingEnabled = typeof options.tracesSampleRate === 'number' || typeof options.tracesSampler === 'function';
115117
if (hasTracingEnabled && options.enableAppStartTracking && options.enableNative) {
116118
integrations.push(appStartIntegration({ standalone: !!options._experiments?.enableStandaloneAppStartTracing }));
119+
if (options._experiments?.enableStandaloneAppStartTracing) {
120+
integrations.push({ name: STANDALONE_APP_START_INTEGRATION_NAME });
121+
}
117122
}
118123
const nativeFramesIntegrationInstance = createNativeFramesIntegrations(
119124
hasTracingEnabled && options.enableNativeFramesTracking && options.enableNative,

packages/core/test/integrations/defaultAppStart.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,18 @@ describe('getDefaultIntegrations - standalone app start wiring', () => {
4242

4343
expect(appStartIntegration).toHaveBeenCalledWith({ standalone: false });
4444
});
45+
46+
it('includes the StandaloneAppStart marker when the experiment flag is enabled', () => {
47+
const integrations = getDefaultIntegrations(
48+
createOptions({ _experiments: { enableStandaloneAppStartTracing: true } }),
49+
);
50+
51+
expect(integrations.some(i => i.name === 'StandaloneAppStart')).toBe(true);
52+
});
53+
54+
it('does not include the StandaloneAppStart marker when the experiment flag is off', () => {
55+
const integrations = getDefaultIntegrations(createOptions({}));
56+
57+
expect(integrations.some(i => i.name === 'StandaloneAppStart')).toBe(false);
58+
});
4559
});

0 commit comments

Comments
 (0)