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

Create onCreate and onStart spans for all Activities #4025

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stefanosiano
Copy link
Member

@stefanosiano stefanosiano commented Jan 7, 2025

📜 Description

ActivityLifecycleIntegration creates activity spans for all Activities, not only for appStart ones.

💡 Motivation and Context

We are currently adding onCreate and onStart spans only in the app start transaction. This PR will add these spans to all automatic transactions, too
Closes #2542

💚 How did you test it?

Unit test

📝 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

Copy link
Contributor

github-actions bot commented Jan 7, 2025

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

Generated by 🚫 dangerJS against 4aecfa5

@stefanosiano
Copy link
Member Author

stefanosiano commented Jan 7, 2025

Just a note:
In the app start transaction the spans are children of app.start.cold or app.start.warm span
For other Activities the spans are direct children of the parent transaction.

Also, this works for automatic transactions only. If we want to instrument custom transactions, we can easily use Sentry.getSpan instead of the transaction reference.
Any though on this?

@stefanosiano stefanosiano changed the base branch from main to 8.x.x January 7, 2025 15:22
@stefanosiano stefanosiano changed the base branch from 8.x.x to main January 7, 2025 15:23
@stefanosiano stefanosiano marked this pull request as ready for review January 7, 2025 15:23
Copy link
Contributor

github-actions bot commented Jan 7, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 438.21 ms 454.28 ms 16.07 ms
Size 1.70 MiB 2.36 MiB 672.76 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
00c8eeb 415.32 ms 428.08 ms 12.76 ms

App size

Revision Plain With Sentry Diff
00c8eeb 1.70 MiB 2.36 MiB 671.98 KiB

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.

Auto-Instrument onResume in Activity transactions
1 participant