getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
803 stars 316 forks source link

Track non inApp UIViewControllers of dynamic frameworks #1848

Open qinyue opened 2 years ago

qinyue commented 2 years ago

Platform

iOS

Installed

CocoaPods

Version

7.15.0

Steps to Reproduce

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.

philipphofmann commented 2 years ago

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 commented 2 years ago

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.