Skip to content

fix(spring): Support Spring Boot 4.1#5573

Merged
adinauer merged 9 commits into
mainfrom
fix/spring-boot-4-1-otel
Jul 9, 2026
Merged

fix(spring): Support Spring Boot 4.1#5573
adinauer merged 9 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.48.0 (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 318.25 ms 370.96 ms 52.71 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

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

@adinauer adinauer marked this pull request as ready for review June 22, 2026 09:18
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
Comment thread sentry-samples/sentry-samples-spring-7/build.gradle.kts Outdated

@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>
@adinauer adinauer mentioned this pull request Jul 6, 2026
8 tasks
adinauer and others added 3 commits July 9, 2026 11:03
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>
@adinauer adinauer force-pushed the fix/spring-boot-4-1-otel branch from 20c8935 to 67cafbc Compare July 9, 2026 12:13
@adinauer adinauer enabled auto-merge (squash) July 9, 2026 13:56
@adinauer adinauer merged commit a979f23 into main Jul 9, 2026
68 of 71 checks passed
@adinauer adinauer deleted the fix/spring-boot-4-1-otel branch July 9, 2026 14:16
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