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 c02c3dd

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 339.65 ms 357.82 ms 18.17 ms
Size 1.58 MiB 2.12 MiB 549.52 KiB

Baseline results on branch: main

Startup times

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

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

Startup times

Revision Plain With Sentry Diff
c4729d6 315.52 ms 362.84 ms 47.32 ms
b59fc8e 399.24 ms 444.62 ms 45.38 ms

App size

Revision Plain With Sentry Diff
c4729d6 1.58 MiB 2.12 MiB 548.31 KiB
b59fc8e 1.58 MiB 2.11 MiB 539.90 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