Skip to content

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

@github-actions
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

@github-actions
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
@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.

3 participants