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

POTEL 69 - Hold a strong reference to OpenTelemetry span if created via Sentry API #3997

Merged
merged 25 commits into from
Dec 20, 2024

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Dec 17, 2024

📜 Description

Hold a strong reference to OpenTelemetry span if created via Sentry API.

We now use OtelStrongRefSpanWrapper and hand it back to users creating a transaction via Sentry.startTransaction or start a child span. This holds a strong reference to the underlying OpenTelemetry span, keeping it form being garbage collected.

💡 Motivation and Context

Fixes #3993

💚 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

Copy link
Contributor

github-actions bot commented Dec 17, 2024

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

Generated by 🚫 dangerJS against 889b1d8

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 394.89 ms 484.61 ms 89.72 ms
Size 1.65 MiB 2.31 MiB 677.12 KiB

Previous results on branch: feat/otel-span-strongref

Startup times

Revision Plain With Sentry Diff
b387fed 417.02 ms 519.06 ms 102.04 ms
33c9aac 393.47 ms 407.26 ms 13.79 ms
c658b5a 410.55 ms 461.18 ms 50.63 ms
2aabf9e 417.48 ms 530.78 ms 113.30 ms

App size

Revision Plain With Sentry Diff
b387fed 1.65 MiB 2.31 MiB 677.07 KiB
33c9aac 1.65 MiB 2.31 MiB 677.05 KiB
c658b5a 1.65 MiB 2.31 MiB 677.05 KiB
2aabf9e 1.65 MiB 2.31 MiB 677.05 KiB

…ava/io/sentry/opentelemetry/OtelStrongRefSpanWrapper.java

Co-authored-by: Lukas Bloder <[email protected]>
Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Base automatically changed from feat/otel-mode-off to 8.x.x December 20, 2024 10:47
@adinauer adinauer merged commit d91b2d7 into 8.x.x Dec 20, 2024
29 of 30 checks passed
@adinauer adinauer deleted the feat/otel-span-strongref branch December 20, 2024 10:49
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