Skip to content

feat(compose): Introduce LocalSentrySpan - #6112

Open
0xadam-brown wants to merge 1 commit into
mainfrom
feat/local-sentry-span
Open

0xadam-brown wants to merge 1 commit into
mainfrom
feat/local-sentry-span

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Sep 14, 2026

Copy link
Copy Markdown
Member

📜 Description

Defines a LocalSentrySpan that lets Sentry and host apps deliver ISpan instances throughout composable subtrees. The delivered span can then be used to parent any spans the receiving subtree produces.

I've also introduced an internal UnsetSentrySpan + bootstrapping system that lets existing Sentry composable infrastructure provide its own ISpan in situations where the environment doesn't set a LocalSentrySpan.

SentryTraced has been updated to use both LocalSentrySpan and the bootstrapping system.

💡 Motivation and Context

Frees child composables from having to care about the ISpan hierarchies constructed by their ancestors, which is an anti-pattern we'd rather discourage.

This PR is an alternative to the IScopes-based approach proposed in #5838.

💚 How did you test it?

Unit tests + manual testing via the relevant Android sample apps.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 5105821

@sentry

sentry Bot commented Sep 14, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.56.0 (1) release

⚙️ sentry-android Build Distribution Settings

@0xadam-brown 0xadam-brown added the deep-dive PR needs a thorough review of design, behavior, and edge cases label Sep 15, 2026
@0xadam-brown
0xadam-brown marked this pull request as ready for review September 15, 2026 06:19
Commit defines a LocalSentrySpan that lets Sentry and host apps deliver ISpan instances throughout composable subtrees. The delivered span can be used to parent any spans the receiving subtree produces, thereby freeing child composables from having to care about the ISpan hierarchies constructed by their ancestors.

Commit also contains an internal UnsetSentrySpan + bootstrapping system that lets existing Sentry composable infrastructure provide its own ISpan in situations where the environment doesn't set a LocalSentrySpan.

Commit updates SentryTraced to use both LocalSentrySpan and the bootstrapping system.

Co-authored-by: Tabish Ahmad <tabishahmad1@gmail.com>
@0xadam-brown

Copy link
Copy Markdown
Member Author

Updating the commit message; otherwise unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deep-dive PR needs a thorough review of design, behavior, and edge cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant