Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track non inApp UIViewControllers of dynamic frameworks #1848

Open
qinyue opened this issue May 24, 2022 · 2 comments
Open

Track non inApp UIViewControllers of dynamic frameworks #1848

qinyue opened this issue May 24, 2022 · 2 comments

Comments

@qinyue
Copy link

qinyue commented May 24, 2022

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 qinyue changed the title SentryPerformanceTrackingIntegration can't tracking UIViewController in frameworks which have been loaded SentryPerformanceTrackingIntegration can't tracking UIViewController in frameworks which have not been loaded May 24, 2022
@bruno-garcia bruno-garcia moved this to Needs Discussion in Mobile & Cross Platform SDK May 24, 2022
@philipphofmann
Copy link
Member

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 philipphofmann changed the title SentryPerformanceTrackingIntegration can't tracking UIViewController in frameworks which have not been loaded Track non inApp UIViewControllers of dynamic frameworks May 24, 2022
@philipphofmann
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants