Skip to content

Enable tracing in the Android/iOS SDKs by default #4032

Description

@Qonstrukt

Package

Sentry

.NET Flavor

.NET

.NET Version

9.0.2

OS

iOS

SDK Version

5.3.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Install Sentry NuGet package
  2. Initialise Sentry with TracesSampleRate set:
SentrySdk.Init(options =>
{
	options.Dsn = "<masked>";
	options.IsGlobalModeEnabled = true;
				
#if DEBUG
	options.Debug = true;
	options.SampleRate = 1.0F;
	options.TracesSampleRate = 1.0F;
	options.ProfilesSampleRate = 1.0F;
#else
	options.SampleRate = 0.5F;
	options.TracesSampleRate = 0.5F;
	options.ProfilesSampleRate = 1.0F
#endif
});

Expected Result

I expect traces to be collected.

Actual Result

Traces aren't enabled, because isTracingEnabled is disabled apparently as the logs say:

[Sentry] [debug] [SentrySDK:209] Starting SDK...
[Sentry] [debug] [SentryFileManager:709] SentryFileManager.cachePath: /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches
[Sentry] [debug] [SentryFileManager:50] No file to delete at /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/events
[Sentry] [debug] [SentryHttpTransport:282] sendAllCachedEnvelopes start.
[Sentry] [debug] [SentryHttpTransport:305] No envelopes left to send.
[Sentry] [debug] [SentryReachability:178] Adding observer: <SentryHttpTransport: 0x600002a6e840>
[Sentry] [debug] [SentryReachability:180] Synchronized to add observer: <SentryHttpTransport: 0x600002a6e840>
[Sentry] [debug] [SentryReachability:210] registering callback for reachability ref <SCNetworkReachability 0x106313520 [0x1e3a77680]> {name = sentry.io}
[Sentry] [debug] [SentryFileManager:541] Moving state /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/app.state to previous /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/previous.app.state.
[Sentry] [debug] [SentryFileManager:129] Dispatched deletion of old envelopes from <SentryFileManager: 0x60000330c640>
[Sentry] [debug] [SentryFileManager:50] No file to delete at /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/previous.app.state
[Sentry] [debug] [SentryFileManager:541] Moving state /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/breadcrumbs.1.state to previous /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/previous.breadcrumbs.1.state.
[Sentry] [debug] [SentryFileManager:50] No file to delete at /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/previous.breadcrumbs.1.state
[Sentry] [debug] [SentryFileManager:541] Moving state /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/breadcrumbs.2.state to previous /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/previous.breadcrumbs.2.state.
[Sentry] [debug] [SentryFileManager:50] No file to delete at /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/previous.breadcrumbs.2.state
[Sentry] [debug] [SentrySDK:230] Dispatching init work required to run on main thread.
[Sentry] [debug] [SentrySDK:232] SDK main thread init started...
[Sentry] [debug] [SentryFileManager:234] Ignoring non directory when deleting old envelopes at path: /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/async.log
[Sentry] [info] [SentryFileManager:292] Returning empty files list, as folder doesn't exist at path: (null)
[Sentry] [debug] [SentryReachability:137] SentryConnectivityCallback called with target: <SCNetworkReachability 0x106313520 [0x1e3a77680]> {name = sentry.io (complete, 35.186.247.156), flags = 0x00000002, if_index = 15}; flags: 2
[Sentry] [debug] [SentryReachability:102] Entered synchronized region of SentryConnectivityCallback with flags: 2
[Sentry] [debug] [SentryReachability:118] Notifying observers...
[Sentry] [debug] [SentryReachability:120] Notifying <SentryHttpTransport: 0x600002a6e840>
[Sentry] [debug] [SentryHttpTransport:109] Internet connection is back.
[Sentry] [debug] [SentryHttpTransport:282] sendAllCachedEnvelopes start.
[Sentry] [debug] [SentryHttpTransport:305] No envelopes left to send.
[Sentry] [debug] [SentryReachability:124] Finished notifying observers.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentrySessionReplayIntegration because sessionReplaySettings is disabled.
[Sentry] [debug] [SentryFileManager:709] SentryFileManager.cachePath: /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches
[Sentry] [debug] [SentryFileManager:50] No file to delete at /Users/stefan/Library/Developer/CoreSimulator/Devices/CF1555A0-FB73-4DB3-8A2C-C8F46A26EB75/data/Containers/Data/Application/789A0575-C6F7-4FE3-8028-6AE8102B4562/Library/Caches/io.sentry/9161f10d96c231adda6fc95de91094fbf232cb42/events
[Sentry] [debug] [SentryCrashMonitor_NSException:126] Backing up original handler.
[Sentry] [debug] [SentryCrashMonitor_NSException:129] Setting new handler.
[Sentry] [info] [SentryCrash:310] Sending 0 crash reports
[Sentry] [debug] [SentryCrash:314] Process finished with completion: 1
[Sentry] [debug] [SentryCrashInstallationReporter:46] Sent 0 crash report(s)
[Sentry] [debug] [SentrySDK:479] Integration installed: SentryCrashIntegration
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryAppStartTrackingIntegration because isTracingEnabled is disabled.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryFramesTrackingIntegration because isTracingEnabled is disabled.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryPerformanceTrackingIntegration because isTracingEnabled is disabled.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryScreenshotIntegration because attachScreenshot is disabled.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryUIEventTrackingIntegration because enableUserInteractionTracing is disabled.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryViewHierarchyIntegration because attachViewHierarchy is disabled.
[Sentry] [debug] [SentryBaseIntegration:30] Not going to enable SentryWatchdogTerminationTrackingIntegration because enableWatchdogTerminationTracking is disabled.
[Sentry] [debug] [SentryFramesTracker:124] Resetting profiling GPU timeseries data.
[Sentry] [debug] [SentryFramesTracker:88] Initialized frame tracker <SentryFramesTracker: 0x600002c7fe00>
[Sentry] [debug] [SentrySDK:479] Integration installed: SentryANRTrackingIntegration

This is happening for both Android and iOS. I initialise Sentry from a shared Application class that gets called from FinishedLaunching on iOS and from the Application's OnCreate on Android.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status
    Done
    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions