Skip to content

Commit

Permalink
ref: Rename APM tracking feature flags to tracing (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrenskers authored Nov 28, 2022
1 parent 3936dd2 commit 909e73a
Show file tree
Hide file tree
Showing 44 changed files with 113 additions and 104 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ This version adds a dependency on Swift.
- Marks App hang's event stacktrace snapshot as true (#2441)
- Enable user interaction tracing by default (#2442)
- Remove default attachment content type (#2443)
- Rename APM tracking feature flags to tracing (#2450)
- Rename `SentryOptions.enableAutoPerformanceTracking` to `enableAutoPerformanceTracing`
- Rename `SentryOptions.enableUIViewControllerTracking` to `enableUIViewControllerTracing`
- Rename `SentryOptions.enablePreWarmedAppStartTracking` to `enablePreWarmedAppStartTracing`
- Rename `SentryOptions.enableFileIOTracking` to `enableFileIOTracing`
- Rename `SentryOptions.enableCoreDataTracking` to `enableCoreDataTracing`

## 7.31.2

Expand Down
4 changes: 2 additions & 2 deletions Samples/TrendingMovies/TrendingMovies/Utilities/Tracer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extension Tracer {
options.sessionTrackingIntervalMillis = 5_000
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableCoreDataTracking = true
options.enableFileIOTracing = true
options.enableCoreDataTracing = true
options.profilesSampleRate = 1.0
options.attachScreenshot = true
options.attachViewHierarchy = true
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-ObjectiveC/iOS-ObjectiveC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ - (BOOL)application:(UIApplication *)application
options.sessionTrackingIntervalMillis = 5000UL;
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = @1.0;
options.enableFileIOTracking = YES;
options.enableFileIOTracing = YES;
options.attachScreenshot = YES;
options.attachViewHierarchy = YES;
options.enableUserInteractionTracing = YES;
Expand Down
10 changes: 5 additions & 5 deletions Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.sessionTrackingIntervalMillis = 5_000
options.enableFileIOTracking = true
options.enableCoreDataTracking = true
options.enableFileIOTracing = true
options.enableCoreDataTracing = true
options.profilesSampleRate = 1.0
options.attachScreenshot = true
options.attachViewHierarchy = true
options.environment = "test-app"

let isBenchmarking = ProcessInfo.processInfo.arguments.contains("--io.sentry.test.benchmarking")
options.enableAutoPerformanceTracking = !isBenchmarking
options.enableAutoPerformanceTracing = !isBenchmarking

// the benchmark test starts and stops a custom transaction using a UIButton, and automatic user interaction tracing stops the transaction that begins with that button press after the idle timeout elapses, stopping the profiler (only one profiler runs regardless of the number of concurrent transactions)
options.enableUserInteractionTracing = !isBenchmarking
options.enableAutoPerformanceTracking = !isBenchmarking
options.enablePreWarmedAppStartTracking = !isBenchmarking
options.enableAutoPerformanceTracing = !isBenchmarking
options.enablePreWarmedAppStartTracing = !isBenchmarking

// because we run CPU for 15 seconds at full throttle, we trigger ANR issues being sent. disable such during benchmarks.
options.enableAppHangTracking = !isBenchmarking
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-SwiftUI/iOS-SwiftUI/SwiftUIApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct SwiftUIApp: App {
options.sessionTrackingIntervalMillis = 5_000
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableFileIOTracing = true
options.profilesSampleRate = 1.0
options.enableUserInteractionTracing = true
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS15-SwiftUI/iOS15-SwiftUI/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct SwiftUIApp: App {
options.sessionTrackingIntervalMillis = 5_000
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableFileIOTracing = true
options.profilesSampleRate = 1.0
options.enableUserInteractionTracing = true
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/macOS-Swift/macOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
options.sessionTrackingIntervalMillis = 5_000
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableFileIOTracing = true
if ProcessInfo.processInfo.arguments.contains("--io.sentry.profiling.enable") {
options.profilesSampleRate = 1
}
Expand Down
2 changes: 1 addition & 1 deletion Samples/tvOS-Swift/tvOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options.sessionTrackingIntervalMillis = 5_000
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableFileIOTracing = true
options.enableUserInteractionTracing = true
options.enableAppHangTracking = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
}
options.debug = true
options.sessionTrackingIntervalMillis = 5_000
options.enableFileIOTracking = true
options.enableFileIOTracing = true
}

SentrySDK.configureScope { scope in
Expand Down
3 changes: 3 additions & 0 deletions Sentry.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Sources/Sentry/Public/SentryOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ NS_SWIFT_NAME(Options)
* <code>YES</code>. Note: Performance Monitoring must be enabled for this flag to take effect. See:
* https://docs.sentry.io/platforms/apple/performance/
*/
@property (nonatomic, assign) BOOL enableAutoPerformanceTracking;
@property (nonatomic, assign) BOOL enableAutoPerformanceTracing;

#if SENTRY_HAS_UIKIT
/**
* When enabled, the SDK tracks performance for UIViewController subclasses. The default is
* <code>YES</code>.
*/
@property (nonatomic, assign) BOOL enableUIViewControllerTracking;
@property (nonatomic, assign) BOOL enableUIViewControllerTracing;

/**
* This feature is EXPERIMENTAL.
Expand Down Expand Up @@ -240,7 +240,7 @@ NS_SWIFT_NAME(Options)
*
* Default value is <code>NO</code>
*/
@property (nonatomic, assign) BOOL enablePreWarmedAppStartTracking;
@property (nonatomic, assign) BOOL enablePreWarmedAppStartTracing;

#endif

Expand All @@ -257,7 +257,7 @@ NS_SWIFT_NAME(Options)
* When enabled, the SDK tracks performance for file IO reads and writes with NSData if auto
* performance tracking and enableSwizzling are enabled. The default is <code>NO</code>.
*/
@property (nonatomic, assign) BOOL enableFileIOTracking;
@property (nonatomic, assign) BOOL enableFileIOTracing;

/**
* Indicates the percentage of the tracing data that is collected. Setting this to 0 or NIL discards
Expand Down Expand Up @@ -329,7 +329,7 @@ NS_SWIFT_NAME(Options)
* performance monitoring. The default is <code>NO</code>.
* @see <https://docs.sentry.io/platforms/apple/performance/>
*/
@property (nonatomic, assign) BOOL enableCoreDataTracking;
@property (nonatomic, assign) BOOL enableCoreDataTracing;

#if SENTRY_TARGET_PROFILING_SUPPORTED
/**
Expand Down
10 changes: 5 additions & 5 deletions Sources/Sentry/SentryAppStartTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@property (nonatomic, strong) SentrySysctl *sysctl;
@property (nonatomic, assign) BOOL wasInBackground;
@property (nonatomic, strong) NSDate *didFinishLaunchingTimestamp;
@property (nonatomic, assign) BOOL enablePreWarmedAppStartTracking;
@property (nonatomic, assign) BOOL enablePreWarmedAppStartTracing;

@end

Expand All @@ -56,7 +56,7 @@ - (instancetype)initWithCurrentDateProvider:(id<SentryCurrentDateProvider>)curre
dispatchQueueWrapper:(SentryDispatchQueueWrapper *)dispatchQueueWrapper
appStateManager:(SentryAppStateManager *)appStateManager
sysctl:(SentrySysctl *)sysctl
enablePreWarmedAppStartTracking:(BOOL)enablePreWarmedAppStartTracking
enablePreWarmedAppStartTracing:(BOOL)enablePreWarmedAppStartTracing
{
if (self = [super init]) {
self.currentDate = currentDateProvider;
Expand All @@ -66,7 +66,7 @@ - (instancetype)initWithCurrentDateProvider:(id<SentryCurrentDateProvider>)curre
self.previousAppState = [self.appStateManager loadPreviousAppState];
self.wasInBackground = NO;
self.didFinishLaunchingTimestamp = [currentDateProvider date];
self.enablePreWarmedAppStartTracking = enablePreWarmedAppStartTracking;
self.enablePreWarmedAppStartTracing = enablePreWarmedAppStartTracing;
}
return self;
}
Expand Down Expand Up @@ -127,11 +127,11 @@ - (void)buildAppStartMeasurement
if ([self isActivePrewarmAvailable] && isActivePrewarm) {
SENTRY_LOG_INFO(@"The app was prewarmed.");

if (self.enablePreWarmedAppStartTracking) {
if (self.enablePreWarmedAppStartTracing) {
isPreWarmed = YES;
} else {
SENTRY_LOG_INFO(
@"EnablePreWarmedAppStartTracking disabled. Not measuring app start.");
@"EnablePreWarmedAppStartTracing disabled. Not measuring app start.");
return;
}
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/Sentry/SentryAppStartTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ - (BOOL)installWithOptions:(SentryOptions *)options
[SentryDependencyContainer sharedInstance].appStateManager;

self.tracker = [[SentryAppStartTracker alloc]
initWithCurrentDateProvider:currentDateProvider
dispatchQueueWrapper:[[SentryDispatchQueueWrapper alloc] init]
appStateManager:appStateManager
sysctl:sysctl
enablePreWarmedAppStartTracking:options.enablePreWarmedAppStartTracking];
initWithCurrentDateProvider:currentDateProvider
dispatchQueueWrapper:[[SentryDispatchQueueWrapper alloc] init]
appStateManager:appStateManager
sysctl:sysctl
enablePreWarmedAppStartTracing:options.enablePreWarmedAppStartTracing];
[self.tracker start];

return YES;
Expand All @@ -53,7 +53,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options

- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionEnableAutoPerformanceTracking | kIntegrationOptionIsTracingEnabled;
return kIntegrationOptionEnableAutoPerformanceTracing | kIntegrationOptionIsTracingEnabled;
}

- (void)uninstall
Expand Down
24 changes: 12 additions & 12 deletions Sources/Sentry/SentryBaseIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options
return NO;
}

if ((integrationOptions & kIntegrationOptionEnableAutoPerformanceTracking)
&& !options.enableAutoPerformanceTracking) {
[self logWithOptionName:@"enableAutoPerformanceTracking"];
if ((integrationOptions & kIntegrationOptionEnableAutoPerformanceTracing)
&& !options.enableAutoPerformanceTracing) {
[self logWithOptionName:@"enableAutoPerformanceTracing"];
return NO;
}

#if SENTRY_HAS_UIKIT
if ((integrationOptions & kIntegrationOptionEnableUIViewControllerTracking)
&& !options.enableUIViewControllerTracking) {
[self logWithOptionName:@"enableUIViewControllerTracking"];
if ((integrationOptions & kIntegrationOptionEnableUIViewControllerTracing)
&& !options.enableUIViewControllerTracing) {
[self logWithOptionName:@"enableUIViewControllerTracing"];
return NO;
}

Expand Down Expand Up @@ -92,9 +92,9 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options
return NO;
}

if ((integrationOptions & kIntegrationOptionEnableFileIOTracking)
&& !options.enableFileIOTracking) {
[self logWithOptionName:@"enableFileIOTracking"];
if ((integrationOptions & kIntegrationOptionEnableFileIOTracing)
&& !options.enableFileIOTracing) {
[self logWithOptionName:@"enableFileIOTracing"];
return NO;
}

Expand All @@ -104,9 +104,9 @@ - (BOOL)shouldBeEnabledWithOptions:(SentryOptions *)options
return NO;
}

if ((integrationOptions & kIntegrationOptionEnableCoreDataTracking)
&& !options.enableCoreDataTracking) {
[self logWithOptionName:@"enableCoreDataTracking"];
if ((integrationOptions & kIntegrationOptionEnableCoreDataTracing)
&& !options.enableCoreDataTracing) {
[self logWithOptionName:@"enableCoreDataTracing"];
return NO;
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/SentryClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,8 @@ - (void)setSdk:(SentryEvent *)event
}

#if SENTRY_HAS_UIKIT
if (self.options.enablePreWarmedAppStartTracking) {
[integrations addObject:@"PreWarmedAppStartTracking"];
if (self.options.enablePreWarmedAppStartTracing) {
[integrations addObject:@"PreWarmedAppStartTracing"];
}
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/SentryCoreDataTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options

- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionEnableAutoPerformanceTracking | kIntegrationOptionEnableSwizzling
| kIntegrationOptionIsTracingEnabled | kIntegrationOptionEnableCoreDataTracking;
return kIntegrationOptionEnableAutoPerformanceTracing | kIntegrationOptionEnableSwizzling
| kIntegrationOptionIsTracingEnabled | kIntegrationOptionEnableCoreDataTracing;
}

- (void)uninstall
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryFileIOTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options
- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionEnableSwizzling | kIntegrationOptionIsTracingEnabled
| kIntegrationOptionEnableAutoPerformanceTracking | kIntegrationOptionEnableFileIOTracking;
| kIntegrationOptionEnableAutoPerformanceTracing | kIntegrationOptionEnableFileIOTracing;
}

- (void)uninstall
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryFramesTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options

- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionEnableAutoPerformanceTracking | kIntegrationOptionIsTracingEnabled;
return kIntegrationOptionEnableAutoPerformanceTracing | kIntegrationOptionIsTracingEnabled;
}

- (void)uninstall
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryNetworkTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options

- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionIsTracingEnabled | kIntegrationOptionEnableAutoPerformanceTracking
return kIntegrationOptionIsTracingEnabled | kIntegrationOptionEnableAutoPerformanceTracing
| kIntegrationOptionEnableNetworkTracking;
}

Expand Down
10 changes: 5 additions & 5 deletions Sources/Sentry/SentryOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ - (instancetype)init
self.stitchAsyncCode = NO;
self.maxAttachmentSize = 20 * 1024 * 1024;
self.sendDefaultPii = NO;
self.enableAutoPerformanceTracking = YES;
self.enableAutoPerformanceTracing = YES;
self.enableCaptureFailedRequests = NO;
self.environment = kSentryDefaultEnvironment;
#if SENTRY_HAS_UIKIT
self.enableUIViewControllerTracking = YES;
self.enableUIViewControllerTracing = YES;
self.attachScreenshot = NO;
self.attachViewHierarchy = NO;
self.enableUserInteractionTracing = YES;
self.idleTimeout = 3.0;
self.enablePreWarmedAppStartTracking = NO;
self.enablePreWarmedAppStartTracing = NO;
#endif
self.enableAppHangTracking = NO;
self.appHangTimeoutInterval = 2.0;
self.enableAutoBreadcrumbTracking = YES;
self.enableNetworkTracking = YES;
self.enableFileIOTracking = NO;
self.enableFileIOTracing = NO;
self.enableNetworkBreadcrumbs = YES;
_defaultTracesSampleRate = nil;
self.tracesSampleRate = _defaultTracesSampleRate;
Expand All @@ -86,7 +86,7 @@ - (instancetype)init
_defaultProfilesSampleRate = nil;
self.profilesSampleRate = _defaultProfilesSampleRate;
#endif
self.enableCoreDataTracking = NO;
self.enableCoreDataTracing = NO;
_enableSwizzling = YES;
self.sendClientReports = YES;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/SentryPerformanceTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ - (BOOL)installWithOptions:(SentryOptions *)options

- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionEnableAutoPerformanceTracking
| kIntegrationOptionEnableUIViewControllerTracking | kIntegrationOptionIsTracingEnabled
return kIntegrationOptionEnableAutoPerformanceTracing
| kIntegrationOptionEnableUIViewControllerTracing | kIntegrationOptionIsTracingEnabled
| kIntegrationOptionEnableSwizzling;
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryUIEventTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (BOOL)installWithOptions:(SentryOptions *)options

- (SentryIntegrationOption)integrationOptions
{
return kIntegrationOptionEnableAutoPerformanceTracking | kIntegrationOptionEnableSwizzling
return kIntegrationOptionEnableAutoPerformanceTracing | kIntegrationOptionEnableSwizzling
| kIntegrationOptionIsTracingEnabled | kIntegrationOptionEnableUserInteractionTracing;
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/include/PrivateSentrySDKOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ typedef void (^SentryOnAppStartMeasurementAvailable)(

/**
* If enabled, the SDK won't send the app start measurement with the first transaction. Instead, if
* enableAutoPerformanceTracking is enabled, the SDK measures the app start and then calls
* enableAutoPerformanceTracing is enabled, the SDK measures the app start and then calls
* onAppStartMeasurementAvailable. Furthermore, the SDK doesn't set all values for the app start
* measurement because the HybridSDKs initialize the Cocoa SDK too late to receive all
* notifications. Instead, the SDK sets the appStartDuration to 0 and the
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/include/SentryAppStartTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SENTRY_NO_INIT
dispatchQueueWrapper:(SentryDispatchQueueWrapper *)dispatchQueueWrapper
appStateManager:(SentryAppStateManager *)appStateManager
sysctl:(SentrySysctl *)sysctl
enablePreWarmedAppStartTracking:(BOOL)enablePreWarmedAppStartTracking;
enablePreWarmedAppStartTracing:(BOOL)enablePreWarmedAppStartTracing;

- (void)start;
- (void)stop;
Expand Down
Loading

0 comments on commit 909e73a

Please sign in to comment.