Skip to content

Protocol v1#10801

Open
AlexeyKuznetsov-DD wants to merge 85 commits intomasterfrom
alexeyk/protocol-v1-1
Open

Protocol v1#10801
AlexeyKuznetsov-DD wants to merge 85 commits intomasterfrom
alexeyk/protocol-v1-1

Conversation

@AlexeyKuznetsov-DD
Copy link
Copy Markdown
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Mar 10, 2026

What Does This Do

  • Implements support for the Datadog Agent Trace Protocol v1.0 (v1.0/traces endpoint) in the Java tracer.

  • Introduces TraceMapperV1, a new serializer that encodes traces in the v1 msgpack format with a flat attribute model, string table deduplication, and typed attribute values.

  • Adds a ProtocolVersion enum to cleanly represent v0.4, v0.5, and v1.0 protocols including their fallback endpoint chains.

  • Updates DDAgentFeaturesDiscovery to probe endpoints based on the configured protocol version.

    Motivation

    Protocol v1 is a more efficient wire format: it deduplicates repeated strings via a string table, uses typed attribute values (string/bool/float/int/bytes/array). This reduces payload size and provides a cleaner foundation for future span model evolution. The implementation falls back gracefully to v0.4 when the agent does not advertise v1 support.

    Additional Notes

    Protocol v1 spec
    System test passed both on GitHub and GitLab.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Mar 10, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added tag: do not merge Do not merge changes comp: core Tracer core labels Mar 10, 2026
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Mar 11, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/protocol-v1-1
git_commit_date 1776788798 1776801963
git_commit_sha 6880c80 2275e71
release_version 1.62.0-SNAPSHOT~6880c80c48 1.61.0-SNAPSHOT~2275e716e1
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1776803704 1776803704
ci_job_id 1617306124 1617306124
ci_pipeline_id 108894992 108894992
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-09o28jq1 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-09o28jq1 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 60 metrics, 11 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058214
Total [baseline] (8.841 s) : 0, 8841355
Agent [candidate] (1.064 s) : 0, 1063648
Total [candidate] (8.846 s) : 0, 8846284
section iast
Agent [baseline] (1.228 s) : 0, 1227750
Total [baseline] (9.541 s) : 0, 9540853
Agent [candidate] (1.231 s) : 0, 1231489
Total [candidate] (9.616 s) : 0, 9615950
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent iast 1.228 s 169.536 ms (16.0%)
Total tracing 8.841 s -
Total iast 9.541 s 699.498 ms (7.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.064 s -
Agent iast 1.231 s 167.841 ms (15.8%)
Total tracing 8.846 s -
Total iast 9.616 s 769.666 ms (8.7%)
gantt
    title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.262 ms) : 0, 1262
crashtracking [candidate] (1.232 ms) : 0, 1232
BytebuddyAgent [baseline] (634.756 ms) : 0, 634756
BytebuddyAgent [candidate] (638.805 ms) : 0, 638805
AgentMeter [baseline] (29.519 ms) : 0, 29519
AgentMeter [candidate] (29.615 ms) : 0, 29615
GlobalTracer [baseline] (248.27 ms) : 0, 248270
GlobalTracer [candidate] (249.201 ms) : 0, 249201
AppSec [baseline] (32.4 ms) : 0, 32400
AppSec [candidate] (32.267 ms) : 0, 32267
Debugger [baseline] (58.877 ms) : 0, 58877
Debugger [candidate] (59.347 ms) : 0, 59347
Remote Config [baseline] (596.8 µs) : 0, 597
Remote Config [candidate] (611.304 µs) : 0, 611
Telemetry [baseline] (7.969 ms) : 0, 7969
Telemetry [candidate] (9.457 ms) : 0, 9457
Flare Poller [baseline] (8.194 ms) : 0, 8194
Flare Poller [candidate] (6.694 ms) : 0, 6694
section iast
crashtracking [baseline] (1.261 ms) : 0, 1261
crashtracking [candidate] (1.234 ms) : 0, 1234
BytebuddyAgent [baseline] (807.307 ms) : 0, 807307
BytebuddyAgent [candidate] (808.75 ms) : 0, 808750
AgentMeter [baseline] (11.348 ms) : 0, 11348
AgentMeter [candidate] (11.393 ms) : 0, 11393
GlobalTracer [baseline] (238.216 ms) : 0, 238216
GlobalTracer [candidate] (238.837 ms) : 0, 238837
IAST [baseline] (30.936 ms) : 0, 30936
IAST [candidate] (29.91 ms) : 0, 29910
AppSec [baseline] (27.223 ms) : 0, 27223
AppSec [candidate] (26.949 ms) : 0, 26949
Debugger [baseline] (63.725 ms) : 0, 63725
Debugger [candidate] (66.391 ms) : 0, 66391
Remote Config [baseline] (526.844 µs) : 0, 527
Remote Config [candidate] (535.657 µs) : 0, 536
Telemetry [baseline] (7.696 ms) : 0, 7696
Telemetry [candidate] (7.981 ms) : 0, 7981
Flare Poller [baseline] (3.396 ms) : 0, 3396
Flare Poller [candidate] (3.485 ms) : 0, 3485
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1058191
Total [baseline] (11.143 s) : 0, 11143328
Agent [candidate] (1.058 s) : 0, 1057872
Total [candidate] (11.173 s) : 0, 11173081
section appsec
Agent [baseline] (1.261 s) : 0, 1260563
Total [baseline] (11.006 s) : 0, 11005919
Agent [candidate] (1.271 s) : 0, 1271223
Total [candidate] (11.138 s) : 0, 11138007
section iast
Agent [baseline] (1.23 s) : 0, 1230168
Total [baseline] (11.314 s) : 0, 11313975
Agent [candidate] (1.233 s) : 0, 1232713
Total [candidate] (11.283 s) : 0, 11283373
section profiling
Agent [baseline] (1.186 s) : 0, 1186026
Total [baseline] (11.165 s) : 0, 11165185
Agent [candidate] (1.185 s) : 0, 1185157
Total [candidate] (11.063 s) : 0, 11063218
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent appsec 1.261 s 202.373 ms (19.1%)
Agent iast 1.23 s 171.978 ms (16.3%)
Agent profiling 1.186 s 127.836 ms (12.1%)
Total tracing 11.143 s -
Total appsec 11.006 s -137.409 ms (-1.2%)
Total iast 11.314 s 170.647 ms (1.5%)
Total profiling 11.165 s 21.857 ms (0.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent appsec 1.271 s 213.35 ms (20.2%)
Agent iast 1.233 s 174.841 ms (16.5%)
Agent profiling 1.185 s 127.285 ms (12.0%)
Total tracing 11.173 s -
Total appsec 11.138 s -35.074 ms (-0.3%)
Total iast 11.283 s 110.292 ms (1.0%)
Total profiling 11.063 s -109.863 ms (-1.0%)
gantt
    title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.241 ms) : 0, 1241
crashtracking [candidate] (1.235 ms) : 0, 1235
BytebuddyAgent [baseline] (632.869 ms) : 0, 632869
BytebuddyAgent [candidate] (631.818 ms) : 0, 631818
AgentMeter [baseline] (29.579 ms) : 0, 29579
AgentMeter [candidate] (29.262 ms) : 0, 29262
GlobalTracer [baseline] (249.842 ms) : 0, 249842
GlobalTracer [candidate] (249.385 ms) : 0, 249385
AppSec [baseline] (32.612 ms) : 0, 32612
AppSec [candidate] (32.321 ms) : 0, 32321
Debugger [baseline] (60.124 ms) : 0, 60124
Debugger [candidate] (60.634 ms) : 0, 60634
Remote Config [baseline] (613.227 µs) : 0, 613
Remote Config [candidate] (604.266 µs) : 0, 604
Telemetry [baseline] (8.142 ms) : 0, 8142
Telemetry [candidate] (8.845 ms) : 0, 8845
Flare Poller [baseline] (6.794 ms) : 0, 6794
Flare Poller [candidate] (7.632 ms) : 0, 7632
section appsec
crashtracking [baseline] (1.235 ms) : 0, 1235
crashtracking [candidate] (1.253 ms) : 0, 1253
BytebuddyAgent [baseline] (673.574 ms) : 0, 673574
BytebuddyAgent [candidate] (680.523 ms) : 0, 680523
AgentMeter [baseline] (12.181 ms) : 0, 12181
AgentMeter [candidate] (12.391 ms) : 0, 12391
GlobalTracer [baseline] (248.91 ms) : 0, 248910
GlobalTracer [candidate] (250.637 ms) : 0, 250637
AppSec [baseline] (186.403 ms) : 0, 186403
AppSec [candidate] (187.48 ms) : 0, 187480
Debugger [baseline] (65.664 ms) : 0, 65664
Debugger [candidate] (65.973 ms) : 0, 65973
Remote Config [baseline] (574.429 µs) : 0, 574
Remote Config [candidate] (574.197 µs) : 0, 574
Telemetry [baseline] (7.852 ms) : 0, 7852
Telemetry [candidate] (7.86 ms) : 0, 7860
Flare Poller [baseline] (3.465 ms) : 0, 3465
Flare Poller [candidate] (3.46 ms) : 0, 3460
IAST [baseline] (24.297 ms) : 0, 24297
IAST [candidate] (24.464 ms) : 0, 24464
section iast
crashtracking [baseline] (1.244 ms) : 0, 1244
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (807.802 ms) : 0, 807802
BytebuddyAgent [candidate] (808.895 ms) : 0, 808895
AgentMeter [baseline] (11.391 ms) : 0, 11391
AgentMeter [candidate] (11.394 ms) : 0, 11394
GlobalTracer [baseline] (238.717 ms) : 0, 238717
GlobalTracer [candidate] (239.703 ms) : 0, 239703
AppSec [baseline] (29.229 ms) : 0, 29229
AppSec [candidate] (28.514 ms) : 0, 28514
Debugger [baseline] (64.068 ms) : 0, 64068
Debugger [candidate] (64.206 ms) : 0, 64206
Remote Config [baseline] (543.563 µs) : 0, 544
Remote Config [candidate] (539.608 µs) : 0, 540
Telemetry [baseline] (7.813 ms) : 0, 7813
Telemetry [candidate] (7.886 ms) : 0, 7886
Flare Poller [baseline] (3.431 ms) : 0, 3431
Flare Poller [candidate] (3.478 ms) : 0, 3478
IAST [baseline] (29.058 ms) : 0, 29058
IAST [candidate] (30.853 ms) : 0, 30853
section profiling
ProfilingAgent [baseline] (94.28 ms) : 0, 94280
ProfilingAgent [candidate] (93.881 ms) : 0, 93881
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (691.4 ms) : 0, 691400
BytebuddyAgent [candidate] (691.399 ms) : 0, 691399
AgentMeter [baseline] (9.234 ms) : 0, 9234
AgentMeter [candidate] (9.271 ms) : 0, 9271
GlobalTracer [baseline] (207.386 ms) : 0, 207386
GlobalTracer [candidate] (207.232 ms) : 0, 207232
AppSec [baseline] (32.919 ms) : 0, 32919
AppSec [candidate] (32.761 ms) : 0, 32761
Debugger [baseline] (66.267 ms) : 0, 66267
Debugger [candidate] (65.843 ms) : 0, 65843
Remote Config [baseline] (584.558 µs) : 0, 585
Remote Config [candidate] (573.624 µs) : 0, 574
Telemetry [baseline] (7.783 ms) : 0, 7783
Telemetry [candidate] (7.822 ms) : 0, 7822
Flare Poller [baseline] (3.536 ms) : 0, 3536
Flare Poller [candidate] (3.592 ms) : 0, 3592
Profiling [baseline] (94.843 ms) : 0, 94843
Profiling [candidate] (94.439 ms) : 0, 94439
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/protocol-v1-1
git_commit_date 1776788798 1776801963
git_commit_sha 6880c80 2275e71
release_version 1.62.0-SNAPSHOT~6880c80c48 1.61.0-SNAPSHOT~2275e716e1
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1776804181 1776804181
ci_job_id 1617306125 1617306125
ci_pipeline_id 108894992 108894992
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-swq4dk7c 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-swq4dk7c 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 1 performance improvements and 3 performance regressions! Performance is the same for 16 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:iast_GLOBAL:high_load worse
[+120.369µs; +258.027µs] or [+4.334%; +9.290%]
unsure
[+144.289µs; +583.084µs] or [+1.832%; +7.404%]
unstable
[-213.394op/s; +75.957op/s] or [-16.470%; +5.863%]
2.967ms 8.239ms 1226.906op/s 2.777ms 7.875ms 1295.625op/s
scenario:load:petclinic:tracing:high_load worse
[+0.687ms; +1.488ms] or [+3.938%; +8.534%]
worse
[+0.624ms; +2.362ms] or [+2.190%; +8.286%]
unstable
[-39.827op/s; +13.639op/s] or [-15.185%; +5.200%]
18.523ms 29.992ms 249.188op/s 17.436ms 28.499ms 262.281op/s
scenario:load:petclinic:no_agent:high_load better
[-1.941ms; -0.382ms] or [-10.408%; -2.047%]
unstable
[-3.466ms; -0.224ms] or [-11.247%; -0.727%]
unstable
[-14.502op/s; +43.065op/s] or [-5.932%; +17.616%]
17.487ms 28.975ms 258.750op/s 18.648ms 30.820ms 244.469op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
    dateFormat X
    axisFormat %s
section baseline
no_agent (19.093 ms) : 18898, 19289
.   : milestone, 19093,
appsec (18.794 ms) : 18603, 18984
.   : milestone, 18794,
code_origins (17.802 ms) : 17625, 17980
.   : milestone, 17802,
iast (17.853 ms) : 17676, 18030
.   : milestone, 17853,
profiling (18.346 ms) : 18162, 18530
.   : milestone, 18346,
tracing (17.789 ms) : 17615, 17963
.   : milestone, 17789,
section candidate
no_agent (18.03 ms) : 17850, 18211
.   : milestone, 18030,
appsec (18.774 ms) : 18587, 18962
.   : milestone, 18774,
code_origins (17.968 ms) : 17789, 18147
.   : milestone, 17968,
iast (17.88 ms) : 17701, 18058
.   : milestone, 17880,
profiling (18.283 ms) : 18104, 18461
.   : milestone, 18283,
tracing (18.729 ms) : 18541, 18916
.   : milestone, 18729,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 19.093 ms [18.898 ms, 19.289 ms] -
appsec 18.794 ms [18.603 ms, 18.984 ms] -299.676 µs (-1.6%)
code_origins 17.802 ms [17.625 ms, 17.98 ms] -1.291 ms (-6.8%)
iast 17.853 ms [17.676 ms, 18.03 ms] -1.24 ms (-6.5%)
profiling 18.346 ms [18.162 ms, 18.53 ms] -747.484 µs (-3.9%)
tracing 17.789 ms [17.615 ms, 17.963 ms] -1.305 ms (-6.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.03 ms [17.85 ms, 18.211 ms] -
appsec 18.774 ms [18.587 ms, 18.962 ms] 744.027 µs (4.1%)
code_origins 17.968 ms [17.789 ms, 18.147 ms] -62.002 µs (-0.3%)
iast 17.88 ms [17.701 ms, 18.058 ms] -150.75 µs (-0.8%)
profiling 18.283 ms [18.104 ms, 18.461 ms] 252.481 µs (1.4%)
tracing 18.729 ms [18.541 ms, 18.916 ms] 698.425 µs (3.9%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.256 ms) : 1243, 1269
.   : milestone, 1256,
iast (3.272 ms) : 3225, 3320
.   : milestone, 3272,
iast_FULL (5.79 ms) : 5731, 5848
.   : milestone, 5790,
iast_GLOBAL (3.538 ms) : 3479, 3596
.   : milestone, 3538,
profiling (2.135 ms) : 2112, 2158
.   : milestone, 2135,
tracing (1.932 ms) : 1915, 1949
.   : milestone, 1932,
section candidate
no_agent (1.236 ms) : 1224, 1247
.   : milestone, 1236,
iast (3.211 ms) : 3169, 3253
.   : milestone, 3211,
iast_FULL (5.958 ms) : 5898, 6019
.   : milestone, 5958,
iast_GLOBAL (3.74 ms) : 3678, 3801
.   : milestone, 3740,
profiling (2.095 ms) : 2076, 2113
.   : milestone, 2095,
tracing (1.899 ms) : 1883, 1914
.   : milestone, 1899,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.256 ms [1.243 ms, 1.269 ms] -
iast 3.272 ms [3.225 ms, 3.32 ms] 2.016 ms (160.5%)
iast_FULL 5.79 ms [5.731 ms, 5.848 ms] 4.534 ms (361.0%)
iast_GLOBAL 3.538 ms [3.479 ms, 3.596 ms] 2.282 ms (181.7%)
profiling 2.135 ms [2.112 ms, 2.158 ms] 879.07 µs (70.0%)
tracing 1.932 ms [1.915 ms, 1.949 ms] 676.193 µs (53.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.236 ms [1.224 ms, 1.247 ms] -
iast 3.211 ms [3.169 ms, 3.253 ms] 1.976 ms (159.9%)
iast_FULL 5.958 ms [5.898 ms, 6.019 ms] 4.723 ms (382.2%)
iast_GLOBAL 3.74 ms [3.678 ms, 3.801 ms] 2.504 ms (202.7%)
profiling 2.095 ms [2.076 ms, 2.113 ms] 859.421 µs (69.6%)
tracing 1.899 ms [1.883 ms, 1.914 ms] 663.119 µs (53.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alexeyk/protocol-v1-1
git_commit_date 1776788798 1776801963
git_commit_sha 6880c80 2275e71
release_version 1.62.0-SNAPSHOT~6880c80c48 1.61.0-SNAPSHOT~2275e716e1
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1776803990 1776803990
ci_job_id 1617306126 1617306126
ci_pipeline_id 108894992 108894992
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-hbks479w 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-hbks479w 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~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.704 s) : 15704000, 15704000
.   : milestone, 15704000,
appsec (14.656 s) : 14656000, 14656000
.   : milestone, 14656000,
iast (18.731 s) : 18731000, 18731000
.   : milestone, 18731000,
iast_GLOBAL (18.092 s) : 18092000, 18092000
.   : milestone, 18092000,
profiling (14.914 s) : 14914000, 14914000
.   : milestone, 14914000,
tracing (14.799 s) : 14799000, 14799000
.   : milestone, 14799000,
section candidate
no_agent (15.528 s) : 15528000, 15528000
.   : milestone, 15528000,
appsec (14.972 s) : 14972000, 14972000
.   : milestone, 14972000,
iast (18.584 s) : 18584000, 18584000
.   : milestone, 18584000,
iast_GLOBAL (17.99 s) : 17990000, 17990000
.   : milestone, 17990000,
profiling (15.313 s) : 15313000, 15313000
.   : milestone, 15313000,
tracing (14.939 s) : 14939000, 14939000
.   : milestone, 14939000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.704 s [15.704 s, 15.704 s] -
appsec 14.656 s [14.656 s, 14.656 s] -1.048 s (-6.7%)
iast 18.731 s [18.731 s, 18.731 s] 3.027 s (19.3%)
iast_GLOBAL 18.092 s [18.092 s, 18.092 s] 2.388 s (15.2%)
profiling 14.914 s [14.914 s, 14.914 s] -790.0 ms (-5.0%)
tracing 14.799 s [14.799 s, 14.799 s] -905.0 ms (-5.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.528 s [15.528 s, 15.528 s] -
appsec 14.972 s [14.972 s, 14.972 s] -556.0 ms (-3.6%)
iast 18.584 s [18.584 s, 18.584 s] 3.056 s (19.7%)
iast_GLOBAL 17.99 s [17.99 s, 17.99 s] 2.462 s (15.9%)
profiling 15.313 s [15.313 s, 15.313 s] -215.0 ms (-1.4%)
tracing 14.939 s [14.939 s, 14.939 s] -589.0 ms (-3.8%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~2275e716e1, baseline=1.62.0-SNAPSHOT~6880c80c48
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.49 ms) : 1478, 1502
.   : milestone, 1490,
appsec (3.811 ms) : 3589, 4033
.   : milestone, 3811,
iast (2.277 ms) : 2207, 2346
.   : milestone, 2277,
iast_GLOBAL (2.323 ms) : 2252, 2393
.   : milestone, 2323,
profiling (2.09 ms) : 2035, 2144
.   : milestone, 2090,
tracing (2.074 ms) : 2021, 2128
.   : milestone, 2074,
section candidate
no_agent (1.486 ms) : 1474, 1498
.   : milestone, 1486,
appsec (3.838 ms) : 3616, 4061
.   : milestone, 3838,
iast (2.269 ms) : 2200, 2339
.   : milestone, 2269,
iast_GLOBAL (2.315 ms) : 2245, 2385
.   : milestone, 2315,
profiling (2.11 ms) : 2055, 2165
.   : milestone, 2110,
tracing (2.072 ms) : 2018, 2125
.   : milestone, 2072,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.49 ms [1.478 ms, 1.502 ms] -
appsec 3.811 ms [3.589 ms, 4.033 ms] 2.321 ms (155.8%)
iast 2.277 ms [2.207 ms, 2.346 ms] 786.739 µs (52.8%)
iast_GLOBAL 2.323 ms [2.252 ms, 2.393 ms] 832.689 µs (55.9%)
profiling 2.09 ms [2.035 ms, 2.144 ms] 599.805 µs (40.3%)
tracing 2.074 ms [2.021 ms, 2.128 ms] 584.396 µs (39.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.486 ms [1.474 ms, 1.498 ms] -
appsec 3.838 ms [3.616 ms, 4.061 ms] 2.352 ms (158.3%)
iast 2.269 ms [2.2 ms, 2.339 ms] 783.522 µs (52.7%)
iast_GLOBAL 2.315 ms [2.245 ms, 2.385 ms] 829.221 µs (55.8%)
profiling 2.11 ms [2.055 ms, 2.165 ms] 624.213 µs (42.0%)
tracing 2.072 ms [2.018 ms, 2.125 ms] 585.793 µs (39.4%)

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added the type: enhancement Enhancements and improvements label Mar 31, 2026
@dougqh
Copy link
Copy Markdown
Contributor

dougqh commented Apr 13, 2026

Besides just reviewing the code, I wanted to see how this change impacts our overhead.
Overall, the results are quite good...

  • throughput is mostly unchanged -- maybe slightly better in intermediate heap sizes
  • allocation is up, but only slightly -- this looks be from UTF-8 byte[] which can be solved with a bit of caching

I suspect throughput will improve once this branch is synchronized with master.
And we can easily add the caching later, since this protocol uses a de-duplicated string table, the increase is only 1%.

The cache will just help a little more by de-duplicating across payloads.

@AlexeyKuznetsov-DD
Copy link
Copy Markdown
Contributor Author

Besides just reviewing the code, I wanted to see how this change impacts our overhead. Overall, the results are quite good...

  • throughput is mostly unchanged -- maybe slightly better in intermediate heap sizes
  • allocation is up, but only slightly -- this looks be from UTF-8 byte[] which can be solved with a bit of caching

I suspect throughput will improve once this branch is synchronized with master. And we can easily add the caching later, since this protocol uses a de-duplicated string table, the increase is only 1%.

The cache will just help a little more by de-duplicating across payloads.

Yep, totally agree on caching, we can improve in follow up PRs.
PR is already too big, so I would prefer to merge it if there no obvious issues and continue to work in smaller PRs.
Thanks for feedback!

Copy link
Copy Markdown
Contributor

@dougqh dougqh left a comment

Choose a reason for hiding this comment

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

I have mostly left small comments that I've put throughout. Nothing critical in my view.
I do think getting one more review from someone familiar with the core would be good.

Comment thread dd-trace-api/src/main/java/datadog/trace/api/ProtocolVersion.java
Comment thread dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java Outdated
Comment thread dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java Outdated
Comment thread dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java
Comment thread dd-trace-core/src/main/java/datadog/trace/core/Metadata.java Outdated
Comment thread dd-trace-core/src/main/java/datadog/trace/core/CoreSpan.java Outdated
Comment thread dd-trace-api/src/main/java/datadog/trace/api/DDTraceId.java Outdated
Copy link
Copy Markdown
Contributor

@dougqh dougqh left a comment

Choose a reason for hiding this comment

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

One other performance suggestion from Claude...

  1. StringTable lookups force String materialization and Integer boxing — TraceMapperV1.java:1695-1706, :1832-1866
    Every tag name, tag value, service name, operation name, resource, component, etc. goes through:
    String str = value == null ? "" : value.toString();
    Integer index = stringTable.get(str);
    Two issues:
  • value.toString() allocates a new String for every UTF8BytesString / non-String CharSequence. Given V1 is a streaming string table design intended to amortize
    string cost, this re-materializes on every lookup and defeats part of the win.
  • HashMap<String,Integer>.get() autoboxes the returned index.

Consider a CharSequence-keyed open-addressed primitive int map (dd-trace already has UTF8ByteStringMap-like structures; verify). Even dropping to Eclipse
Collections' ObjectIntHashMap gets rid of boxing.

I'm guess StringTable is pre-existing. I agree with Claude that it would be nice to reduce the allocation especially the boxing.

But again, I'm fine with leaving this to a later PR.

Copy link
Copy Markdown
Contributor

@dougqh dougqh left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I added a couple comments based on asking Claude to do a perf review.
I do think optimizing might the ID to byte conversion would be good.
I suspect that is where some (most?) of the extra 2GiB of byte[] were coming from.

But I'm fine with doing that in a separate pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: do not merge Do not merge changes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants