Skip to content

test(samples): [Queue Instrumentation 6] Add Kafka queue system tests#5260

Draft
adinauer wants to merge 3 commits intofeat/queue-instrumentation-autoconfigfrom
feat/queue-instrumentation-e2e
Draft

test(samples): [Queue Instrumentation 6] Add Kafka queue system tests#5260
adinauer wants to merge 3 commits intofeat/queue-instrumentation-autoconfigfrom
feat/queue-instrumentation-e2e

Conversation

@adinauer
Copy link
Copy Markdown
Member

@adinauer adinauer commented Apr 2, 2026

PR Stack (Queue Instrumentation)


📜 Description

Add end-to-end system tests for Kafka queue instrumentation in the Spring Boot 3 sample app:

  • KafkaQueueSystemTest — 5 tests covering:

    • Producer endpoint creates queue.publish span
    • Consumer creates queue.process transaction
    • Distributed tracing: producer and consumer share the same trace ID
    • queue.publish span has messaging.system=kafka and messaging.destination.name=sentry-topic
    • queue.process transaction has matching messaging attributes
  • RestTestClient.produceKafkaMessage — new helper method for hitting the /kafka/produce endpoint

  • application-kafka.properties — adds sentry.enable-queue-tracing=true to the kafka profile

💡 Motivation and Context

PR 6 in the Queue Instrumentation stack. Validates the full stack (producer → consumer → auto-config) works end-to-end before moving to OTel and ports. Follows the existing CacheSystemTest pattern.

Infrastructure note: These tests require a running Kafka broker at localhost:9092 and the sample app started with --spring.profiles.active=kafka. They won't run in the standard CI flow until Kafka infrastructure is added to the system test pipeline.

💚 How did you test it?

  • Compilation verified: ./gradlew :sentry-samples:sentry-samples-spring-boot-jakarta:compileTestKotlin
  • Full e2e validation requires running Kafka + sample app (not automated yet)

📝 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

  • PR 7: Add Kafka to Spring Boot 3 OTel sample apps
  • PR 8: OTel coexistence

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

#skip-changelog

Add KafkaQueueSystemTest with e2e tests for:
- Producer endpoint creates queue.publish span
- Consumer creates queue.process transaction
- Distributed tracing (producer and consumer share same trace)
- Messaging attributes on publish span and process transaction

Also add produceKafkaMessage to RestTestClient and enable
sentry.enable-queue-tracing in the kafka profile properties.

Requires a running Kafka broker at localhost:9092 and the sample app
started with --spring.profiles.active=kafka.

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

github-actions bot commented Apr 2, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 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.

adinauer added 2 commits April 2, 2026 07:54
Force-pushing a stack branch can cause GitHub to auto-merge or
auto-close other PRs in the stack. Add explicit guidance to never
use --force, --force-with-lease, or amend+push on stack branches.
@sentry
Copy link
Copy Markdown

sentry bot commented Apr 2, 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 2, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 312.65 ms 367.12 ms 54.47 ms
Size 0 B 0 B 0 B

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

Startup times

Revision Plain With Sentry Diff
25629e3 325.13 ms 383.40 ms 58.27 ms

App size

Revision Plain With Sentry Diff
25629e3 0 B 0 B 0 B

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

Startup times

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

App size

Revision Plain With Sentry Diff
766d2f5 0 B 0 B 0 B
7e898af 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