Skip to content

fix(spring): Support Spring Boot 4.1#5573

Open
adinauer wants to merge 5 commits into
mainfrom
fix/spring-boot-4-1-otel
Open

fix(spring): Support Spring Boot 4.1#5573
adinauer wants to merge 5 commits into
mainfrom
fix/spring-boot-4-1-otel

Conversation

@adinauer

@adinauer adinauer commented Jun 22, 2026

Copy link
Copy Markdown
Member

📜 Description

Bump Spring Boot 4 to 4.1.0 and update the related OpenTelemetry dependency set to compatible releases:

  • OpenTelemetry SDK to 1.63.0
  • OpenTelemetry instrumentation to 2.29.0
  • OpenTelemetry semantic conventions to 1.42.0
  • Spotless to 8.6.0

Also keep the Spring 7 sample on the repository Kotlin compiler version when importing the Spring Boot BOM, and add Spring Boot 4.1.0 to the Spring Boot 4.x system-test matrix.

💡 Motivation and Context

Spring Boot 4.1.0 pulls newer OpenTelemetry dependencies than the previous Spring Boot 4 sample setup expected. This caused the Spring Boot 4 OpenTelemetry sample to fail at runtime with incompatible OpenTelemetry versions.

Fixes #5561

💚 How did you test it?

  • ./gradlew :sentry-samples:sentry-samples-spring-7:compileTestKotlin --rerun-tasks --no-daemon
  • ./gradlew spotlessApply apiDump --no-daemon
  • Built Spring Boot 4 sample artifacts and the Sentry OpenTelemetry agent
  • Ran Spring Boot 4 system tests for:
    • sentry-samples-spring-boot-4
    • sentry-samples-spring-boot-4-webflux
    • sentry-samples-spring-boot-4-opentelemetry with agent auto-init enabled
    • sentry-samples-spring-boot-4-opentelemetry with agent auto-init disabled; first run had a transient Kafka endpoint timeout, exact rerun passed
    • sentry-samples-spring-boot-4-opentelemetry-noagent
    • sentry-samples-spring-boot-4-otlp

📝 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

adinauer and others added 2 commits June 22, 2026 10:56
Bump OpenTelemetry and Spring Boot dependencies to compatible versions so the Spring Boot 4 OpenTelemetry sample works with Spring Boot 4.1.

Keep the Spring 7 sample on the repository Kotlin compiler version when importing the Spring Boot BOM, and add Spring Boot 4.1 to the system test matrix.

Fixes GH-5561

Co-Authored-By: Claude <noreply@anthropic.com>
@sentry

sentry Bot commented Jun 22, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.44.1 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 321.22 ms 380.52 ms 59.30 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
18c0bc2 306.73 ms 349.77 ms 43.03 ms
0eaac1e 316.82 ms 357.34 ms 40.52 ms
d15471f 303.49 ms 439.08 ms 135.59 ms
fc5ccaf 276.52 ms 370.46 ms 93.93 ms
e2dce0b 308.96 ms 360.10 ms 51.14 ms
5b1a06b 352.27 ms 413.70 ms 61.43 ms
37ec571 366.04 ms 424.28 ms 58.23 ms
9fbb112 361.43 ms 427.57 ms 66.14 ms
bbc35bb 324.88 ms 425.73 ms 100.85 ms
ff8eea4 313.42 ms 337.08 ms 23.66 ms

App size

Revision Plain With Sentry Diff
18c0bc2 1.58 MiB 2.13 MiB 557.33 KiB
0eaac1e 1.58 MiB 2.19 MiB 619.17 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
fc5ccaf 1.58 MiB 2.13 MiB 557.54 KiB
e2dce0b 0 B 0 B 0 B
5b1a06b 0 B 0 B 0 B
37ec571 0 B 0 B 0 B
9fbb112 1.58 MiB 2.11 MiB 539.18 KiB
bbc35bb 1.58 MiB 2.12 MiB 553.01 KiB
ff8eea4 1.58 MiB 2.28 MiB 718.64 KiB

Previous results on branch: fix/spring-boot-4-1-otel

Startup times

Revision Plain With Sentry Diff
f53a028 313.09 ms 367.86 ms 54.77 ms
5d6cfb6 292.31 ms 355.35 ms 63.04 ms

App size

Revision Plain With Sentry Diff
f53a028 0 B 0 B 0 B
5d6cfb6 0 B 0 B 0 B

@adinauer adinauer marked this pull request as ready for review June 22, 2026 09:18
Comment thread CHANGELOG.md

### Dependencies

- Bump Spring Boot 4 and OpenTelemetry dependencies ([#5573](https://github.com/getsentry/sentry-java/pull/5573))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • 🚫 The changelog entry seems to be part of an already released section ## 8.44.1.
    Consider moving the entry to the ## Unreleased section, please.

Comment thread .github/workflows/spring-boot-4-matrix.yml

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just some nits

Comment thread gradle/libs.versions.toml
sqliteAlpha = "2.7.0-alpha06" # Required by Room3 3.0.0-alpha*
slf4j = "1.7.30"
spotless = "8.4.0"
spotless = "8.6.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use 8.7.0?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gonna bump this in a separate PR since it also causes a ton of reformatting that'd make this PR harder to read.


repositories { mavenCentral() }

extra["kotlin.version"] = KotlinCompilerVersion.VERSION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what does this do/who consumes this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Note sure, can we just globally bump the kotlin version instead @runningcode ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I won't be against bumping a kotlin version. I just don't know what this line of code does or how it is consumed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should be spring boot plugin that consumes it, let me check.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, that's what's happening, we're telling Spring Boot dependency management plugin to use our kotlin version instead of what Spring Boot BOM says.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh interesting. i didn't know that's how the versions are read from spring boot dependency management. sounds good then! might be worth a comment.

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! thanks for adding

adinauer and others added 2 commits June 22, 2026 12:52
Align the global Kotlin version with Spring Boot 4.1 and remove the now-unneeded Spring 7 BOM override.

Also remove unused Spring 7-specific Kotlin aliases from the version catalog.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

sentry-opentelemetry-agentless-spring fails with Spring Boot 4.1 / OpenTelemetry SDK 1.62

2 participants