Skip to content

Capture kafka producer and consumer configs#10697

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 12 commits intomasterfrom
piotr.wolski/capture-kafka-producer-consumer-configs
Apr 7, 2026
Merged

Capture kafka producer and consumer configs#10697
gh-worker-dd-mergequeue-cf854d[bot] merged 12 commits intomasterfrom
piotr.wolski/capture-kafka-producer-consumer-configs

Conversation

@piochelepiotr
Copy link
Copy Markdown
Contributor

@piochelepiotr piochelepiotr commented Feb 26, 2026

What Does This Do

Captures Kafka producer and consumer client configurations and reports them through the Data Streams Monitoring (DSM) pipeline. Configurations are extracted at client construction time, sensitive values are masked, and the data is sent along with other DSM stats once the Kafka cluster ID is available from metadata.

Motivation

Client configs (producer / consumer configs) are a critical part of a Kafka environment. When issues arise with an application, they can stem from either Kafka broker misconfiguration or client misconfiguration. Having visibility into both sides is essential for diagnosing problems. For example, a wrong buffer size on the client side can put significant pressure on the broker.

Additional Notes

  • An allowlist of ~60 safe config keys is used; all other keys (including credentials and secrets) are masked with ****
  • Config capture is gated behind isDataStreamsEnabled()
  • A MetadataState composite object replaces the previous plain String context store on Kafka Metadata objects, holding both the cluster ID and a pending config
  • Config is stored as "pending" at client construction, then reported when the cluster ID becomes available from a metadata update
  • Both kafka-clients-0.11 and kafka-clients-3.8 instrumentation versions are updated

tag: ai generated

[DSM-IDENT]

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 26, 2026

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master piotr.wolski/capture-kafka-producer-consumer-configs
git_commit_date 1773859211 1773862429
git_commit_sha 2604968 7e9aff8
See matching parameters
Baseline Candidate
ci_job_date 1773863552 1773863552
ci_job_id 1519252307 1519252307
ci_pipeline_id 103366345 103366345
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 26, 2026

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master piotr.wolski/capture-kafka-producer-consumer-configs
git_commit_date 1773859211 1773862429
git_commit_sha 2604968 7e9aff8
See matching parameters
Baseline Candidate
ci_job_date 1773863642 1773863642
ci_job_id 1519252310 1519252310
ci_pipeline_id 103366345 103366345
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume unsure
[-8303.447op/s; -352.670op/s] or [-4.355%; -0.185%]

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 26, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master piotr.wolski/capture-kafka-producer-consumer-configs
git_commit_date 1773859211 1773862429
git_commit_sha 2604968 7e9aff8
release_version 1.61.0-SNAPSHOT~2604968b95 1.61.0-SNAPSHOT~7e9aff8638
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1773864185 1773864185
ci_job_id 1519252288 1519252288
ci_pipeline_id 103366345 103366345
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-15owtofq 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-15owtofq 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 64 metrics, 7 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.06 s) : 0, 1059735
Total [baseline] (8.893 s) : 0, 8892642
Agent [candidate] (1.06 s) : 0, 1059881
Total [candidate] (8.845 s) : 0, 8844844
section iast
Agent [baseline] (1.234 s) : 0, 1234136
Total [baseline] (9.61 s) : 0, 9609739
Agent [candidate] (1.229 s) : 0, 1228888
Total [candidate] (9.551 s) : 0, 9550815
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent iast 1.234 s 174.4 ms (16.5%)
Total tracing 8.893 s -
Total iast 9.61 s 717.097 ms (8.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent iast 1.229 s 169.006 ms (15.9%)
Total tracing 8.845 s -
Total iast 9.551 s 705.971 ms (8.0%)
gantt
    title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.193 ms) : 0, 1193
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (628.854 ms) : 0, 628854
BytebuddyAgent [candidate] (629.244 ms) : 0, 629244
AgentMeter [baseline] (29.449 ms) : 0, 29449
AgentMeter [candidate] (29.268 ms) : 0, 29268
GlobalTracer [baseline] (258.531 ms) : 0, 258531
GlobalTracer [candidate] (258.25 ms) : 0, 258250
AppSec [baseline] (31.963 ms) : 0, 31963
AppSec [candidate] (31.981 ms) : 0, 31981
Debugger [baseline] (59.887 ms) : 0, 59887
Debugger [candidate] (60.12 ms) : 0, 60120
Remote Config [baseline] (587.284 µs) : 0, 587
Remote Config [candidate] (592.561 µs) : 0, 593
Telemetry [baseline] (8.036 ms) : 0, 8036
Telemetry [candidate] (8.925 ms) : 0, 8925
Flare Poller [baseline] (5.062 ms) : 0, 5062
Flare Poller [candidate] (4.294 ms) : 0, 4294
section iast
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (801.852 ms) : 0, 801852
BytebuddyAgent [candidate] (798.262 ms) : 0, 798262
AgentMeter [baseline] (11.499 ms) : 0, 11499
AgentMeter [candidate] (11.283 ms) : 0, 11283
GlobalTracer [baseline] (247.829 ms) : 0, 247829
GlobalTracer [candidate] (247.972 ms) : 0, 247972
IAST [baseline] (25.325 ms) : 0, 25325
IAST [candidate] (25.259 ms) : 0, 25259
AppSec [baseline] (26.551 ms) : 0, 26551
AppSec [candidate] (26.457 ms) : 0, 26457
Debugger [baseline] (69.598 ms) : 0, 69598
Debugger [candidate] (67.352 ms) : 0, 67352
Remote Config [baseline] (535.609 µs) : 0, 536
Remote Config [candidate] (520.884 µs) : 0, 521
Telemetry [baseline] (9.833 ms) : 0, 9833
Telemetry [candidate] (10.69 ms) : 0, 10690
Flare Poller [baseline] (3.572 ms) : 0, 3572
Flare Poller [candidate] (3.742 ms) : 0, 3742
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058097
Total [baseline] (11.106 s) : 0, 11105534
Agent [candidate] (1.057 s) : 0, 1057043
Total [candidate] (11.041 s) : 0, 11040947
section appsec
Agent [baseline] (1.246 s) : 0, 1246192
Total [baseline] (11.175 s) : 0, 11174925
Agent [candidate] (1.251 s) : 0, 1251276
Total [candidate] (11.216 s) : 0, 11215809
section iast
Agent [baseline] (1.228 s) : 0, 1228141
Total [baseline] (11.353 s) : 0, 11353174
Agent [candidate] (1.237 s) : 0, 1237439
Total [candidate] (11.3 s) : 0, 11299851
section profiling
Agent [baseline] (1.185 s) : 0, 1185284
Total [baseline] (11.032 s) : 0, 11032358
Agent [candidate] (1.191 s) : 0, 1190642
Total [candidate] (11.103 s) : 0, 11103165
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent appsec 1.246 s 188.095 ms (17.8%)
Agent iast 1.228 s 170.044 ms (16.1%)
Agent profiling 1.185 s 127.187 ms (12.0%)
Total tracing 11.106 s -
Total appsec 11.175 s 69.392 ms (0.6%)
Total iast 11.353 s 247.641 ms (2.2%)
Total profiling 11.032 s -73.175 ms (-0.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.057 s -
Agent appsec 1.251 s 194.234 ms (18.4%)
Agent iast 1.237 s 180.396 ms (17.1%)
Agent profiling 1.191 s 133.599 ms (12.6%)
Total tracing 11.041 s -
Total appsec 11.216 s 174.862 ms (1.6%)
Total iast 11.3 s 258.904 ms (2.3%)
Total profiling 11.103 s 62.218 ms (0.6%)
gantt
    title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.201 ms) : 0, 1201
BytebuddyAgent [baseline] (628.739 ms) : 0, 628739
BytebuddyAgent [candidate] (628.373 ms) : 0, 628373
AgentMeter [baseline] (29.206 ms) : 0, 29206
AgentMeter [candidate] (29.279 ms) : 0, 29279
GlobalTracer [baseline] (257.295 ms) : 0, 257295
GlobalTracer [candidate] (257.506 ms) : 0, 257506
AppSec [baseline] (31.746 ms) : 0, 31746
AppSec [candidate] (31.801 ms) : 0, 31801
Debugger [baseline] (60.267 ms) : 0, 60267
Debugger [candidate] (60.507 ms) : 0, 60507
Remote Config [baseline] (591.735 µs) : 0, 592
Remote Config [candidate] (588.266 µs) : 0, 588
Telemetry [baseline] (7.945 ms) : 0, 7945
Telemetry [candidate] (8.082 ms) : 0, 8082
Flare Poller [baseline] (5.081 ms) : 0, 5081
Flare Poller [candidate] (3.539 ms) : 0, 3539
section appsec
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.204 ms) : 0, 1204
BytebuddyAgent [baseline] (657.509 ms) : 0, 657509
BytebuddyAgent [candidate] (659.222 ms) : 0, 659222
AgentMeter [baseline] (11.953 ms) : 0, 11953
AgentMeter [candidate] (12.088 ms) : 0, 12088
GlobalTracer [baseline] (258.034 ms) : 0, 258034
GlobalTracer [candidate] (259.811 ms) : 0, 259811
IAST [baseline] (24.154 ms) : 0, 24154
IAST [candidate] (24.392 ms) : 0, 24392
AppSec [baseline] (178.269 ms) : 0, 178269
AppSec [candidate] (178.853 ms) : 0, 178853
Debugger [baseline] (66.212 ms) : 0, 66212
Debugger [candidate] (66.61 ms) : 0, 66610
Remote Config [baseline] (630.692 µs) : 0, 631
Remote Config [candidate] (636.983 µs) : 0, 637
Telemetry [baseline] (8.385 ms) : 0, 8385
Telemetry [candidate] (8.405 ms) : 0, 8405
Flare Poller [baseline] (3.617 ms) : 0, 3617
Flare Poller [candidate] (3.637 ms) : 0, 3637
section iast
crashtracking [baseline] (1.183 ms) : 0, 1183
crashtracking [candidate] (1.193 ms) : 0, 1193
BytebuddyAgent [baseline] (796.604 ms) : 0, 796604
BytebuddyAgent [candidate] (802.544 ms) : 0, 802544
AgentMeter [baseline] (11.302 ms) : 0, 11302
AgentMeter [candidate] (11.448 ms) : 0, 11448
GlobalTracer [baseline] (247.436 ms) : 0, 247436
GlobalTracer [candidate] (249.368 ms) : 0, 249368
IAST [baseline] (25.288 ms) : 0, 25288
IAST [candidate] (25.547 ms) : 0, 25547
AppSec [baseline] (26.547 ms) : 0, 26547
AppSec [candidate] (26.77 ms) : 0, 26770
Debugger [baseline] (70.66 ms) : 0, 70660
Debugger [candidate] (71.297 ms) : 0, 71297
Remote Config [baseline] (530.777 µs) : 0, 531
Remote Config [candidate] (533.245 µs) : 0, 533
Telemetry [baseline] (9.189 ms) : 0, 9189
Telemetry [candidate] (9.205 ms) : 0, 9205
Flare Poller [baseline] (3.333 ms) : 0, 3333
Flare Poller [candidate] (3.391 ms) : 0, 3391
section profiling
crashtracking [baseline] (1.169 ms) : 0, 1169
crashtracking [candidate] (1.165 ms) : 0, 1165
BytebuddyAgent [baseline] (684.394 ms) : 0, 684394
BytebuddyAgent [candidate] (687.634 ms) : 0, 687634
AgentMeter [baseline] (8.649 ms) : 0, 8649
AgentMeter [candidate] (8.636 ms) : 0, 8636
GlobalTracer [baseline] (215.806 ms) : 0, 215806
GlobalTracer [candidate] (216.967 ms) : 0, 216967
AppSec [baseline] (32.312 ms) : 0, 32312
AppSec [candidate] (32.495 ms) : 0, 32495
Debugger [baseline] (65.6 ms) : 0, 65600
Debugger [candidate] (65.521 ms) : 0, 65521
Remote Config [baseline] (563.624 µs) : 0, 564
Remote Config [candidate] (563.523 µs) : 0, 564
Telemetry [baseline] (8.513 ms) : 0, 8513
Telemetry [candidate] (7.759 ms) : 0, 7759
Flare Poller [baseline] (3.432 ms) : 0, 3432
Flare Poller [candidate] (4.302 ms) : 0, 4302
ProfilingAgent [baseline] (93.826 ms) : 0, 93826
ProfilingAgent [candidate] (94.619 ms) : 0, 94619
Profiling [baseline] (94.393 ms) : 0, 94393
Profiling [candidate] (95.186 ms) : 0, 95186
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master piotr.wolski/capture-kafka-producer-consumer-configs
git_commit_date 1773859211 1773862429
git_commit_sha 2604968 7e9aff8
release_version 1.61.0-SNAPSHOT~2604968b95 1.61.0-SNAPSHOT~7e9aff8638
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1773864660 1773864660
ci_job_id 1519252291 1519252291
ci_pipeline_id 103366345 103366345
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-8fgar5xm 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-8fgar5xm 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 2 performance improvements and 4 performance regressions! Performance is the same for 14 metrics, 16 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:profiling:high_load better
[-202.475µs; -57.659µs] or [-11.148%; -3.175%]
unstable
[-1348.336µs; -406.322µs] or [-23.616%; -7.117%]
unstable
[+42.958op/s; +511.105op/s] or [+2.271%; +27.014%]
1.686ms 4.832ms 2169.000op/s 1.816ms 5.709ms 1891.969op/s
scenario:load:insecure-bank:iast:high_load better
[-202.204µs; -80.335µs] or [-8.052%; -3.199%]
unsure
[-512.684µs; -46.164µs] or [-6.998%; -0.630%]
unstable
[-84.183op/s; +221.058op/s] or [-5.923%; +15.554%]
2.370ms 7.046ms 1489.688op/s 2.511ms 7.326ms 1421.250op/s
scenario:load:petclinic:code_origins:high_load worse
[+0.784ms; +1.677ms] or [+4.528%; +9.679%]
worse
[+0.846ms; +2.276ms] or [+2.935%; +7.899%]
unstable
[-39.128op/s; +8.503op/s] or [-14.877%; +3.233%]
18.556ms 30.380ms 247.688op/s 17.325ms 28.819ms 263.000op/s
scenario:load:petclinic:profiling:high_load worse
[+0.672ms; +1.621ms] or [+3.704%; +8.928%]
unsure
[+295.440µs; +1518.189µs] or [+0.997%; +5.121%]
unstable
[-34.726op/s; +10.788op/s] or [-13.773%; +4.279%]
19.301ms 30.553ms 240.156op/s 18.154ms 29.646ms 252.125op/s
scenario:load:petclinic:no_agent:high_load worse
[+1.336ms; +2.811ms] or [+8.055%; +16.950%]
unstable
[+0.994ms; +4.185ms] or [+3.485%; +14.668%]
unstable
[-53.845op/s; -2.717op/s] or [-19.814%; -1.000%]
18.661ms 31.117ms 243.469op/s 16.587ms 28.528ms 271.750op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.184 ms) : 1173, 1196
.   : milestone, 1184,
iast (3.219 ms) : 3176, 3262
.   : milestone, 3219,
iast_FULL (5.873 ms) : 5814, 5932
.   : milestone, 5873,
iast_GLOBAL (3.58 ms) : 3524, 3635
.   : milestone, 3580,
profiling (2.4 ms) : 2369, 2430
.   : milestone, 2400,
tracing (1.769 ms) : 1754, 1783
.   : milestone, 1769,
section candidate
no_agent (1.204 ms) : 1192, 1216
.   : milestone, 1204,
iast (3.069 ms) : 3028, 3111
.   : milestone, 3069,
iast_FULL (5.859 ms) : 5801, 5917
.   : milestone, 5859,
iast_GLOBAL (3.659 ms) : 3598, 3720
.   : milestone, 3659,
profiling (2.083 ms) : 2063, 2104
.   : milestone, 2083,
tracing (1.786 ms) : 1771, 1800
.   : milestone, 1786,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.184 ms [1.173 ms, 1.196 ms] -
iast 3.219 ms [3.176 ms, 3.262 ms] 2.035 ms (171.8%)
iast_FULL 5.873 ms [5.814 ms, 5.932 ms] 4.689 ms (395.9%)
iast_GLOBAL 3.58 ms [3.524 ms, 3.635 ms] 2.395 ms (202.3%)
profiling 2.4 ms [2.369 ms, 2.43 ms] 1.215 ms (102.6%)
tracing 1.769 ms [1.754 ms, 1.783 ms] 584.283 µs (49.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.204 ms [1.192 ms, 1.216 ms] -
iast 3.069 ms [3.028 ms, 3.111 ms] 1.866 ms (155.0%)
iast_FULL 5.859 ms [5.801 ms, 5.917 ms] 4.655 ms (386.8%)
iast_GLOBAL 3.659 ms [3.598 ms, 3.72 ms] 2.456 ms (204.0%)
profiling 2.083 ms [2.063 ms, 2.104 ms] 879.724 µs (73.1%)
tracing 1.786 ms [1.771 ms, 1.8 ms] 582.315 µs (48.4%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95
    dateFormat X
    axisFormat %s
section baseline
no_agent (17.168 ms) : 16995, 17341
.   : milestone, 17168,
appsec (18.38 ms) : 18191, 18570
.   : milestone, 18380,
code_origins (17.745 ms) : 17566, 17924
.   : milestone, 17745,
iast (17.891 ms) : 17709, 18072
.   : milestone, 17891,
profiling (18.513 ms) : 18329, 18697
.   : milestone, 18513,
tracing (17.647 ms) : 17471, 17824
.   : milestone, 17647,
section candidate
no_agent (19.175 ms) : 18976, 19373
.   : milestone, 19175,
appsec (18.386 ms) : 18201, 18572
.   : milestone, 18386,
code_origins (18.845 ms) : 18653, 19037
.   : milestone, 18845,
iast (17.539 ms) : 17365, 17712
.   : milestone, 17539,
profiling (19.437 ms) : 19241, 19633
.   : milestone, 19437,
tracing (17.836 ms) : 17657, 18014
.   : milestone, 17836,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.168 ms [16.995 ms, 17.341 ms] -
appsec 18.38 ms [18.191 ms, 18.57 ms] 1.212 ms (7.1%)
code_origins 17.745 ms [17.566 ms, 17.924 ms] 576.917 µs (3.4%)
iast 17.891 ms [17.709 ms, 18.072 ms] 722.428 µs (4.2%)
profiling 18.513 ms [18.329 ms, 18.697 ms] 1.345 ms (7.8%)
tracing 17.647 ms [17.471 ms, 17.824 ms] 479.362 µs (2.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 19.175 ms [18.976 ms, 19.373 ms] -
appsec 18.386 ms [18.201 ms, 18.572 ms] -788.473 µs (-4.1%)
code_origins 18.845 ms [18.653 ms, 19.037 ms] -329.977 µs (-1.7%)
iast 17.539 ms [17.365 ms, 17.712 ms] -1.636 ms (-8.5%)
profiling 19.437 ms [19.241 ms, 19.633 ms] 262.085 µs (1.4%)
tracing 17.836 ms [17.657 ms, 18.014 ms] -1.339 ms (-7.0%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master piotr.wolski/capture-kafka-producer-consumer-configs
git_commit_date 1773859211 1773862429
git_commit_sha 2604968 7e9aff8
release_version 1.61.0-SNAPSHOT~2604968b95 1.61.0-SNAPSHOT~7e9aff8638
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1773864570 1773864570
ci_job_id 1519252296 1519252296
ci_pipeline_id 103366345 103366345
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-2-uohwhr7i 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-2-uohwhr7i 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.348 s) : 15348000, 15348000
.   : milestone, 15348000,
appsec (14.802 s) : 14802000, 14802000
.   : milestone, 14802000,
iast (18.143 s) : 18143000, 18143000
.   : milestone, 18143000,
iast_GLOBAL (17.665 s) : 17665000, 17665000
.   : milestone, 17665000,
profiling (14.954 s) : 14954000, 14954000
.   : milestone, 14954000,
tracing (14.838 s) : 14838000, 14838000
.   : milestone, 14838000,
section candidate
no_agent (15.586 s) : 15586000, 15586000
.   : milestone, 15586000,
appsec (14.521 s) : 14521000, 14521000
.   : milestone, 14521000,
iast (18.416 s) : 18416000, 18416000
.   : milestone, 18416000,
iast_GLOBAL (17.833 s) : 17833000, 17833000
.   : milestone, 17833000,
profiling (15.031 s) : 15031000, 15031000
.   : milestone, 15031000,
tracing (15.13 s) : 15130000, 15130000
.   : milestone, 15130000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.348 s [15.348 s, 15.348 s] -
appsec 14.802 s [14.802 s, 14.802 s] -546.0 ms (-3.6%)
iast 18.143 s [18.143 s, 18.143 s] 2.795 s (18.2%)
iast_GLOBAL 17.665 s [17.665 s, 17.665 s] 2.317 s (15.1%)
profiling 14.954 s [14.954 s, 14.954 s] -394.0 ms (-2.6%)
tracing 14.838 s [14.838 s, 14.838 s] -510.0 ms (-3.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.586 s [15.586 s, 15.586 s] -
appsec 14.521 s [14.521 s, 14.521 s] -1.065 s (-6.8%)
iast 18.416 s [18.416 s, 18.416 s] 2.83 s (18.2%)
iast_GLOBAL 17.833 s [17.833 s, 17.833 s] 2.247 s (14.4%)
profiling 15.031 s [15.031 s, 15.031 s] -555.0 ms (-3.6%)
tracing 15.13 s [15.13 s, 15.13 s] -456.0 ms (-2.9%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~7e9aff8638, baseline=1.61.0-SNAPSHOT~2604968b95
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.47 ms) : 1458, 1481
.   : milestone, 1470,
appsec (3.724 ms) : 3509, 3939
.   : milestone, 3724,
iast (2.247 ms) : 2179, 2316
.   : milestone, 2247,
iast_GLOBAL (2.285 ms) : 2216, 2353
.   : milestone, 2285,
profiling (2.076 ms) : 2022, 2131
.   : milestone, 2076,
tracing (2.065 ms) : 2012, 2118
.   : milestone, 2065,
section candidate
no_agent (1.469 ms) : 1457, 1480
.   : milestone, 1469,
appsec (3.798 ms) : 3579, 4018
.   : milestone, 3798,
iast (2.25 ms) : 2181, 2319
.   : milestone, 2250,
iast_GLOBAL (2.293 ms) : 2224, 2363
.   : milestone, 2293,
profiling (2.07 ms) : 2015, 2124
.   : milestone, 2070,
tracing (2.063 ms) : 2009, 2117
.   : milestone, 2063,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.47 ms [1.458 ms, 1.481 ms] -
appsec 3.724 ms [3.509 ms, 3.939 ms] 2.254 ms (153.4%)
iast 2.247 ms [2.179 ms, 2.316 ms] 777.632 µs (52.9%)
iast_GLOBAL 2.285 ms [2.216 ms, 2.353 ms] 814.704 µs (55.4%)
profiling 2.076 ms [2.022 ms, 2.131 ms] 606.312 µs (41.3%)
tracing 2.065 ms [2.012 ms, 2.118 ms] 595.245 µs (40.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.469 ms [1.457 ms, 1.48 ms] -
appsec 3.798 ms [3.579 ms, 4.018 ms] 2.33 ms (158.6%)
iast 2.25 ms [2.181 ms, 2.319 ms] 781.578 µs (53.2%)
iast_GLOBAL 2.293 ms [2.224 ms, 2.363 ms] 824.842 µs (56.2%)
profiling 2.07 ms [2.015 ms, 2.124 ms] 600.947 µs (40.9%)
tracing 2.063 ms [2.009 ms, 2.117 ms] 594.448 µs (40.5%)

@piochelepiotr piochelepiotr force-pushed the piotr.wolski/capture-kafka-producer-consumer-configs branch from fd826ee to 1ecfe51 Compare March 12, 2026 21:54
@piochelepiotr piochelepiotr changed the title Piotr.wolski/capture kafka producer consumer configs Capture kafka producer and consumer configs Mar 16, 2026
@@ -42,7 +43,9 @@ public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
@Override
public Map<String, String> contextStore() {
Map<String, String> contextStores = new HashMap<>();
contextStores.put("org.apache.kafka.clients.Metadata", "java.lang.String");
contextStores.put(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to store both cluster ID & pending Kafka config under the same key. The way to do that is to create a container class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - this is already handled by the MetadataState container class that holds both clusterId and pendingConfig.

@piochelepiotr piochelepiotr marked this pull request as ready for review March 16, 2026 21:59
@piochelepiotr piochelepiotr requested review from a team as code owners March 16, 2026 21:59
@github-actions
Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@github-actions github-actions bot added the tag: ai generated Largely based on code generated by an AI or LLM label Mar 17, 2026
piochelepiotr and others added 9 commits March 18, 2026 13:17
- Fix MetadataState class name to use fully qualified name in
  KafkaProducerInstrumentation (helperClassNames and contextStore),
  which was causing producer spans to break due to context store mismatch
- Replace sensitive keys denylist with an allowlist of safe config keys
- Mask values of non-allowed keys with "****" instead of dropping them,
  to enable monitoring of which configs are seen but not yet allowed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In Groovy, `map[expr1] = expr2` evaluates expr2 before expr1,
which swapped msgpack key/value reads. Use temp variables instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move test to default package to avoid underscore in package name,
matching the convention used by other kafka test files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ecks

- Use "kafka_producer"/"kafka_consumer" consistently in KafkaConfigHelper
- Remove log.warn debug logging from MsgPackDatastreamsPayloadWriter
- Remove unbounded reportedKafkaConfigs dedup map; configs flow through
  StatsBucket like other stats points
- Make MASKED_VALUE and ALLOWED_KEYS public in KafkaConfigHelper
- Remove redundant null checks in writeKafkaConfigs (constructor normalizes)
- Update tests to reflect removal of dedup behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@piochelepiotr piochelepiotr force-pushed the piotr.wolski/capture-kafka-producer-consumer-configs branch from b898dd4 to fb55014 Compare March 18, 2026 19:20
The ContextPropagationAdvice classes were still using
InstrumentationContext.get(Metadata.class, String.class) after the
context store value type was changed from String to MetadataState,
causing an instrumentation error at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment on lines +161 to +164
InstrumentationContext.get(Metadata.class, MetadataState.class).get(metadata);
if (state == null) {
state = new MetadataState();
InstrumentationContext.get(Metadata.class, MetadataState.class).put(metadata, state);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think InstrumentationContext.get is relatively expensive, so we should avoid doing that twice, but also it has a method putIfAbsent that does exactly what you want, so you should use that instead (also avoids the double lookup)

Comment on lines +95 to +119
public static void storePendingProducerConfig(MetadataState state, Map<String, String> config) {
state.setPendingConfig(new PendingConfig("kafka_producer", "", config));
log.debug("Stored pending producer config (cluster ID not yet known)");
}

/** Store a consumer config to be reported once the cluster ID is known from metadata. */
public static void storePendingConsumerConfig(
MetadataState state, String consumerGroup, Map<String, String> config) {
state.setPendingConfig(
new PendingConfig("kafka_consumer", consumerGroup != null ? consumerGroup : "", config));
log.debug("Stored pending consumer config (cluster ID not yet known)");
}

/** Called from metadata update advice when the cluster ID becomes available. */
public static void reportPendingConfig(MetadataState state, String clusterId) {
PendingConfig pending = state.takePendingConfig();
if (pending != null) {
log.debug("Received cluster ID, reporting {} config", pending.type);
if (Config.get().isDataStreamsEnabled()) {
AgentTracer.get()
.getDataStreamsMonitoring()
.reportKafkaConfig(pending.type, clusterId, pending.consumerGroup, pending.config);
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those 3 methods are a bit verbose on debug, how often can we expect to see those ? Is it safe to assume it'd only happen once ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, only when consumer / producers are created. I expect that to be once per applications for most apps, maybe a bit more if some applications use dynamic producers / consumers. But shouldn't be too often. Let me know if you think I should remove some here.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
InstrumentationContext.get(Metadata.class, MetadataState.class).put(metadata, state);
}
InstrumentationContext.get(Metadata.class, MetadataState.class)
.putIfAbsent(metadata, new MetadataState());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you could use the factory overload of the method to avoid creating the object if we don't need it

…e allocation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@piochelepiotr piochelepiotr requested a review from vandonr April 2, 2026 20:16
@piochelepiotr piochelepiotr added this pull request to the merge queue Apr 7, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Apr 7, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Apr 7, 2026

View all feedbacks in Devflow UI.

2026-04-07 15:29:18 UTC ℹ️ Start processing command /merge


2026-04-07 15:29:24 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 2h (p90).


2026-04-07 16:11:56 UTC ℹ️ MergeQueue: Readding this merge request to the queue because another merge request processed with yours failed. No action is needed from your side.


2026-04-07 18:13:12 UTC ℹ️ MergeQueue: Readding this merge request to the queue because another merge request processed with yours failed. No action is needed from your side.


2026-04-07 19:17:52 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 7, 2026
@piochelepiotr piochelepiotr added this pull request to the merge queue Apr 7, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Apr 7, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Apr 7, 2026

View all feedbacks in Devflow UI.

2026-04-07 16:49:42 UTC ℹ️ Start processing command /merge


2026-04-07 16:49:44 UTC ❌ MergeQueue

PR already in the queue with status in_progress

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 7, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot merged commit 860047f into master Apr 7, 2026
571 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot deleted the piotr.wolski/capture-kafka-producer-consumer-configs branch April 7, 2026 19:17
@github-actions github-actions bot added this to the 1.61.0 milestone Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: kafka Kafka instrumentation tag: ai generated Largely based on code generated by an AI or LLM type: feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants