Skip to content

Commit 4267263

Browse files
authored
Remove enable tracing flag from V9 (#6343)
1 parent 8fa16b5 commit 4267263

File tree

12 files changed

+20
-660
lines changed

12 files changed

+20
-660
lines changed

.github/workflows/test-cross-platform.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
repository: getsentry/sentry-react-native
5757
path: sentry-react-native
58-
ref: updateVersion
58+
ref: removeEnableTracing
5959

6060
- name: Enable Corepack
6161
working-directory: sentry-react-native

CHANGELOG-v9.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Removes deprecated SentryDebugImageProvider class (#5598)
66
Makes app hang tracking V2 the default and removes the option to enable/disable it (#5615)
77
Removes segment property on SentryUser, SentryBaggage, and SentryTraceContext (#5638)
88
Removes public SentrySerializable conformance from many public models (#5636, #5840, #5982)
9-
Removes enableTracing property from SentryOptions (#5694)
109
Removes deprecated `setExtraValue` from SentrySpan (#5864)
1110
Removes `integrations` property from `SentryOptions` (#5749)
1211
Makes `SentryEventDecodable` internal (#5808)

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Removes deprecated useSpan function (#5591)
1313
- Removes deprecated user feedback API, this is replaced with the new feedback API (#5591)
1414
- Removes `enablePerformanceV2` option and makes this the default. The app start duration will now finish when the first frame is drawn instead of when the OS posts the UIWindowDidBecomeVisibleNotification. (#6008)
15+
- Removes enableTracing property from SentryOptions (#5694)
1516

1617
### Features
1718

Samples/SentrySampleShared/SentrySampleShared/SentrySDKWrapper.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ public struct SentrySDKWrapper {
120120
options.enableWatchdogTerminationTracking = !isUITest && !isBenchmarking && !SentrySDKOverrides.Performance.disableWatchdogTracking.boolValue
121121

122122
options.enableAutoPerformanceTracing = !isBenchmarking && !SentrySDKOverrides.Performance.disablePerformanceTracing.boolValue
123-
#if !SDK_V9
124-
options.enableTracing = !isBenchmarking && !SentrySDKOverrides.Tracing.disableTracing.boolValue
125-
#endif // !SDK_V9
126123

127124
options.enableNetworkTracking = !SentrySDKOverrides.Networking.disablePerformanceTracking.boolValue
128125
options.enableCaptureFailedRequests = !SentrySDKOverrides.Networking.disableFailedRequestTracking.boolValue

Samples/iOS-Swift/iOS-Swift-UITests/ProfilingUITests.swift

Lines changed: 18 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,21 @@ import XCTest
66

77
class ProfilingUITests: BaseUITest {
88
override var automaticallyLaunchAndTerminateApp: Bool { false }
9-
10-
func testAppLaunchesWithTraceProfiler() throws {
11-
guard #available(iOS 16, *) else {
12-
throw XCTSkip("Only run for latest iOS version we test; we've had issues with prior versions in SauceLabs")
13-
}
14-
15-
try performTest(profileType: .trace)
16-
}
17-
18-
func testAppLaunchesWithContinuousProfilerV1() throws {
19-
guard #available(iOS 16, *) else {
20-
throw XCTSkip("Only run for latest iOS version we test; we've had issues with prior versions in SauceLabs")
21-
}
22-
23-
try performTest(profileType: .continuous)
24-
}
259

2610
func testAppLaunchesWithContinuousProfilerV2TraceLifecycle() throws {
2711
guard #available(iOS 16, *) else {
2812
throw XCTSkip("Only run for latest iOS version we test; we've had issues with prior versions in SauceLabs")
2913
}
3014

31-
try performTest(profileType: .ui, lifecycle: .trace)
15+
try performTest(lifecycle: .trace)
3216
}
3317

3418
func testAppLaunchesWithContinuousProfilerV2ManualLifeCycle() throws {
3519
guard #available(iOS 16, *) else {
3620
throw XCTSkip("Only run for latest iOS version we test; we've had issues with prior versions in SauceLabs")
3721
}
3822

39-
try performTest(profileType: .ui, lifecycle: .manual)
23+
try performTest(lifecycle: .manual)
4024
}
4125

4226
/**
@@ -131,18 +115,12 @@ extension ProfilingUITests {
131115
app.buttons["io.sentry.ios-swift.ui-test.button.stop-continuous-profiler"].afterWaitingForExistence("Couldn't find button to stop continuous profiler").tap()
132116
}
133117

134-
enum ProfilingType {
135-
case trace
136-
case continuous // aka "continuous beta"
137-
case ui // aka "continuous v2"
118+
func performTest(lifecycle: SentryProfileOptions.SentryProfileLifecycle? = nil) throws {
119+
try launchAndConfigureSubsequentLaunches(shouldProfileThisLaunch: false, shouldProfileNextLaunch: true, lifecycle: lifecycle)
120+
try launchAndConfigureSubsequentLaunches(terminatePriorSession: true, shouldProfileThisLaunch: true, shouldProfileNextLaunch: false, lifecycle: lifecycle)
138121
}
139122

140-
func performTest(profileType: ProfilingType, lifecycle: SentryProfileOptions.SentryProfileLifecycle? = nil) throws {
141-
try launchAndConfigureSubsequentLaunches(shouldProfileThisLaunch: false, shouldProfileNextLaunch: true, profileType: profileType, lifecycle: lifecycle)
142-
try launchAndConfigureSubsequentLaunches(terminatePriorSession: true, shouldProfileThisLaunch: true, shouldProfileNextLaunch: false, profileType: profileType, lifecycle: lifecycle)
143-
}
144-
145-
fileprivate func setAppLaunchParameters(_ profileType: ProfilingUITests.ProfilingType, _ lifecycle: SentryProfileOptions.SentryProfileLifecycle?, _ shouldProfileNextLaunch: Bool) {
123+
fileprivate func setAppLaunchParameters(_ lifecycle: SentryProfileOptions.SentryProfileLifecycle?, _ shouldProfileNextLaunch: Bool) {
146124
app.launchArguments.append(contentsOf: [
147125
// these help avoid other profiles that'd be taken automatically, that interfere with the checking we do for the assertions later in the tests
148126
SentrySDKOverrides.Other.disableSwizzling.rawValue,
@@ -156,23 +134,15 @@ extension ProfilingUITests {
156134
// override full chunk completion before stoppage introduced in https://github.com/getsentry/sentry-cocoa/pull/4214
157135
SentrySDKOverrides.Profiling.immediateStop.rawValue
158136
])
159-
160-
switch profileType {
161-
case .ui:
162-
app.launchEnvironment[SentrySDKOverrides.Profiling.sessionSampleRate.rawValue] = "1"
163-
switch lifecycle {
164-
case .none:
165-
fatalError("Misconfigured test case. Must provide a lifecycle for UI profiling.")
166-
case .trace:
167-
break
168-
case .manual:
169-
app.launchArguments.append(SentrySDKOverrides.Profiling.manualLifecycle.rawValue)
170-
}
171-
case .continuous:
172-
app.launchArguments.append(SentrySDKOverrides.Profiling.disableUIProfiling.rawValue)
137+
138+
app.launchEnvironment[SentrySDKOverrides.Profiling.sessionSampleRate.rawValue] = "1"
139+
switch lifecycle {
140+
case .none:
141+
fatalError("Misconfigured test case. Must provide a lifecycle for UI profiling.")
173142
case .trace:
174-
app.launchArguments.append(SentrySDKOverrides.Profiling.disableUIProfiling.rawValue)
175-
app.launchEnvironment[SentrySDKOverrides.Profiling.sampleRate.rawValue] = "1"
143+
break
144+
case .manual:
145+
app.launchArguments.append(SentrySDKOverrides.Profiling.manualLifecycle.rawValue)
176146
}
177147

178148
if !shouldProfileNextLaunch {
@@ -192,15 +162,14 @@ extension ProfilingUITests {
192162
terminatePriorSession: Bool = false,
193163
shouldProfileThisLaunch: Bool,
194164
shouldProfileNextLaunch: Bool,
195-
profileType: ProfilingType,
196165
lifecycle: SentryProfileOptions.SentryProfileLifecycle?
197166
) throws {
198167
if terminatePriorSession {
199168
app.terminate()
200169
app = newAppSession()
201170
}
202171

203-
setAppLaunchParameters(profileType, lifecycle, shouldProfileNextLaunch)
172+
setAppLaunchParameters(lifecycle, shouldProfileNextLaunch)
204173

205174
launchApp(activateBeforeLaunch: false)
206175
goToProfiling()
@@ -217,14 +186,10 @@ extension ProfilingUITests {
217186
return
218187
}
219188

220-
if profileType == .trace {
221-
retrieveLastProfileData()
222-
} else {
223-
if profileType == .continuous || (profileType == .ui && lifecycle == .manual) {
224-
stopContinuousProfiler()
225-
}
226-
retrieveFirstProfileChunkData()
189+
if lifecycle == .manual {
190+
stopContinuousProfiler()
227191
}
192+
retrieveFirstProfileChunkData()
228193

229194
try assertProfileContents()
230195
}

Sources/Sentry/Profiling/SentryLaunchProfiling.m

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -162,47 +162,6 @@
162162
configuration:tracerConfig];
163163
}
164164

165-
# if !SDK_V9
166-
SentryLaunchProfileDecision
167-
sentry_launchShouldHaveTransactionProfiling(SentryOptions *options)
168-
{
169-
# pragma clang diagnostic push
170-
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
171-
BOOL shouldProfileNextLaunch = options.enableAppLaunchProfiling && options.enableTracing;
172-
if (!shouldProfileNextLaunch) {
173-
SENTRY_LOG_DEBUG(@"Specified options configuration doesn't enable launch profiling: "
174-
@"options.enableAppLaunchProfiling: %d; options.enableTracing: %d; won't "
175-
@"profile launch",
176-
options.enableAppLaunchProfiling, options.enableTracing);
177-
return (SentryLaunchProfileDecision) { NO, nil, nil };
178-
}
179-
# pragma clang diagnostic pop
180-
181-
SentryTransactionContext *transactionContext =
182-
[[SentryTransactionContext alloc] initWithName:@"app.launch" operation:@"profile"];
183-
transactionContext.forNextAppLaunch = YES;
184-
SentrySamplingContext *context =
185-
[[SentrySamplingContext alloc] initWithTransactionContext:transactionContext];
186-
SentrySamplerDecision *tracesSamplerDecision = sentry_sampleTrace(context, options);
187-
if (tracesSamplerDecision.decision != kSentrySampleDecisionYes) {
188-
SENTRY_LOG_DEBUG(
189-
@"Sampling out the launch trace for transaction profiling; won't profile launch.");
190-
return (SentryLaunchProfileDecision) { NO, nil, nil };
191-
}
192-
193-
SentrySamplerDecision *profilesSamplerDecision
194-
= sentry_sampleTraceProfile(context, tracesSamplerDecision, options);
195-
if (profilesSamplerDecision.decision != kSentrySampleDecisionYes) {
196-
SENTRY_LOG_DEBUG(
197-
@"Sampling out the launch profile for transaction profiling; won't profile launch.");
198-
return (SentryLaunchProfileDecision) { NO, nil, nil };
199-
}
200-
201-
SENTRY_LOG_DEBUG(@"Will start transaction profile next launch; will profile launch.");
202-
return (SentryLaunchProfileDecision) { YES, tracesSamplerDecision, profilesSamplerDecision };
203-
}
204-
# endif // !SDK_V9
205-
206165
SentryLaunchProfileDecision
207166
sentry_launchShouldHaveContinuousProfilingV2(SentryOptions *options)
208167
{
@@ -264,19 +223,7 @@
264223
if ([options isContinuousProfilingV2Enabled]) {
265224
return sentry_launchShouldHaveContinuousProfilingV2(options);
266225
}
267-
# if SDK_V9
268226
return (SentryLaunchProfileDecision) { NO, nil, nil };
269-
# else
270-
271-
# pragma clang diagnostic push
272-
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
273-
if ([options isContinuousProfilingEnabled]) {
274-
return (SentryLaunchProfileDecision) { options.enableAppLaunchProfiling, nil, nil };
275-
}
276-
# pragma clang diagnostic pop
277-
278-
return sentry_launchShouldHaveTransactionProfiling(options);
279-
# endif // SDK_V9
280227
}
281228

282229
/**

Sources/Sentry/Public/SentryOptions.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -407,17 +407,6 @@ NS_SWIFT_NAME(Options)
407407
*/
408408
@property (nonatomic, assign) BOOL enableFileIOTracing;
409409

410-
#if !SDK_V9
411-
/**
412-
* Indicates whether tracing should be enabled.
413-
* @discussion Enabling this sets @c tracesSampleRate to @c 1 if both @c tracesSampleRate and
414-
* @c tracesSampler are @c nil. Changing either @c tracesSampleRate or @c tracesSampler to a value
415-
* other then @c nil will enable this in case this was never changed before.
416-
*/
417-
@property (nonatomic)
418-
BOOL enableTracing DEPRECATED_MSG_ATTRIBUTE("Use tracesSampleRate or tracesSampler instead");
419-
#endif // !SDK_V9
420-
421410
/**
422411
* Indicates the percentage of the tracing data that is collected.
423412
* @discussion Specifying @c 0 or @c nil discards all trace data, @c 1.0 collects all trace data,

Sources/Sentry/SentryOptions.m

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
NSString *const kSentryDefaultEnvironment = @"production";
2525

2626
@implementation SentryOptions {
27-
#if !SDK_V9
28-
BOOL _enableTracingManual;
29-
#endif // !SDK_V9
3027
#if SWIFT_PACKAGE || SENTRY_TEST
3128
id _beforeSendLogDynamic;
3229
#endif // SWIFT_PACKAGE || SENTRY_TEST
@@ -95,10 +92,6 @@ - (instancetype)init
9592

9693
self.initialScope = ^SentryScope *(SentryScope *scope) { return scope; };
9794
__swiftExperimentalOptions = [[SentryExperimentalOptions alloc] init];
98-
#if !SDK_V9
99-
_enableTracing = NO;
100-
_enableTracingManual = NO;
101-
#endif // !SDK_V9
10295
#if SENTRY_HAS_UIKIT
10396
self.enableUIViewControllerTracing = YES;
10497
self.attachScreenshot = NO;
@@ -277,32 +270,12 @@ - (void)setSampleRate:(NSNumber *)sampleRate
277270
return rate >= 0 && rate <= 1.0;
278271
}
279272

280-
#if !SDK_V9
281-
- (void)setEnableTracing:(BOOL)enableTracing
282-
{
283-
//`enableTracing` is basically an alias to tracesSampleRate
284-
// by enabling it we set tracesSampleRate to maximum
285-
// if the user did not configured other ways to enable tracing
286-
if ((_enableTracing = enableTracing)) {
287-
if (_tracesSampleRate == nil && _tracesSampler == nil && _enableTracing) {
288-
_tracesSampleRate = @1;
289-
}
290-
}
291-
_enableTracingManual = YES;
292-
}
293-
#endif // !SDK_V9
294-
295273
- (void)setTracesSampleRate:(NSNumber *)tracesSampleRate
296274
{
297275
if (tracesSampleRate == nil) {
298276
_tracesSampleRate = nil;
299277
} else if (sentry_isValidSampleRate(tracesSampleRate)) {
300278
_tracesSampleRate = tracesSampleRate;
301-
#if !SDK_V9
302-
if (!_enableTracingManual) {
303-
_enableTracing = YES;
304-
}
305-
#endif // !SDK_V9
306279
} else {
307280
_tracesSampleRate = SENTRY_DEFAULT_TRACES_SAMPLE_RATE;
308281
}
@@ -311,23 +284,12 @@ - (void)setTracesSampleRate:(NSNumber *)tracesSampleRate
311284
- (void)setTracesSampler:(SentryTracesSamplerCallback)tracesSampler
312285
{
313286
_tracesSampler = tracesSampler;
314-
#if !SDK_V9
315-
if (_tracesSampler != nil && !_enableTracingManual) {
316-
_enableTracing = YES;
317-
}
318-
#endif // !SDK_V9
319287
}
320288

321289
- (BOOL)isTracingEnabled
322290
{
323-
#if SDK_V9
324291
return (_tracesSampleRate != nil && [_tracesSampleRate doubleValue] > 0)
325292
|| _tracesSampler != nil;
326-
#else
327-
return _enableTracing
328-
&& ((_tracesSampleRate != nil && [_tracesSampleRate doubleValue] > 0)
329-
|| _tracesSampler != nil);
330-
#endif // !SDK_V9
331293
}
332294

333295
#if SENTRY_TARGET_PROFILING_SUPPORTED

Sources/Sentry/SentyOptionsInternal.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,6 @@ + (BOOL)validateOptions:(NSDictionary<NSString *, id> *)options
313313
if ([self isBlock:options[@"tracesSampler"]]) {
314314
sentryOptions.tracesSampler = options[@"tracesSampler"];
315315
}
316-
#if !SDK_V9
317-
# pragma clang diagnostic push
318-
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
319-
if ([options[@"enableTracing"] isKindOfClass:NSNumber.self]) {
320-
sentryOptions.enableTracing = [options[@"enableTracing"] boolValue];
321-
}
322-
# pragma clang diagnostic pop
323-
#endif // !SDK_V9
324316

325317
if ([options[@"inAppIncludes"] isKindOfClass:[NSArray class]]) {
326318
NSArray<NSString *> *inAppIncludes =

0 commit comments

Comments
 (0)