Skip to content

Commit 5a1591a

Browse files
feat(apple): Explain UIViewController scope logic
Explain how the SDK decides on the parent-child relationship for UIViewController transactions and which UIViewController transactions to put on the scope.
1 parent 2a6e743 commit 5a1591a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/platforms/apple/common/tracing/instrumentation/automatic-instrumentation.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The SDK creates spans to provide insight into the time consumed by each of the m
2929

3030
![`UIViewController` Transaction](./img/ui-view-controller-transaction.png)
3131

32+
For nested UIViewControllers, the SDK creates a parent-child relationship in the transaction based on which UIViewController your app loads first. The SDK starts a new UIViewController transaction and binds it to the scope when there is no active transaction on the scope yet, except for [user interaction](#user-interaction-tracing) transactions, which the SDK finishes and removes from the scope when starting a new UIViewController transaction. As long as the UIViewController transaction is on the scope, the SDK starts new UIViewController spans as child spans of the UIViewController on the scope so that you can see all UIViewControllers of a screen in one transaction. When the SDK wants to start a new UIViewController transaction, and there is already a transaction bound to the scope, which can be the case if you do that manually, the SDK doesn't bind the transaction to the scope. So, the UIViewController transaction will function normally, but it will miss other auto-generated performance spans, such as HTTP, file IO, or core data spans because the SDK adds these to the transaction bound to the scope.
33+
3234
To disable the `UIViewController` Tracing:
3335

3436

0 commit comments

Comments
 (0)