Skip to content

Commit af55258

Browse files
committed
feat: enable Sentry tracing and profiling
1 parent bc86943 commit af55258

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/services/telemetry/sentry.ts

+5-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
ReactNativeTracing,
44
ReactNavigationInstrumentation,
55
setContext,
6-
startTransaction as startSentryTransaction,
6+
startTransaction,
77
wrap,
88
} from '@sentry/react-native'
99

@@ -17,6 +17,8 @@ const sentryAdapterFactory = () => {
1717
dsn: configuration.sentry.dsn,
1818
release: configuration.sentry.releaseName,
1919
environment: configuration.environment.name,
20+
enableAutoSessionTracking: true,
21+
tracesSampleRate: 1,
2022
integrations: [
2123
new ReactNativeTracing( {
2224
tracingOrigins: [ 'api.gurbaninow.com' ],
@@ -25,26 +27,11 @@ const sentryAdapterFactory = () => {
2527
],
2628
} )
2729

28-
const registerNavigation = ( navigationRef: any ) => (
30+
const registerNavigation = ( navigationRef: any ) => {
2931
routingInstrumentation.registerNavigationContainer( navigationRef )
30-
)
31-
32-
const transactions = new Map<string, ReturnType<typeof startSentryTransaction>>()
33-
const startTransaction = ( name: string ) => {
34-
const transaction = startSentryTransaction( { name } )
35-
36-
transactions.set( name, transaction )
37-
38-
return transaction
39-
}
40-
41-
const endTransaction = ( name: string ) => {
42-
if ( !transactions.has( name ) ) return
43-
44-
transactions.get( name )?.finish()
4532
}
4633

47-
return { initialize, wrap, registerNavigation, startTransaction, endTransaction, setContext }
34+
return { initialize, wrap, registerNavigation, startTransaction, setContext }
4835
}
4936

5037
export default sentryAdapterFactory()

0 commit comments

Comments
 (0)