Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
repository: getsentry/sentry-react-native
path: sentry-react-native
ref: updateVersion
ref: removeEnableTracing

- name: Enable Corepack
working-directory: sentry-react-native
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Removes deprecated SentryDebugImageProvider class (#5598)
Makes app hang tracking V2 the default and removes the option to enable/disable it (#5615)
Removes segment property on SentryUser, SentryBaggage, and SentryTraceContext (#5638)
Removes public SentrySerializable conformance from many public models (#5636, #5840, #5982)
Removes enableTracing property from SentryOptions (#5694)
Removes deprecated `setExtraValue` from SentrySpan (#5864)
Removes `integrations` property from `SentryOptions` (#5749)
Makes `SentryEventDecodable` internal (#5808)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Removes Decodable conformances from the public API of model classes (#5691)
- Removes deprecated user feedback API, this is replaced with the new feedback API (#5591)
- 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)
- Removes enableTracing property from SentryOptions (#5694)

### Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ public struct SentrySDKWrapper {
options.enableWatchdogTerminationTracking = !isUITest && !isBenchmarking && !SentrySDKOverrides.Performance.disableWatchdogTracking.boolValue

options.enableAutoPerformanceTracing = !isBenchmarking && !SentrySDKOverrides.Performance.disablePerformanceTracing.boolValue
#if !SDK_V9
options.enableTracing = !isBenchmarking && !SentrySDKOverrides.Tracing.disableTracing.boolValue
#endif // !SDK_V9

options.enableNetworkTracking = !SentrySDKOverrides.Networking.disablePerformanceTracking.boolValue
options.enableCaptureFailedRequests = !SentrySDKOverrides.Networking.disableFailedRequestTracking.boolValue
Expand Down
71 changes: 18 additions & 53 deletions Samples/iOS-Swift/iOS-Swift-UITests/ProfilingUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,21 @@ import XCTest

class ProfilingUITests: BaseUITest {
override var automaticallyLaunchAndTerminateApp: Bool { false }

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

try performTest(profileType: .trace)
}

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

try performTest(profileType: .continuous)
}

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

try performTest(profileType: .ui, lifecycle: .trace)
try performTest(lifecycle: .trace)
}

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

try performTest(profileType: .ui, lifecycle: .manual)
try performTest(lifecycle: .manual)
}

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

enum ProfilingType {
case trace
case continuous // aka "continuous beta"
case ui // aka "continuous v2"
func performTest(lifecycle: SentryProfileOptions.SentryProfileLifecycle? = nil) throws {
try launchAndConfigureSubsequentLaunches(shouldProfileThisLaunch: false, shouldProfileNextLaunch: true, lifecycle: lifecycle)
try launchAndConfigureSubsequentLaunches(terminatePriorSession: true, shouldProfileThisLaunch: true, shouldProfileNextLaunch: false, lifecycle: lifecycle)
}

func performTest(profileType: ProfilingType, lifecycle: SentryProfileOptions.SentryProfileLifecycle? = nil) throws {
try launchAndConfigureSubsequentLaunches(shouldProfileThisLaunch: false, shouldProfileNextLaunch: true, profileType: profileType, lifecycle: lifecycle)
try launchAndConfigureSubsequentLaunches(terminatePriorSession: true, shouldProfileThisLaunch: true, shouldProfileNextLaunch: false, profileType: profileType, lifecycle: lifecycle)
}

fileprivate func setAppLaunchParameters(_ profileType: ProfilingUITests.ProfilingType, _ lifecycle: SentryProfileOptions.SentryProfileLifecycle?, _ shouldProfileNextLaunch: Bool) {
fileprivate func setAppLaunchParameters(_ lifecycle: SentryProfileOptions.SentryProfileLifecycle?, _ shouldProfileNextLaunch: Bool) {
app.launchArguments.append(contentsOf: [
// these help avoid other profiles that'd be taken automatically, that interfere with the checking we do for the assertions later in the tests
SentrySDKOverrides.Other.disableSwizzling.rawValue,
Expand All @@ -156,23 +134,15 @@ extension ProfilingUITests {
// override full chunk completion before stoppage introduced in https://github.com/getsentry/sentry-cocoa/pull/4214
SentrySDKOverrides.Profiling.immediateStop.rawValue
])

switch profileType {
case .ui:
app.launchEnvironment[SentrySDKOverrides.Profiling.sessionSampleRate.rawValue] = "1"
switch lifecycle {
case .none:
fatalError("Misconfigured test case. Must provide a lifecycle for UI profiling.")
case .trace:
break
case .manual:
app.launchArguments.append(SentrySDKOverrides.Profiling.manualLifecycle.rawValue)
}
case .continuous:
app.launchArguments.append(SentrySDKOverrides.Profiling.disableUIProfiling.rawValue)

app.launchEnvironment[SentrySDKOverrides.Profiling.sessionSampleRate.rawValue] = "1"
switch lifecycle {
case .none:
fatalError("Misconfigured test case. Must provide a lifecycle for UI profiling.")
case .trace:
app.launchArguments.append(SentrySDKOverrides.Profiling.disableUIProfiling.rawValue)
app.launchEnvironment[SentrySDKOverrides.Profiling.sampleRate.rawValue] = "1"
break
case .manual:
app.launchArguments.append(SentrySDKOverrides.Profiling.manualLifecycle.rawValue)
}

if !shouldProfileNextLaunch {
Expand All @@ -192,15 +162,14 @@ extension ProfilingUITests {
terminatePriorSession: Bool = false,
shouldProfileThisLaunch: Bool,
shouldProfileNextLaunch: Bool,
profileType: ProfilingType,
lifecycle: SentryProfileOptions.SentryProfileLifecycle?
) throws {
if terminatePriorSession {
app.terminate()
app = newAppSession()
}

setAppLaunchParameters(profileType, lifecycle, shouldProfileNextLaunch)
setAppLaunchParameters(lifecycle, shouldProfileNextLaunch)

launchApp(activateBeforeLaunch: false)
goToProfiling()
Expand All @@ -217,14 +186,10 @@ extension ProfilingUITests {
return
}

if profileType == .trace {
retrieveLastProfileData()
} else {
if profileType == .continuous || (profileType == .ui && lifecycle == .manual) {
stopContinuousProfiler()
}
retrieveFirstProfileChunkData()
if lifecycle == .manual {
stopContinuousProfiler()
}
retrieveFirstProfileChunkData()

try assertProfileContents()
}
Expand Down
53 changes: 0 additions & 53 deletions Sources/Sentry/Profiling/SentryLaunchProfiling.m
Original file line number Diff line number Diff line change
Expand Up @@ -162,47 +162,6 @@
configuration:tracerConfig];
}

# if !SDK_V9
SentryLaunchProfileDecision
sentry_launchShouldHaveTransactionProfiling(SentryOptions *options)
{
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
BOOL shouldProfileNextLaunch = options.enableAppLaunchProfiling && options.enableTracing;
if (!shouldProfileNextLaunch) {
SENTRY_LOG_DEBUG(@"Specified options configuration doesn't enable launch profiling: "
@"options.enableAppLaunchProfiling: %d; options.enableTracing: %d; won't "
@"profile launch",
options.enableAppLaunchProfiling, options.enableTracing);
return (SentryLaunchProfileDecision) { NO, nil, nil };
}
# pragma clang diagnostic pop

SentryTransactionContext *transactionContext =
[[SentryTransactionContext alloc] initWithName:@"app.launch" operation:@"profile"];
transactionContext.forNextAppLaunch = YES;
SentrySamplingContext *context =
[[SentrySamplingContext alloc] initWithTransactionContext:transactionContext];
SentrySamplerDecision *tracesSamplerDecision = sentry_sampleTrace(context, options);
if (tracesSamplerDecision.decision != kSentrySampleDecisionYes) {
SENTRY_LOG_DEBUG(
@"Sampling out the launch trace for transaction profiling; won't profile launch.");
return (SentryLaunchProfileDecision) { NO, nil, nil };
}

SentrySamplerDecision *profilesSamplerDecision
= sentry_sampleTraceProfile(context, tracesSamplerDecision, options);
if (profilesSamplerDecision.decision != kSentrySampleDecisionYes) {
SENTRY_LOG_DEBUG(
@"Sampling out the launch profile for transaction profiling; won't profile launch.");
return (SentryLaunchProfileDecision) { NO, nil, nil };
}

SENTRY_LOG_DEBUG(@"Will start transaction profile next launch; will profile launch.");
return (SentryLaunchProfileDecision) { YES, tracesSamplerDecision, profilesSamplerDecision };
}
# endif // !SDK_V9

SentryLaunchProfileDecision
sentry_launchShouldHaveContinuousProfilingV2(SentryOptions *options)
{
Expand Down Expand Up @@ -264,19 +223,7 @@
if ([options isContinuousProfilingV2Enabled]) {
return sentry_launchShouldHaveContinuousProfilingV2(options);
}
# if SDK_V9
return (SentryLaunchProfileDecision) { NO, nil, nil };
# else

# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([options isContinuousProfilingEnabled]) {
return (SentryLaunchProfileDecision) { options.enableAppLaunchProfiling, nil, nil };
}
# pragma clang diagnostic pop

return sentry_launchShouldHaveTransactionProfiling(options);
# endif // SDK_V9
}

/**
Expand Down
11 changes: 0 additions & 11 deletions Sources/Sentry/Public/SentryOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,17 +407,6 @@ NS_SWIFT_NAME(Options)
*/
@property (nonatomic, assign) BOOL enableFileIOTracing;

#if !SDK_V9
/**
* Indicates whether tracing should be enabled.
* @discussion Enabling this sets @c tracesSampleRate to @c 1 if both @c tracesSampleRate and
* @c tracesSampler are @c nil. Changing either @c tracesSampleRate or @c tracesSampler to a value
* other then @c nil will enable this in case this was never changed before.
*/
@property (nonatomic)
BOOL enableTracing DEPRECATED_MSG_ATTRIBUTE("Use tracesSampleRate or tracesSampler instead");
#endif // !SDK_V9

/**
* Indicates the percentage of the tracing data that is collected.
* @discussion Specifying @c 0 or @c nil discards all trace data, @c 1.0 collects all trace data,
Expand Down
38 changes: 0 additions & 38 deletions Sources/Sentry/SentryOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
NSString *const kSentryDefaultEnvironment = @"production";

@implementation SentryOptions {
#if !SDK_V9
BOOL _enableTracingManual;
#endif // !SDK_V9
#if SWIFT_PACKAGE || SENTRY_TEST
id _beforeSendLogDynamic;
#endif // SWIFT_PACKAGE || SENTRY_TEST
Expand Down Expand Up @@ -95,10 +92,6 @@ - (instancetype)init

self.initialScope = ^SentryScope *(SentryScope *scope) { return scope; };
__swiftExperimentalOptions = [[SentryExperimentalOptions alloc] init];
#if !SDK_V9
_enableTracing = NO;
_enableTracingManual = NO;
#endif // !SDK_V9
#if SENTRY_HAS_UIKIT
self.enableUIViewControllerTracing = YES;
self.attachScreenshot = NO;
Expand Down Expand Up @@ -277,32 +270,12 @@ - (void)setSampleRate:(NSNumber *)sampleRate
return rate >= 0 && rate <= 1.0;
}

#if !SDK_V9
- (void)setEnableTracing:(BOOL)enableTracing
{
//`enableTracing` is basically an alias to tracesSampleRate
// by enabling it we set tracesSampleRate to maximum
// if the user did not configured other ways to enable tracing
if ((_enableTracing = enableTracing)) {
if (_tracesSampleRate == nil && _tracesSampler == nil && _enableTracing) {
_tracesSampleRate = @1;
}
}
_enableTracingManual = YES;
}
#endif // !SDK_V9

- (void)setTracesSampleRate:(NSNumber *)tracesSampleRate
{
if (tracesSampleRate == nil) {
_tracesSampleRate = nil;
} else if (sentry_isValidSampleRate(tracesSampleRate)) {
_tracesSampleRate = tracesSampleRate;
#if !SDK_V9
if (!_enableTracingManual) {
_enableTracing = YES;
}
#endif // !SDK_V9
} else {
_tracesSampleRate = SENTRY_DEFAULT_TRACES_SAMPLE_RATE;
}
Expand All @@ -311,23 +284,12 @@ - (void)setTracesSampleRate:(NSNumber *)tracesSampleRate
- (void)setTracesSampler:(SentryTracesSamplerCallback)tracesSampler
{
_tracesSampler = tracesSampler;
#if !SDK_V9
if (_tracesSampler != nil && !_enableTracingManual) {
_enableTracing = YES;
}
#endif // !SDK_V9
}

- (BOOL)isTracingEnabled
{
#if SDK_V9
return (_tracesSampleRate != nil && [_tracesSampleRate doubleValue] > 0)
|| _tracesSampler != nil;
#else
return _enableTracing
&& ((_tracesSampleRate != nil && [_tracesSampleRate doubleValue] > 0)
|| _tracesSampler != nil);
#endif // !SDK_V9
}

#if SENTRY_TARGET_PROFILING_SUPPORTED
Expand Down
8 changes: 0 additions & 8 deletions Sources/Sentry/SentyOptionsInternal.m
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,6 @@ + (BOOL)validateOptions:(NSDictionary<NSString *, id> *)options
if ([self isBlock:options[@"tracesSampler"]]) {
sentryOptions.tracesSampler = options[@"tracesSampler"];
}
#if !SDK_V9
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([options[@"enableTracing"] isKindOfClass:NSNumber.self]) {
sentryOptions.enableTracing = [options[@"enableTracing"] boolValue];
}
# pragma clang diagnostic pop
#endif // !SDK_V9

if ([options[@"inAppIncludes"] isKindOfClass:[NSArray class]]) {
NSArray<NSString *> *inAppIncludes =
Expand Down
Loading
Loading