Repository navigation
Add a Kafka macro benchmark running Kafka's perf tools under the agent (macrobenchmark) - #13051
Conversation
kafka-consumer-perf-test / kafka-producer-perf-test use the standard kafka-clients library, so the agent's Kafka instrumentation runs on the real client paths with no application code. The consume topic is filled by an agent-instrumented producer, so every record carries trace headers and each consumed record goes through extraction and gets a consume span. Scripts: fetch (SHA-512 verified), single-node KRaft broker without the agent, topic prefill, a preflight that checks header injection and trace continuation, consumer and producer runs (fresh JVM per run, rotated variant order, heap sweep, GC logs, CSV), and an analysis that reports the tracer's cost per record against NoAgent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b270d6b1d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Benchmark shutdown can terminate unrelated local Kafka brokers. Both runners can also accept incomplete executions as benchmark results, distorting throughput comparisons or producing malformed CSV.
🤖 Bits Code Review · Commit 7b270d6
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
How about to use Java instead of Python?
…oker broker.sh stop now signals the PID it recorded instead of running kafka-server-stop.sh, which stops every Kafka broker on the host. run-consumer.sh rejects runs that exit nonzero or read fewer than MESSAGES records; a short read still prints stats after the timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Analyze.java runs as a single-file source program on the JDK the benchmark already requires, replacing analyze.py and the python3 dependency. It also summarizes producer results and reports rejected runs per variant. run-producer.sh now requires the final summary line (the only one with percentiles) and a zero exit, and records rejected runs as empty rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
--- found with Codex P2: Reject partial producer runs In run-producer.sh, lines 35–43, a zero exit and final summary are sufficient for acceptance. However, Kafka 3.9.1's producer callback prints asynchronous send errors without failing the process; its final summary counts only successful sends. A partially failed workload therefore enters the medians. I reproduced this with the unchanged runner and a stubbed perf tool: requesting 100 records and returning a zero exit plus a final summary for 90 records produced an accepted CSV measurement. Please parse the successful-record count from the final summary and require it to equal This extends the existing producer-summary concern: the earlier fix correctly rejects nonzero exits and missing final summaries, but does not cover asynchronous send failures. |
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
LGTM, nice to see that java can replace python for analyzing data.
Left minor comment found by Codex.
Kafka's producer perf tool logs failed sends without failing and its summary counts only the successful ones, so a run is now accepted only if it sent every record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks — the partial-producer-run P2 is fixed in a5ab030. Reply written by Claude (Claude Code) on behalf of dougqh. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status in_progress |
6f44bc9
into
master
What does this PR do?
Adds a self-contained Kafka macro benchmark under
dd-java-agent/benchmark-integration/kafka/. It runs Kafka's own perf tools (kafka-consumer-perf-testandkafka-producer-perf-test) under the agent.The tools use the standard
kafka-clientslibrary, so the agent's Kafka instrumentation runs on the real client paths with no application code.fetch-kafka.shbuild/broker.sh start|stopprefill.shtraceparent/tracestate)preflight.shrun-consumer.sh/run-producer.shNoAgentorlabel=agent.jar), fresh JVM per run, rotated order, heap sweep, GC logs, CSVAnalyze.javaMotivation
Example results from one laptop (JDK 17, 10M records, 5 reps), consumer fetch records/s at 256m:
The same workload exposed per-record Data Streams work done with DSM disabled; skipping it adds ~6.6%. More detail is in the README.
Additional Notes
🤖 Generated with Claude Code