fix(spring): Support Spring Boot 4.1#5573
Merged
Merged
Conversation
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>
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bbc35bb | 324.88 ms | 425.73 ms | 100.85 ms |
| abfcc92 | 304.04 ms | 370.33 ms | 66.29 ms |
| 94bff8d | 313.23 ms | 352.77 ms | 39.54 ms |
| fcec2f2 | 311.35 ms | 384.94 ms | 73.59 ms |
| d15471f | 304.55 ms | 408.43 ms | 103.87 ms |
| 4c04bb8 | 307.93 ms | 362.34 ms | 54.41 ms |
| b936425 | 302.69 ms | 372.86 ms | 70.17 ms |
| d501a7e | 314.55 ms | 343.34 ms | 28.79 ms |
| 72020f8 | 312.32 ms | 370.94 ms | 58.62 ms |
| 6b019b7 | 319.84 ms | 333.15 ms | 13.31 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bbc35bb | 1.58 MiB | 2.12 MiB | 553.01 KiB |
| abfcc92 | 1.58 MiB | 2.13 MiB | 557.31 KiB |
| 94bff8d | 1.58 MiB | 2.20 MiB | 635.37 KiB |
| fcec2f2 | 1.58 MiB | 2.12 MiB | 551.51 KiB |
| d15471f | 1.58 MiB | 2.13 MiB | 559.54 KiB |
| 4c04bb8 | 0 B | 0 B | 0 B |
| b936425 | 0 B | 0 B | 0 B |
| d501a7e | 0 B | 0 B | 0 B |
| 72020f8 | 1.58 MiB | 2.19 MiB | 620.21 KiB |
| 6b019b7 | 0 B | 0 B | 0 B |
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 |
| 780334d | 355.31 ms | 418.94 ms | 63.63 ms |
| 5d6cfb6 | 292.31 ms | 355.35 ms | 63.04 ms |
| 1a6663e | 321.22 ms | 380.52 ms | 59.30 ms |
| a474846 | 316.17 ms | 359.10 ms | 42.94 ms |
| e85e1b2 | 334.00 ms | 404.33 ms | 70.33 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f53a028 | 0 B | 0 B | 0 B |
| 780334d | 0 B | 0 B | 0 B |
| 5d6cfb6 | 0 B | 0 B | 0 B |
| 1a6663e | 0 B | 0 B | 0 B |
| a474846 | 0 B | 0 B | 0 B |
| e85e1b2 | 0 B | 0 B | 0 B |
runningcode
reviewed
Jun 22, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
LGTM, just some nits
runningcode
approved these changes
Jun 22, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
LGTM! thanks for adding
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>
…ix/spring-boot-4-1-otel
Move the Spring Boot 4 / OpenTelemetry dependency bump entry from 8.44.1 to the Unreleased section and add sub-list items showing each dependency version change. Co-Authored-By: Claude <noreply@anthropic.com>
The Spring 7 sample had two dependency issues causing compileTestKotlin to fail in the Spring Boot 4.x CI matrix: 1. Used libs.springboot.starter.test (Spring Boot 2.7.18) instead of libs.springboot4.starter.test, mixing Spring Framework 5.x test utilities with a Spring Framework 7.x runtime. 2. Missing Kotlin BOM import in dependencyManagement. Without it, Spring Boot 4.0.0's BOM downgraded kotlin-stdlib to 2.2.21 while the compiler and build tools remained at 2.3.21, causing ClasspathEntrySnapshotTransform initialization failures. Co-Authored-By: Claude <noreply@anthropic.com>
20c8935 to
67cafbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Bump Spring Boot 4 to 4.1.0 and update the related OpenTelemetry dependency set to compatible releases:
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-daemonsentry-samples-spring-boot-4sentry-samples-spring-boot-4-webfluxsentry-samples-spring-boot-4-opentelemetrywith agent auto-init enabledsentry-samples-spring-boot-4-opentelemetrywith agent auto-init disabled; first run had a transient Kafka endpoint timeout, exact rerun passedsentry-samples-spring-boot-4-opentelemetry-noagentsentry-samples-spring-boot-4-otlp📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps