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 29 - Partially fix bootstrap class loading #3543

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Jul 3, 2024

📜 Description

Partially fix bootstrap class loading by actually loading sentry-opentelemetry-bootstrap into the bootstrap classloader which wasn't the case before as it was loaded into the agent class loader by accident (implementation dependency in sentry-opentelemetry-agentcustomization which was supposed to be compileOnly).

We now added a sentry-opentelemetry-extra module which should ideally be loaded into bootstrap classloader but isn't for now since loading the classes into bootstrap classloader would cause ClassNotFoundException for OpenTelemetry classes like ReadWriteSpan which aren't available in bootstrap classloader.

Since we haven't found a way to fix the ClassNotFoundException so far, we're continuing to load the extra classes into the agent classloader.

💡 Motivation and Context

Without this Context manipulation is incorrect as there are multiple Sentry Scopes entries due to the key being loaded into separate class loaders and Context ending up with one entry per classloader used.

This also means access to Context returns a different scope depending on what classloader is used when retrieving via key.

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • 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.
  • 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 Jul 3, 2024

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

Generated by 🚫 dangerJS against b127605

Copy link
Contributor

github-actions bot commented Jul 3, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 404.70 ms 509.24 ms 104.54 ms
Size 1.70 MiB 2.29 MiB 599.77 KiB

Baseline results on branch: 8.x.x

Startup times

Revision Plain With Sentry Diff
a59fca2 560.08 ms 658.80 ms 98.71 ms

App size

Revision Plain With Sentry Diff
a59fca2 1.70 MiB 2.29 MiB 599.77 KiB

Previous results on branch: feat/potel-29-partially-fix-bootstrap-class-loading

Startup times

Revision Plain With Sentry Diff
e954223 387.30 ms 499.46 ms 112.16 ms

App size

Revision Plain With Sentry Diff
e954223 1.70 MiB 2.29 MiB 599.77 KiB

Copy link
Member

@stefanosiano stefanosiano left a comment

Choose a reason for hiding this comment

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

lgtm!

@adinauer adinauer merged commit afff380 into 8.x.x Jul 3, 2024
22 checks passed
@adinauer adinauer deleted the feat/potel-29-partially-fix-bootstrap-class-loading branch July 3, 2024 12:19
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.

2 participants