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

Merged
merged 5 commits into from
Feb 6, 2025

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

💚 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

Sorry, something went wrong.

…s, not only for appStart ones
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 b26179a

@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 387.53 ms 425.02 ms 37.49 ms
Size 1.58 MiB 2.21 MiB 639.85 KiB

Previous results on branch: feat/all-activity-span

Startup times

Revision Plain With Sentry Diff
2e03643 417.61 ms 438.40 ms 20.78 ms
af4d17d 438.21 ms 454.28 ms 16.07 ms

App size

Revision Plain With Sentry Diff
2e03643 1.58 MiB 2.21 MiB 639.86 KiB
af4d17d 1.70 MiB 2.36 MiB 672.76 KiB

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@romtsn romtsn requested a review from lcian as a code owner February 6, 2025 00:35
@romtsn
Copy link
Member

romtsn commented Feb 6, 2025

removed "closes" because that issue was about adding onResume spans which this PR does not

Verified

This commit was signed with the committer’s verified signature.
romtsn Roman Zavarnitsyn

Verified

This commit was signed with the committer’s verified signature.
romtsn Roman Zavarnitsyn
@romtsn romtsn enabled auto-merge (squash) February 6, 2025 09:37
@romtsn romtsn merged commit 91474b9 into main Feb 6, 2025
34 checks passed
@romtsn romtsn deleted the feat/all-activity-span branch February 6, 2025 09:39
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.

None yet

2 participants