sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Track non inApp UIViewControllers of dynamic frameworks

Open qinyue opened this issue 3 years ago • 2 comments

Platform

iOS

Installed

CocoaPods

Version

7.15.0

Steps to Reproduce

  • Create a pod named 'TestUIPod' without static_framework
  • Define some UIViewController in 'TestUIPod'.
  • Use Sentry: pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '7.15.0'
  • use TestUIPod: pod 'TestUIPod'
  • Config SentryOptions options.tracesSampleRate = 1.0; options.attachStacktrace = true; options.sampleRate = 1.0; options.enableAutoSessionTracking = true; options.enableUIViewControllerTracking = true; options.enableNetworkBreadcrumbs = false; options.enableAutoPerformanceTracking = true; options.enableSwizzling = true;

Expected Result

I expect to get transaction for any UIViewController in pods which are not static_framework.

Actual Result

I have not get any transaction for UIViewControllers in pods which are not static_framework.

qinyue avatar May 24 '22 00:05 qinyue

Thanks for reporting this issue, @qinyue. We are aware of this limitation; see https://docs.sentry.io/platforms/apple/guides/ios/performance/instrumentation/automatic-instrumentation/#uiviewcontroller-instrumentation. The reason for this is that checking for all subclasses of UIViewController can be a bit expensive and therefore we only check inApp UIViewControllers. If you use static frameworks we anyways search all UIViewControllers. Maybe we can revisit our strategy and make it work for dynamically loaded libraries.

philipphofmann avatar May 24 '22 12:05 philipphofmann

We could swizzle classes in binary images matching SentryOptions.inAppIncludes. We could also come up with an API to pass in all the UIViewController names.

philipphofmann avatar Jun 01 '22 13:06 philipphofmann