Skip to content

Commit

Permalink
ref(tracing): Extract Stall Tracking to a standalone integration (#3997)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Aug 13, 2024
1 parent a9abb93 commit 66c8b93
Show file tree
Hide file tree
Showing 16 changed files with 286 additions and 308 deletions.
13 changes: 4 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Changes

- New Native Frames Integration ([#3996](https://github.com/getsentry/sentry-react-native/pull/3996))
- New Stall Tracking Integration ([#3997](https://github.com/getsentry/sentry-react-native/pull/3997))
- New App Start Integration ([#3852](https://github.com/getsentry/sentry-react-native/pull/3852))

By default app start spans are attached to the first created transaction.
Expand All @@ -15,6 +17,8 @@
Sentry.init({
tracesSampleRate: 1.0,
enableAppStartTracking: true, // default true
enableNativeFramesTracking: true, // default true
enableStallTracking: true, // default true
integrations: [
Sentry.appStartIntegration({
standalone: false, // default false
Expand All @@ -23,15 +27,6 @@
});
```

- New Native Frames Integration ([#3996](https://github.com/getsentry/sentry-react-native/pull/3996))

```js
Sentry.init({
tracesSampleRate: 1.0,
enableNativeFramesTracking: true, // default true
});
```

## 5.28.0

### Fixes
Expand Down
4 changes: 4 additions & 0 deletions src/js/integrations/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
screenshotIntegration,
sdkInfoIntegration,
spotlightIntegration,
stallTrackingIntegration,
viewHierarchyIntegration,
} from './exports';
import { createReactNativeRewriteFrames } from './rewriteframes';
Expand Down Expand Up @@ -105,6 +106,9 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
if (hasTracingEnabled && options.enableNativeFramesTracking) {
integrations.push(nativeFramesIntegration());
}
if (hasTracingEnabled && options.enableStallTracking) {
integrations.push(stallTrackingIntegration());
}
if (hasTracingEnabled && options.enableAutoPerformanceTracing) {
integrations.push(new ReactNativeTracing());
}
Expand Down
1 change: 1 addition & 0 deletions src/js/integrations/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export { spotlightIntegration } from './spotlight';
export { mobileReplayIntegration } from '../replay/mobilereplay';
export { appStartIntegration } from '../tracing/integrations/appStart';
export { nativeFramesIntegration } from '../tracing/integrations/nativeFrames';
export { stallTrackingIntegration } from '../tracing/integrations/stalltracking';

export {
breadcrumbsIntegration,
Expand Down
7 changes: 7 additions & 0 deletions src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ export interface BaseReactNativeOptions {
*/
enableNativeFramesTracking?: boolean;

/**
* Track when and how long the JS event loop stalls for. Adds stalls as measurements to all transactions.
*
* @default true
*/
enableStallTracking?: boolean;

/**
* Options which are in beta, or otherwise not guaranteed to be stable.
*/
Expand Down
1 change: 1 addition & 0 deletions src/js/sdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const DEFAULT_OPTIONS: ReactNativeOptions = {
enableNdk: true,
enableAppStartTracking: true,
enableNativeFramesTracking: true,
enableStallTracking: true,
};

/**
Expand Down
Loading

0 comments on commit 66c8b93

Please sign in to comment.