Skip to content

feat(samples): [Queue Instrumentation 7] Add Kafka to Spring Boot 3 OTel sample apps#5265

Draft
adinauer wants to merge 1 commit intofeat/queue-instrumentation-e2efrom
feat/queue-instrumentation-otel-samples
Draft

feat(samples): [Queue Instrumentation 7] Add Kafka to Spring Boot 3 OTel sample apps#5265
adinauer wants to merge 1 commit intofeat/queue-instrumentation-e2efrom
feat/queue-instrumentation-otel-samples

Conversation

@adinauer
Copy link
Copy Markdown
Member

@adinauer adinauer commented Apr 7, 2026

PR Stack (Queue Instrumentation)


📜 Description

Add Kafka queue tracing support to both OpenTelemetry Spring Boot 3 sample applications:

  • sentry-samples-spring-boot-jakarta-opentelemetry (OTel Java agent)
  • sentry-samples-spring-boot-jakarta-opentelemetry-noagent (agentless / Sentry OTel Spring)

Each sample gets:

  • KafkaController — REST endpoint (/kafka/produce) that sends messages to a Kafka topic
  • KafkaConsumer@KafkaListener that receives and logs messages
  • application-kafka.properties — Kafka configuration activated via --spring.profiles.active=kafka
  • Kafka auto-configuration excluded by default to avoid startup errors when no broker is available

This mirrors the existing Kafka sample support added to the non-OTel Spring Boot 3 sample in an earlier stack PR.

💡 Motivation and Context

The queue instrumentation stack adds Kafka tracing to the Spring Boot 3 integration. The OTel sample apps need the same Kafka producer/consumer setup so that queue tracing can be verified end-to-end in the OpenTelemetry context (both agent and agentless modes).

💚 How did you test it?

Ran both sample apps locally with --spring.profiles.active=kafka against a local Kafka broker and verified messages are produced and consumed with queue spans visible in Sentry.

📝 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

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

#skip-changelog

…sample apps

Add Kafka queue tracing support to both the OTel agent and agentless
Spring Boot 3 sample applications. Each sample gets a KafkaController
for producing messages and a KafkaConsumer listener, activated via the
'kafka' Spring profile. Kafka auto-configuration is excluded by default
and only enabled when the kafka profile is active.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

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

Generated by 🚫 dangerJS against 10a5c63

@sentry
Copy link
Copy Markdown

sentry bot commented Apr 7, 2026

Sentry Build Distribution

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 299.07 ms 325.31 ms 26.24 ms
Size 0 B 0 B 0 B

Baseline results on branch: feat/queue-instrumentation-e2e

Startup times

Revision Plain With Sentry Diff
7e898af 367.28 ms 426.94 ms 59.66 ms
766d2f5 356.70 ms 418.39 ms 61.69 ms
1527260 312.65 ms 367.12 ms 54.47 ms

App size

Revision Plain With Sentry Diff
7e898af 0 B 0 B 0 B
766d2f5 0 B 0 B 0 B
1527260 0 B 0 B 0 B

Previous results on branch: feat/queue-instrumentation-otel-samples

Startup times

Revision Plain With Sentry Diff
a2180d6 359.90 ms 423.92 ms 64.02 ms
b1d1e92 316.78 ms 368.92 ms 52.14 ms

App size

Revision Plain With Sentry Diff
a2180d6 0 B 0 B 0 B
b1d1e92 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