feat(spring-jakarta): [Queue Instrumentation 4] Add Kafka consumer instrumentation#5255
Draft
adinauer wants to merge 2 commits intofeat/queue-instrumentation-producerfrom
Draft
feat(spring-jakarta): [Queue Instrumentation 4] Add Kafka consumer instrumentation#5255adinauer wants to merge 2 commits intofeat/queue-instrumentation-producerfrom
adinauer wants to merge 2 commits intofeat/queue-instrumentation-producerfrom
Conversation
Add SentryKafkaRecordInterceptor that creates queue.process transactions for incoming Kafka records. Forks scopes per record, extracts sentry-trace and baggage headers for distributed tracing via continueTrace, and calculates messaging.message.receive.latency from the enqueued-time header. Composes with existing RecordInterceptor via delegation. Span lifecycle is managed through success/failure callbacks. Add SentryKafkaConsumerBeanPostProcessor to register the interceptor on ConcurrentKafkaListenerContainerFactory beans. 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. New Features ✨Spring Jakarta
Other
Internal Changes 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Sentry Build Distribution
|
This was referenced Apr 1, 2026
Merged
8 tasks
Contributor
Performance metrics 🚀
|
8 tasks
271fb8b to
1f00027
Compare
This was referenced Apr 2, 2026
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 consumer instrumentation to
sentry-spring-jakarta:SentryKafkaRecordInterceptor— implementsRecordInterceptorto createqueue.processtransactions for incoming Kafka records. Forks scopes per record for isolation (ISentryLifecycleTokenlifecycle). Extractssentry-traceandbaggageheaders for distributed tracing viacontinueTrace, and calculatesmessaging.message.receive.latencyfrom the enqueued-time header. Composes with existingRecordInterceptorvia delegation. Span lifecycle is managed through success/failure callbacks.SentryKafkaConsumerBeanPostProcessor— registers the interceptor onConcurrentKafkaListenerContainerFactorybeans.💡 Motivation and Context
Consumer-side instrumentation is needed to create process transactions and continue the distributed trace from the producer.
💚 How did you test it?
Unit tests for
SentryKafkaRecordInterceptorandSentryKafkaConsumerBeanPostProcessor.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps