Skip to content

test(kafka): [Sample Tests 34] Add an end-to-end test of the raw Kafka client's tracing - #6326

Draft
runningcode wants to merge 2 commits into
no/async-profiler-integration-testfrom
no/kafka-integration-test
Draft

runningcode wants to merge 2 commits into
no/async-profiler-integration-testfrom
no/kafka-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Adds SentryKafkaEndToEndTest to sentry-kafka. It ports the Kafka part of sentry-samples-console's system test, which ran the sample's JAR against a Redpanda container. The test publishes a message through SentryKafkaProducer.wrap(KafkaProducer) to an in-JVM KRaft broker, consumes it with SentryKafkaConsumerTracing.withTracing, and checks what reaches MockSentryServer:

  • the producing transaction, with its queue.publish span;
  • a queue.process transaction with the manual.queue.kafka.consumer origin and messaging.system=kafka;
  • that the consumer's transaction continues the producer's trace through the message headers. The sample didn't check this.

Java 17 for the test classpaths. The broker comes from spring-kafka-test 3, without a Spring application. It needs Java 17, while sentry-kafka targets Java 8, so Gradle refused to resolve it. The module's test classpaths now resolve Java 17 variants; the tests run on Java 17 anyway. spring-kafka-test 2.8, which supports Java 8, brings a Kafka 3.1 broker that would clash with the 3.8 client the module tests against.

The console sample is retired. With #6324 (core) and #6325 (profiling), all of the sample's test is now in modules, so the sample comes off the runner and the backend workflow. It also drops its Kotlin plugin, which only the test needed. Its JCache demo had no assertions, so nothing about it moves. The workflow's base row moves to sentry-samples-console-otlp. No remaining sample needs a broker, so the runner's Kafka set is empty; the runner itself goes in the cleanup PRs.

💡 Motivation and Context

The raw-client Kafka integration now runs end to end in ./gradlew :sentry-kafka:test, in about 3 seconds, without Docker.

💚 How did you test it?

  • The test passes, and so do the module's other 26 tests.
  • Expecting a different consumer origin makes it fail.
  • :sentry-kafka:check passes, and the sample's JAR still builds.

📝 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.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The OpenTelemetry console samples (console-opentelemetry-noagent, console-otlp) and spring-boot-4-otlp.

#skip-changelog

🤖 Generated with Claude Code

SentryKafkaEndToEndTest publishes a message through a wrapped
KafkaProducer to an in-JVM KRaft broker, consumes it with
SentryKafkaConsumerTracing, and checks what reaches MockSentryServer:
the queue.publish span in the producing transaction, and a queue.process
transaction with the consumer origin and the Kafka system that continues
the producer's trace. It ports the Kafka part of the console sample's
system test, which needed a Redpanda container.

The broker comes from spring-kafka-test 3, which needs Java 17, so the
test classpaths resolve Java 17 variants. The tests run on it anyway.

With its core, profiling and Kafka parts ported, the console sample has
no system test left, so it comes off the system-test runner and the
backend workflow, whose base row moves to the console OTLP sample.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 20, 2026
@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.0 (1) release

⚙️ sentry-android Build Distribution Settings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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