Skip to content

Conversation

@adinauer
Copy link
Member

#skip-changelog

📜 Description

Add ScopesUtil.printScopesChain for debugging what the chain of Scopes looks like by traversing the parent and printing Scopes and Scope object IDs as well as creator string.

Looks like this:

==========================================
=============== v Scopes v ===============
==========================================
io.sentry.Scopes@4a8d50aa {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@75d0c553 , c=io.sentry.Scope@77699062 } [contextwrapper.scopeincontext]
io.sentry.Scopes@6711e5b2 {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@75d0c553 , c=io.sentry.Scope@47b9e1fa } [contextwrapper.spanancestor]
io.sentry.Scopes@34b05e03 {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@75d0c553 , c=io.sentry.Scope@f613277  } [spanprocessor.rootspan]
io.sentry.Scopes@67b57a5c {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@2edea3d9 , c=io.sentry.Scope@6f0be161 } [contextwrapper.scopeincontext]
io.sentry.Scopes@4dee10c8 {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@2edea3d9 , c=io.sentry.Scope@38f31f95 } [contextwrapper.scopeincontext]
io.sentry.Scopes@5a62013  {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@2edea3d9 , c=io.sentry.Scope@2e9822e  } [SentrySpringFilter]
io.sentry.Scopes@597229c1 {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@79dd9acd , c=io.sentry.Scope@4d4f9b5d } [contextwrapper.scopeincontext]
io.sentry.Scopes@3f98828  {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@79dd9acd , c=io.sentry.Scope@4b0d85b7 } [contextwrapper.spanscope]
io.sentry.Scopes@5e1375e9 {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@79dd9acd , c=io.sentry.Scope@6f379805 } [spanprocessor.new]
io.sentry.Scopes@20c0f503 {g=io.sentry.Scope@58dbf263 , i=io.sentry.Scope@7c7fc91  , c=io.sentry.Scope@42be6dbd } [Sentry.init]
-
==========================================
=============== ^ Scopes ^ ===============
==========================================

💡 Motivation and Context

Helps us investigate things like scope forking (or lack thereof) and scope bleeding.
We can use this to ask customers to attach this to GH issues for quicker support and also for making sure we're reproducing what's actually happening.

💚 How did you test it?

📝 Checklist

  • 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.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented May 23, 2025

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

Generated by 🚫 dangerJS against 17d6e2a

Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@github-actions
Copy link
Contributor

github-actions bot commented May 23, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 456.45 ms 501.96 ms 45.51 ms
Size 1.58 MiB 2.08 MiB 510.85 KiB

Previous results on branch: feat/scopes-chain-debug-util

Startup times

Revision Plain With Sentry Diff
32fcf79 395.72 ms 406.55 ms 10.83 ms

App size

Revision Plain With Sentry Diff
32fcf79 1.58 MiB 2.08 MiB 510.86 KiB

@adinauer adinauer merged commit 00439e7 into main May 23, 2025
34 checks passed
@adinauer adinauer deleted the feat/scopes-chain-debug-util branch May 23, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants