-
-
Notifications
You must be signed in to change notification settings - Fork 459
Fix profiling init for Spring and Spring Boot w Agent auto-init #4815
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
base: main
Are you sure you want to change the base?
Conversation
…options, add configuration class to load the profiler and converter after spring boot starts in agent mode
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Fixes
- Fix profiling init for Spring and Spring Boot w Agent auto-init ([#4815](https://github.com/getsentry/sentry-java/pull/4815)) If none of the above apply, you can opt out of this check by adding |
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
@ConditionalOnClass(name = {"io.sentry.opentelemetry.agent.AgentMarker"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it conditional on the async profiler class too
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d364ace | 384.53 ms | 453.51 ms | 68.98 ms |
ee747ae | 358.21 ms | 389.41 ms | 31.20 ms |
1df7eb6 | 397.04 ms | 429.64 ms | 32.60 ms |
ee747ae | 386.94 ms | 431.43 ms | 44.49 ms |
f634d01 | 359.58 ms | 433.88 ms | 74.30 ms |
889ecea | 367.58 ms | 437.52 ms | 69.94 ms |
b750b96 | 421.25 ms | 444.09 ms | 22.84 ms |
b3d8889 | 371.33 ms | 426.24 ms | 54.92 ms |
ee747ae | 357.79 ms | 421.84 ms | 64.05 ms |
f634d01 | 375.06 ms | 420.04 ms | 44.98 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d364ace | 1.58 MiB | 2.11 MiB | 539.75 KiB |
ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
1df7eb6 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
f634d01 | 1.58 MiB | 2.10 MiB | 533.40 KiB |
889ecea | 1.58 MiB | 2.11 MiB | 539.75 KiB |
b750b96 | 1.58 MiB | 2.10 MiB | 533.20 KiB |
b3d8889 | 1.58 MiB | 2.10 MiB | 535.07 KiB |
ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
f634d01 | 1.58 MiB | 2.10 MiB | 533.40 KiB |
|
||
@Bean | ||
@ConditionalOnMissingBean(name = "sentryOpenTelemetryProfilerConfiguration") | ||
public IContinuousProfiler sentryOpenTelemetryProfilerConfiguration() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract init into util to streamline initialization code
|
||
@Bean | ||
@ConditionalOnMissingBean(name = "sentryOpenTelemetryProfilerConverterConfiguration") | ||
public IProfileConverter sentryOpenTelemetryProfilerConverterConfiguration() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract init into util to streamline initialization code
…options, add configuration class to load the profiler and converter after spring boot starts in agent mode
📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps