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

Missing UI Load Spans for View Controllers in Framework Bundles

Open serglom21 opened this issue 5 months ago • 2 comments

Platform

iOS

Environment

Develop, Production

Installed

Carthage

Version

8.53.2

Xcode Version

16.4

Did it work on previous versions?

No response

Steps to Reproduce

  1. Clone this repo https://github.com/serglom21/sentry-ios-bundle-execution
  2. Run the app on a simulator
  3. Check Sentry for ui.load spans

Expected Result

UI load spans should be generated for all view controllers regardless of whether they are in the main app bundle or framework bundles

Actual Result

UI load spans are missing for view controllers in framework bundles, making it difficult to track performance metrics for modularized applications or apps using third-party UI frameworks.

Are you willing to submit a PR?

No response

serglom21 avatar Sep 26 '25 13:09 serglom21

The SentryUIViewControllerSwizzling only swizzles the UIViewControllers being in-app by design, because otherwise the SDK would instrument plenty of UIViewControllers that are just noise for users.

https://github.com/getsentry/sentry-cocoa/blob/7d88965b68a8e0439450ba54ab41844a8ba5bc10/Sources/Sentry/SentryUIViewControllerSwizzling.m#L76-L90

You can change this via the inAppIncludes option https://docs.sentry.io/platforms/apple/guides/ios/configuration/options/#in-app-include

I just noticed that we don't mention this anywhere here https://docs.sentry.io/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#uiviewcontroller-tracing so we should update the docs.

philipphofmann avatar Sep 29 '25 09:09 philipphofmann