Skip to content

Conversation

@lbloder
Copy link
Collaborator

@lbloder lbloder commented Oct 20, 2025

…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

  • I added GH Issue ID & Linear ID
  • 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

…options, add configuration class to load the profiler and converter after spring boot starts in agent mode
@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

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 #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 5e75584

import org.springframework.context.annotation.Import;

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(name = {"io.sentry.opentelemetry.agent.AgentMarker"})
Copy link
Collaborator Author

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 406.73 ms 491.63 ms 84.90 ms
Size 1.58 MiB 2.12 MiB 549.51 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d364ace 382.77 ms 443.21 ms 60.44 ms
3998a95 415.94 ms 478.54 ms 62.60 ms
806307f 357.85 ms 424.64 ms 66.79 ms
ee747ae 357.79 ms 421.84 ms 64.05 ms
d217708 355.34 ms 381.39 ms 26.05 ms
ee747ae 396.82 ms 441.67 ms 44.86 ms
604a261 380.65 ms 451.27 ms 70.62 ms
3699cd5 423.60 ms 495.52 ms 71.92 ms
b3d8889 371.84 ms 447.49 ms 75.65 ms
d5a29b6 298.62 ms 391.78 ms 93.16 ms

App size

Revision Plain With Sentry Diff
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
806307f 1.58 MiB 2.10 MiB 533.42 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
604a261 1.58 MiB 2.10 MiB 533.42 KiB
3699cd5 1.58 MiB 2.10 MiB 533.45 KiB
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
d5a29b6 1.58 MiB 2.12 MiB 549.37 KiB

Previous results on branch: feat/profiling-w-spring-otel-agent

Startup times

Revision Plain With Sentry Diff
b59fc8e 399.24 ms 444.62 ms 45.38 ms
c4729d6 315.52 ms 362.84 ms 47.32 ms
d76029f 339.65 ms 357.82 ms 18.17 ms

App size

Revision Plain With Sentry Diff
b59fc8e 1.58 MiB 2.11 MiB 539.90 KiB
c4729d6 1.58 MiB 2.12 MiB 548.31 KiB
d76029f 1.58 MiB 2.12 MiB 549.52 KiB


@Bean
@ConditionalOnMissingBean(name = "sentryOpenTelemetryProfilerConfiguration")
public IContinuousProfiler sentryOpenTelemetryProfilerConfiguration() {
Copy link
Collaborator Author

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() {
Copy link
Collaborator Author

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

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.

1 participant