Skip to content

feat(spring): [Queue Instrumentation 41] Add Spring Boot 2 Kafka tracing#5352

Draft
adinauer wants to merge 3 commits intofeat/queue-instrumentation-spring-boot-4from
feat/queue-instrumentation-spring-boot-2
Draft

feat(spring): [Queue Instrumentation 41] Add Spring Boot 2 Kafka tracing#5352
adinauer wants to merge 3 commits intofeat/queue-instrumentation-spring-boot-4from
feat/queue-instrumentation-spring-boot-2

Conversation

@adinauer
Copy link
Copy Markdown
Member

@adinauer adinauer commented Apr 30, 2026

PR Stack (Queue Instrumentation)


📜 Description

Ports the Spring Boot 3 Kafka queue tracing stack changes to Spring Boot 2 as one PR.

This adds Spring Kafka support to the Spring 5 module, wires it into the Spring Boot 2 auto-configuration, and adds Boot 2 sample/system-test coverage for the regular, OTel agent, and OTel no-agent samples.

It also adds Cursor rules for queue tracing so future agent work has a high-level reference for how Sentry Queues data is produced by the Java SDK.

💡 Motivation and Context

The queue instrumentation stack added Kafka tracing for newer Spring Boot generations. Spring Boot 2 uses the Spring 5 module, so it needs the same Kafka producer/consumer bean post-processors and auto-configuration in the Boot 2 integration.

The new rules file documents when to load queue-specific guidance and summarizes the relationship between Sentry Queues, queue spans, Kafka instrumentation, and Spring Kafka auto-instrumentation.

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry-spring:test --tests '*Kafka*' :sentry-spring-boot:test --tests '*Kafka*'
  • ./gradlew :sentry-samples:sentry-samples-spring-boot:compileJava :sentry-samples:sentry-samples-spring-boot:compileTestKotlin :sentry-samples:sentry-samples-spring-boot-opentelemetry:compileJava :sentry-samples:sentry-samples-spring-boot-opentelemetry:compileTestKotlin :sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:compileJava :sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent:compileTestKotlin

📝 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

None.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

adinauer and others added 2 commits April 29, 2026 13:54
Port Kafka queue tracing to the Spring and Spring Boot 2 modules.

Add Spring Kafka bean post-processors, Boot 2 auto-configuration, and matching sample system-test coverage.

Co-Authored-By: Claude <noreply@anthropic.com>
Document when to load queue-specific Cursor rules and summarize how Sentry Queues data is produced by the Java SDK Kafka instrumentation.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against b850263

This was referenced Apr 30, 2026
@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 30, 2026

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@github-actions
Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 345.23 ms 421.67 ms 76.44 ms
Size 0 B 0 B 0 B

Baseline results on branch: feat/queue-instrumentation-spring-boot-4

Startup times

Revision Plain With Sentry Diff
1a9b19e 323.42 ms 368.73 ms 45.31 ms

App size

Revision Plain With Sentry Diff
1a9b19e 0 B 0 B 0 B

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