feat(samples): [Queue Instrumentation 15] Add opt-in Kafka console e2e coverage#5289
Draft
adinauer wants to merge 9 commits intofeat/queue-instrumentation-kafka-modulefrom
Draft
Conversation
Allow kafka-clients to instantiate SentryKafkaProducerInterceptor via interceptor.classes by adding a no-arg constructor that uses ScopesAdapter. This makes native Kafka interceptor wiring work out of the box in applications and samples.\n\nAlso add a Kafka tracing example to the console sample with a transaction-scoped producer send, and cover no-arg constructor behavior in sentry-kafka tests. Co-Authored-By: Claude <noreply@anthropic.com>
Show end-to-end Kafka queue tracing in the console sample by running a background consumer thread, producing a message, and waiting for consume before exit.\n\nAdd a no-arg constructor to SentryKafkaConsumerInterceptor so kafka-clients can instantiate it from interceptor.classes, and add test coverage for that constructor. Co-Authored-By: Claude <noreply@anthropic.com>
Move Kafka producer/consumer showcase logic out of Main into KafkaShowcase to make the sample easier to read and follow. Keep runtime behavior unchanged by preserving the same demo entry point and flow. Co-Authored-By: Claude <noreply@anthropic.com>
Gate the console Kafka showcase behind SENTRY_SAMPLE_KAFKA_BOOTSTRAP_SERVERS so Kafka behavior is enabled only when configured. Keep the showcase isolated in KafkaShowcase and use fail-fast Kafka client timeouts for local runs.\n\nExtend console system tests to assert producer and consumer queue tracing when Kafka is enabled. Update system-test-runner to provision or reuse a local Kafka broker for the console module and clean up runner-managed resources. Co-Authored-By: Claude <noreply@anthropic.com>
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 13, 2026
Sentry Build Distribution
|
Move KafkaShowcase under io.sentry.samples.console.kafka and update Main to import the relocated class. This keeps Kafka-specific sample code grouped in a dedicated package without changing runtime behavior. Co-Authored-By: Claude <noreply@anthropic.com>
extract constant
extract methods
refactor
Contributor
Performance metrics 🚀
|
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 console-sample Kafka coverage for queue instrumentation and make the sample’s Kafka flow opt-in so existing system tests stay stable when Kafka is not available.
This PR includes:
KafkaShowcaseflow in the console sampleSENTRY_SAMPLE_KAFKA_BOOTSTRAP_SERVERSis set💡 Motivation and Context
After extracting
sentry-kafkainto a standalone module, we need end-to-end coverage outside Spring to validate queue span creation and trace propagation for plainkafka-clientsusage.💚 How did you test it?
./gradlew spotlessApply apiDumpsentry-kafkafor producer and consumer interceptors📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog