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
Draft
Conversation
…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.
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Contributor
|
This was referenced Apr 7, 2026
Sentry Build Distribution
|
Contributor
Performance metrics 🚀
|
| 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 |
414b118 to
10a5c63
Compare
8 tasks
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.
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 topicKafkaConsumer—@KafkaListenerthat receives and logs messagesapplication-kafka.properties— Kafka configuration activated via--spring.profiles.active=kafkaThis 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=kafkaagainst a local Kafka broker and verified messages are produced and consumed with queue spans visible in Sentry.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog