@@ -82,22 +82,18 @@ func application(_ application: UIApplication,
8282 // Sample rate for profiling, applied on top of TracesSampleRate.
8383 // We recommend adjusting this value in production.
8484 options.profilesSampleRate = 1.0`
85- : ''
86- }
87- }${
88- params . isProfilingSelected &&
89- params . profilingOptions ?. defaultProfilingMode === 'continuous'
90- ? `
85+ : params . isProfilingSelected &&
86+ params . profilingOptions ?. defaultProfilingMode === 'continuous'
87+ ? `
9188
92- // Manually call startProfiler and stopProfiler
93- // to profile the code in between
94- SentrySDK.startProfiler()
95- // this code will be profiled
96- //
97- // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
98- // your application until the process exits or stopProfiler is called.
99- SentrySDK.stopProfiler()`
100- : ''
89+ // Configure the profiler to start profiling when there is an active root span
90+ // For more information, visit: https://docs.sentry.io/platforms/apple/profiling/
91+ options.configureProfiling = {
92+ $0.lifecycle = .trace
93+ $0.sessionSampleRate = 1.0
94+ }`
95+ : ''
96+ }
10197 }
10298
10399 return true
@@ -131,22 +127,18 @@ struct SwiftUIApp: App {
131127 // Sample rate for profiling, applied on top of TracesSampleRate.
132128 // We recommend adjusting this value in production.
133129 options.profilesSampleRate = 1.0`
134- : ''
135- }
136- }${
137- params . isProfilingSelected &&
138- params . profilingOptions ?. defaultProfilingMode === 'continuous'
139- ? `
130+ : params . isProfilingSelected &&
131+ params . profilingOptions ?. defaultProfilingMode === 'continuous'
132+ ? `
140133
141- // Manually call startProfiler and stopProfiler
142- // to profile the code in between
143- SentrySDK.startProfiler()
144- // this code will be profiled
145- //
146- // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
147- // your application until the process exits or stopProfiler is called.
148- SentrySDK.stopProfiler()`
149- : ''
134+ // Configure the profiler to start profiling when there is an active root span
135+ // For more information, visit: https://docs.sentry.io/platforms/apple/profiling/
136+ options.configureProfiling = {
137+ $0.lifecycle = .trace
138+ $0.sessionSampleRate = 1.0
139+ }`
140+ : ''
141+ }
150142 }
151143 }
152144}` ;
0 commit comments