Skip to content

Add OtlpWriter for OTLP traces export #11200

Open
mtoffl01 wants to merge 14 commits intomasterfrom
mtoff/otlp-writer
Open

Add OtlpWriter for OTLP traces export #11200
mtoffl01 wants to merge 14 commits intomasterfrom
mtoff/otlp-writer

Conversation

@mtoffl01
Copy link
Copy Markdown
Contributor

@mtoffl01 mtoffl01 commented Apr 24, 2026

What Does This Do

Adds a new OtlpWriter that sends Datadog traces via OTLP -- HTTP/protobuf (default) or gRPC -- to a collector endpoint. This new writer type is auto-selected when OTEL_TRACES_EXPORTER=otlp is set and is otherwise off by default.

New components:

  • OtlpWriter + OtlpPayloadDispatcher
  • OTLP branch in WriterFactory driven by Config.getOtlpTraces*() getters
  • Config plumbing for traceOtelExporterOtlpWriter selection

Motivation

This PR builds on existing work that serializes Datadog spans in OTLP format by providing an "Otlp" writer mechanism for forwarding the data to a configurable endpoint.

Additional Notes

Much of the code was AI generated but based on a relatively detailed plan that I pre-approved before starting the code generation. This PR passes system tests: DataDog/system-tests#6819

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 24, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mtoff/otlp-writer
git_commit_date 1777386837 1777404848
git_commit_sha e6cac64 491533b
release_version 1.62.0-SNAPSHOT~e6cac64dfd 1.62.0-SNAPSHOT~491533bc5f
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1777407417 1777407417
ci_job_id 1639666599 1639666599
ci_pipeline_id 110262987 110262987
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-mjabj2yk 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-mjabj2yk 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 61 metrics, 10 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063954
Total [baseline] (8.827 s) : 0, 8827127
Agent [candidate] (1.065 s) : 0, 1064546
Total [candidate] (8.86 s) : 0, 8860284
section iast
Agent [baseline] (1.247 s) : 0, 1247278
Total [baseline] (9.522 s) : 0, 9522184
Agent [candidate] (1.241 s) : 0, 1241144
Total [candidate] (9.533 s) : 0, 9532897
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.064 s -
Agent iast 1.247 s 183.324 ms (17.2%)
Total tracing 8.827 s -
Total iast 9.522 s 695.058 ms (7.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.065 s -
Agent iast 1.241 s 176.597 ms (16.6%)
Total tracing 8.86 s -
Total iast 9.533 s 672.613 ms (7.6%)
gantt
    title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.223 ms) : 0, 1223
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (636.134 ms) : 0, 636134
BytebuddyAgent [candidate] (636.167 ms) : 0, 636167
AgentMeter [baseline] (29.397 ms) : 0, 29397
AgentMeter [candidate] (29.394 ms) : 0, 29394
GlobalTracer [baseline] (248.776 ms) : 0, 248776
GlobalTracer [candidate] (248.906 ms) : 0, 248906
AppSec [baseline] (32.828 ms) : 0, 32828
AppSec [candidate] (32.757 ms) : 0, 32757
Debugger [baseline] (60.045 ms) : 0, 60045
Debugger [candidate] (59.966 ms) : 0, 59966
Remote Config [baseline] (608.052 µs) : 0, 608
Remote Config [candidate] (608.447 µs) : 0, 608
Telemetry [baseline] (9.889 ms) : 0, 9889
Telemetry [candidate] (8.358 ms) : 0, 8358
Flare Poller [baseline] (9.015 ms) : 0, 9015
Flare Poller [candidate] (11.23 ms) : 0, 11230
section iast
crashtracking [baseline] (1.234 ms) : 0, 1234
crashtracking [candidate] (1.21 ms) : 0, 1210
BytebuddyAgent [baseline] (824.563 ms) : 0, 824563
BytebuddyAgent [candidate] (821.633 ms) : 0, 821633
AgentMeter [baseline] (11.413 ms) : 0, 11413
AgentMeter [candidate] (11.281 ms) : 0, 11281
GlobalTracer [baseline] (239.431 ms) : 0, 239431
GlobalTracer [candidate] (237.548 ms) : 0, 237548
AppSec [baseline] (32.479 ms) : 0, 32479
AppSec [candidate] (30.588 ms) : 0, 30588
Debugger [baseline] (62.689 ms) : 0, 62689
Debugger [candidate] (62.168 ms) : 0, 62168
Remote Config [baseline] (522.555 µs) : 0, 523
Remote Config [candidate] (513.202 µs) : 0, 513
Telemetry [baseline] (7.897 ms) : 0, 7897
Telemetry [candidate] (7.899 ms) : 0, 7899
Flare Poller [baseline] (3.348 ms) : 0, 3348
Flare Poller [candidate] (3.348 ms) : 0, 3348
IAST [baseline] (27.561 ms) : 0, 27561
IAST [candidate] (29.002 ms) : 0, 29002
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.065 s) : 0, 1064569
Total [baseline] (11.04 s) : 0, 11040175
Agent [candidate] (1.066 s) : 0, 1065929
Total [candidate] (11.031 s) : 0, 11030501
section appsec
Agent [baseline] (1.271 s) : 0, 1270692
Total [baseline] (11.156 s) : 0, 11155977
Agent [candidate] (1.265 s) : 0, 1265180
Total [candidate] (11.052 s) : 0, 11051624
section iast
Agent [baseline] (1.25 s) : 0, 1249592
Total [baseline] (11.278 s) : 0, 11278173
Agent [candidate] (1.254 s) : 0, 1253616
Total [candidate] (11.321 s) : 0, 11320819
section profiling
Agent [baseline] (1.187 s) : 0, 1187311
Total [baseline] (11.067 s) : 0, 11066698
Agent [candidate] (1.185 s) : 0, 1185496
Total [candidate] (11.058 s) : 0, 11057786
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.065 s -
Agent appsec 1.271 s 206.122 ms (19.4%)
Agent iast 1.25 s 185.023 ms (17.4%)
Agent profiling 1.187 s 122.742 ms (11.5%)
Total tracing 11.04 s -
Total appsec 11.156 s 115.802 ms (1.0%)
Total iast 11.278 s 237.998 ms (2.2%)
Total profiling 11.067 s 26.523 ms (0.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent appsec 1.265 s 199.252 ms (18.7%)
Agent iast 1.254 s 187.687 ms (17.6%)
Agent profiling 1.185 s 119.568 ms (11.2%)
Total tracing 11.031 s -
Total appsec 11.052 s 21.123 ms (0.2%)
Total iast 11.321 s 290.318 ms (2.6%)
Total profiling 11.058 s 27.285 ms (0.2%)
gantt
    title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.215 ms) : 0, 1215
crashtracking [candidate] (1.218 ms) : 0, 1218
BytebuddyAgent [baseline] (635.54 ms) : 0, 635540
BytebuddyAgent [candidate] (635.361 ms) : 0, 635361
AgentMeter [baseline] (29.478 ms) : 0, 29478
AgentMeter [candidate] (29.269 ms) : 0, 29269
GlobalTracer [baseline] (248.557 ms) : 0, 248557
GlobalTracer [candidate] (249.567 ms) : 0, 249567
AppSec [baseline] (32.731 ms) : 0, 32731
AppSec [candidate] (33.015 ms) : 0, 33015
Debugger [baseline] (60.591 ms) : 0, 60591
Debugger [candidate] (61.067 ms) : 0, 61067
Remote Config [baseline] (606.544 µs) : 0, 607
Remote Config [candidate] (610.794 µs) : 0, 611
Telemetry [baseline] (8.359 ms) : 0, 8359
Telemetry [candidate] (9.963 ms) : 0, 9963
Flare Poller [baseline] (11.448 ms) : 0, 11448
Flare Poller [candidate] (9.887 ms) : 0, 9887
section appsec
crashtracking [baseline] (1.227 ms) : 0, 1227
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (677.819 ms) : 0, 677819
BytebuddyAgent [candidate] (675.14 ms) : 0, 675140
AgentMeter [baseline] (12.32 ms) : 0, 12320
AgentMeter [candidate] (12.315 ms) : 0, 12315
GlobalTracer [baseline] (250.303 ms) : 0, 250303
GlobalTracer [candidate] (249.197 ms) : 0, 249197
AppSec [baseline] (185.862 ms) : 0, 185862
AppSec [candidate] (184.836 ms) : 0, 184836
Debugger [baseline] (65.227 ms) : 0, 65227
Debugger [candidate] (64.566 ms) : 0, 64566
Remote Config [baseline] (567.303 µs) : 0, 567
Remote Config [candidate] (566.8 µs) : 0, 567
Telemetry [baseline] (7.897 ms) : 0, 7897
Telemetry [candidate] (7.729 ms) : 0, 7729
Flare Poller [baseline] (8.051 ms) : 0, 8051
Flare Poller [candidate] (6.171 ms) : 0, 6171
IAST [baseline] (24.694 ms) : 0, 24694
IAST [candidate] (24.606 ms) : 0, 24606
section iast
crashtracking [baseline] (1.229 ms) : 0, 1229
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (827.354 ms) : 0, 827354
BytebuddyAgent [candidate] (830.429 ms) : 0, 830429
AgentMeter [baseline] (11.344 ms) : 0, 11344
AgentMeter [candidate] (11.408 ms) : 0, 11408
GlobalTracer [baseline] (238.247 ms) : 0, 238247
GlobalTracer [candidate] (239.193 ms) : 0, 239193
AppSec [baseline] (30.002 ms) : 0, 30002
AppSec [candidate] (30.675 ms) : 0, 30675
Debugger [baseline] (63.67 ms) : 0, 63670
Debugger [candidate] (63.571 ms) : 0, 63571
Remote Config [baseline] (524.381 µs) : 0, 524
Remote Config [candidate] (528.012 µs) : 0, 528
Telemetry [baseline] (7.993 ms) : 0, 7993
Telemetry [candidate] (7.974 ms) : 0, 7974
Flare Poller [baseline] (3.365 ms) : 0, 3365
Flare Poller [candidate] (3.354 ms) : 0, 3354
IAST [baseline] (29.784 ms) : 0, 29784
IAST [candidate] (29.09 ms) : 0, 29090
section profiling
crashtracking [baseline] (1.186 ms) : 0, 1186
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (693.344 ms) : 0, 693344
BytebuddyAgent [candidate] (691.457 ms) : 0, 691457
AgentMeter [baseline] (8.946 ms) : 0, 8946
AgentMeter [candidate] (8.868 ms) : 0, 8868
GlobalTracer [baseline] (207.937 ms) : 0, 207937
GlobalTracer [candidate] (207.656 ms) : 0, 207656
AppSec [baseline] (32.674 ms) : 0, 32674
AppSec [candidate] (32.782 ms) : 0, 32782
Debugger [baseline] (65.761 ms) : 0, 65761
Debugger [candidate] (65.753 ms) : 0, 65753
Remote Config [baseline] (567.771 µs) : 0, 568
Remote Config [candidate] (572.159 µs) : 0, 572
Telemetry [baseline] (8.116 ms) : 0, 8116
Telemetry [candidate] (8.07 ms) : 0, 8070
Flare Poller [baseline] (3.551 ms) : 0, 3551
Flare Poller [candidate] (3.552 ms) : 0, 3552
ProfilingAgent [baseline] (93.758 ms) : 0, 93758
ProfilingAgent [candidate] (94.321 ms) : 0, 94321
Profiling [baseline] (94.338 ms) : 0, 94338
Profiling [candidate] (94.899 ms) : 0, 94899
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mtoff/otlp-writer
git_commit_date 1777386837 1777404848
git_commit_sha e6cac64 491533b
release_version 1.62.0-SNAPSHOT~e6cac64dfd 1.62.0-SNAPSHOT~491533bc5f
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1777407901 1777407901
ci_job_id 1639666600 1639666600
ci_pipeline_id 110262987 110262987
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-3-dwftqts1 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-3-dwftqts1 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 1 performance regressions! Performance is the same for 16 metrics, 19 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:petclinic:code_origins:high_load worse
[+0.738ms; +1.876ms] or [+4.266%; +10.845%]
unsure
[+0.351ms; +2.478ms] or [+1.239%; +8.743%]
unstable
[-47.748op/s; +2.986op/s] or [-17.672%; +1.105%]
18.604ms 29.758ms 247.812op/s 17.297ms 28.343ms 270.194op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.246 ms) : 1234, 1258
.   : milestone, 1246,
iast (3.304 ms) : 3256, 3352
.   : milestone, 3304,
iast_FULL (6.017 ms) : 5956, 6078
.   : milestone, 6017,
iast_GLOBAL (3.665 ms) : 3594, 3735
.   : milestone, 3665,
profiling (2.266 ms) : 2244, 2288
.   : milestone, 2266,
tracing (1.899 ms) : 1883, 1914
.   : milestone, 1899,
section candidate
no_agent (1.27 ms) : 1257, 1284
.   : milestone, 1270,
iast (3.355 ms) : 3306, 3403
.   : milestone, 3355,
iast_FULL (6.114 ms) : 6051, 6176
.   : milestone, 6114,
iast_GLOBAL (3.65 ms) : 3587, 3713
.   : milestone, 3650,
profiling (2.339 ms) : 2317, 2362
.   : milestone, 2339,
tracing (1.89 ms) : 1874, 1906
.   : milestone, 1890,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.246 ms [1.234 ms, 1.258 ms] -
iast 3.304 ms [3.256 ms, 3.352 ms] 2.058 ms (165.2%)
iast_FULL 6.017 ms [5.956 ms, 6.078 ms] 4.771 ms (382.9%)
iast_GLOBAL 3.665 ms [3.594 ms, 3.735 ms] 2.419 ms (194.1%)
profiling 2.266 ms [2.244 ms, 2.288 ms] 1.02 ms (81.8%)
tracing 1.899 ms [1.883 ms, 1.914 ms] 652.548 µs (52.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.27 ms [1.257 ms, 1.284 ms] -
iast 3.355 ms [3.306 ms, 3.403 ms] 2.084 ms (164.1%)
iast_FULL 6.114 ms [6.051 ms, 6.176 ms] 4.843 ms (381.2%)
iast_GLOBAL 3.65 ms [3.587 ms, 3.713 ms] 2.379 ms (187.3%)
profiling 2.339 ms [2.317 ms, 2.362 ms] 1.069 ms (84.1%)
tracing 1.89 ms [1.874 ms, 1.906 ms] 619.227 µs (48.7%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd
    dateFormat X
    axisFormat %s
section baseline
no_agent (17.026 ms) : 16858, 17193
.   : milestone, 17026,
appsec (18.595 ms) : 18405, 18785
.   : milestone, 18595,
code_origins (17.83 ms) : 17654, 18006
.   : milestone, 17830,
iast (17.828 ms) : 17652, 18004
.   : milestone, 17828,
profiling (18.234 ms) : 18056, 18413
.   : milestone, 18234,
tracing (18.261 ms) : 18079, 18443
.   : milestone, 18261,
section candidate
no_agent (17.261 ms) : 17092, 17430
.   : milestone, 17261,
appsec (18.65 ms) : 18462, 18838
.   : milestone, 18650,
code_origins (18.835 ms) : 18646, 19023
.   : milestone, 18835,
iast (17.769 ms) : 17595, 17943
.   : milestone, 17769,
profiling (18.357 ms) : 18173, 18542
.   : milestone, 18357,
tracing (18.027 ms) : 17849, 18205
.   : milestone, 18027,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.026 ms [16.858 ms, 17.193 ms] -
appsec 18.595 ms [18.405 ms, 18.785 ms] 1.57 ms (9.2%)
code_origins 17.83 ms [17.654 ms, 18.006 ms] 804.554 µs (4.7%)
iast 17.828 ms [17.652 ms, 18.004 ms] 802.192 µs (4.7%)
profiling 18.234 ms [18.056 ms, 18.413 ms] 1.209 ms (7.1%)
tracing 18.261 ms [18.079 ms, 18.443 ms] 1.236 ms (7.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.261 ms [17.092 ms, 17.43 ms] -
appsec 18.65 ms [18.462 ms, 18.838 ms] 1.389 ms (8.0%)
code_origins 18.835 ms [18.646 ms, 19.023 ms] 1.574 ms (9.1%)
iast 17.769 ms [17.595 ms, 17.943 ms] 507.931 µs (2.9%)
profiling 18.357 ms [18.173 ms, 18.542 ms] 1.096 ms (6.4%)
tracing 18.027 ms [17.849 ms, 18.205 ms] 765.861 µs (4.4%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mtoff/otlp-writer
git_commit_date 1777386837 1777404848
git_commit_sha e6cac64 491533b
release_version 1.62.0-SNAPSHOT~e6cac64dfd 1.62.0-SNAPSHOT~491533bc5f
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1777407671 1777407671
ci_job_id 1639666603 1639666603
ci_pipeline_id 110262987 110262987
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-m2ig4k46 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-m2ig4k46 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.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.497 s) : 15497000, 15497000
.   : milestone, 15497000,
appsec (14.557 s) : 14557000, 14557000
.   : milestone, 14557000,
iast (18.188 s) : 18188000, 18188000
.   : milestone, 18188000,
iast_GLOBAL (17.884 s) : 17884000, 17884000
.   : milestone, 17884000,
profiling (15.197 s) : 15197000, 15197000
.   : milestone, 15197000,
tracing (14.645 s) : 14645000, 14645000
.   : milestone, 14645000,
section candidate
no_agent (15.502 s) : 15502000, 15502000
.   : milestone, 15502000,
appsec (14.683 s) : 14683000, 14683000
.   : milestone, 14683000,
iast (18.257 s) : 18257000, 18257000
.   : milestone, 18257000,
iast_GLOBAL (18.076 s) : 18076000, 18076000
.   : milestone, 18076000,
profiling (15.252 s) : 15252000, 15252000
.   : milestone, 15252000,
tracing (14.806 s) : 14806000, 14806000
.   : milestone, 14806000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.497 s [15.497 s, 15.497 s] -
appsec 14.557 s [14.557 s, 14.557 s] -940.0 ms (-6.1%)
iast 18.188 s [18.188 s, 18.188 s] 2.691 s (17.4%)
iast_GLOBAL 17.884 s [17.884 s, 17.884 s] 2.387 s (15.4%)
profiling 15.197 s [15.197 s, 15.197 s] -300.0 ms (-1.9%)
tracing 14.645 s [14.645 s, 14.645 s] -852.0 ms (-5.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.502 s [15.502 s, 15.502 s] -
appsec 14.683 s [14.683 s, 14.683 s] -819.0 ms (-5.3%)
iast 18.257 s [18.257 s, 18.257 s] 2.755 s (17.8%)
iast_GLOBAL 18.076 s [18.076 s, 18.076 s] 2.574 s (16.6%)
profiling 15.252 s [15.252 s, 15.252 s] -250.0 ms (-1.6%)
tracing 14.806 s [14.806 s, 14.806 s] -696.0 ms (-4.5%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~491533bc5f, baseline=1.62.0-SNAPSHOT~e6cac64dfd
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.485 ms) : 1473, 1496
.   : milestone, 1485,
appsec (3.863 ms) : 3638, 4088
.   : milestone, 3863,
iast (2.285 ms) : 2215, 2356
.   : milestone, 2285,
iast_GLOBAL (2.337 ms) : 2266, 2408
.   : milestone, 2337,
profiling (2.102 ms) : 2047, 2157
.   : milestone, 2102,
tracing (2.094 ms) : 2039, 2148
.   : milestone, 2094,
section candidate
no_agent (1.491 ms) : 1480, 1503
.   : milestone, 1491,
appsec (3.817 ms) : 3594, 4039
.   : milestone, 3817,
iast (2.283 ms) : 2212, 2353
.   : milestone, 2283,
iast_GLOBAL (2.328 ms) : 2257, 2399
.   : milestone, 2328,
profiling (2.102 ms) : 2047, 2157
.   : milestone, 2102,
tracing (2.089 ms) : 2034, 2143
.   : milestone, 2089,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.485 ms [1.473 ms, 1.496 ms] -
appsec 3.863 ms [3.638 ms, 4.088 ms] 2.379 ms (160.2%)
iast 2.285 ms [2.215 ms, 2.356 ms] 800.478 µs (53.9%)
iast_GLOBAL 2.337 ms [2.266 ms, 2.408 ms] 852.788 µs (57.4%)
profiling 2.102 ms [2.047 ms, 2.157 ms] 617.043 µs (41.6%)
tracing 2.094 ms [2.039 ms, 2.148 ms] 608.887 µs (41.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.491 ms [1.48 ms, 1.503 ms] -
appsec 3.817 ms [3.594 ms, 4.039 ms] 2.325 ms (155.9%)
iast 2.283 ms [2.212 ms, 2.353 ms] 791.652 µs (53.1%)
iast_GLOBAL 2.328 ms [2.257 ms, 2.399 ms] 836.768 µs (56.1%)
profiling 2.102 ms [2.047 ms, 2.157 ms] 610.657 µs (40.9%)
tracing 2.089 ms [2.034 ms, 2.143 ms] 597.214 µs (40.0%)

@mcculls mcculls self-requested a review April 27, 2026 09:27
@Override
public void flush() {
OtlpPayload payload = collector.collectTraces();
if (payload.getContentLength() > 0) {
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.

Suggested change
if (payload.getContentLength() > 0) {
if (payload != OtlpPayload.EMPTY) {

for consistency with OtlpMetricsService (just in case in the future we have payloads that don't declare their content length up-front)


@Override
public void onDroppedTrace(int spanCount) {
// TODO: surface drop counts via HealthMetrics
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've purposefully left this out as its not in the current spec

@mtoffl01 mtoffl01 marked this pull request as ready for review April 27, 2026 20:16
@mtoffl01 mtoffl01 requested review from a team as code owners April 27, 2026 20:16
@mtoffl01 mtoffl01 requested review from mcculls and removed request for a team April 27, 2026 20:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

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.

@mtoffl01 mtoffl01 changed the title Implement OTLPWriter Add OtlpWriter for OTLP-based trace export Apr 27, 2026
@mtoffl01 mtoffl01 added the tag: ai generated Largely based on code generated by an AI or LLM label Apr 27, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4333c2d0ac

ℹ️ 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".

Comment on lines +129 to +131
protocol == OtlpConfig.Protocol.GRPC
? new OtlpGrpcSender(
endpoint, TRACES_SIGNAL_PATH, headers, timeoutMillis, compression)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Send OTLP gRPC traces to TraceService export path

In OtlpWriterBuilder.build, the gRPC branch passes TRACES_SIGNAL_PATH (/v1/traces) to OtlpGrpcSender, but that sender emits application/grpc requests and needs a gRPC method path (as shown by metrics using /opentelemetry.proto.collector.metrics.v1.MetricsService/Export). With the current path, OTLP collectors will reject the request (typically 404/UNIMPLEMENTED), so trace export fails whenever otlp.traces.protocol=grpc is used.

Useful? React with 👍 / 👎.

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.

Yes - I believe the GRPC sender should use

"/opentelemetry.proto.collector.trace.v1.TraceService/Export"

while the HTTP sender should use

"/v1/traces"


private static boolean shouldExport(CoreSpan<?> span) {
// trace-level sampling priority
if (span.samplingPriority() > 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow OTLP export when sampling priority is UNSET

shouldExport drops any span whose samplingPriority() is not > 0 unless span-sampling tags are present. In configurations that legitimately publish traces without priority sampling (for example DD_PRIORITY_SAMPLING=false with AllSampler), spans are published but keep UNSET priority, so this filter discards every span and OTLP emits nothing. Since tracing already decided to publish upstream, UNSET should not be treated as an automatic drop here.

Useful? React with 👍 / 👎.

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.

The default payload dispatcher doesn't have this extra sampling check - it just assumes that anything reaching the dispatcher should be exported. Is there a reason we have this additional check for OTLP?

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.

As per the spec:

only export spans that have been sampled

private final OtlpSender sender;

OtlpPayloadDispatcher(OtlpSender sender) {
this(sender, OtlpTraceProtoCollector.INSTANCE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allocate a collector per OTLP payload dispatcher

The default dispatcher constructor reuses OtlpTraceProtoCollector.INSTANCE for all OtlpWriter instances, but that collector maintains mutable state and is documented as single-threaded. If more than one OTLP writer exists in-process (e.g., multiple tracers or MultiWriter compositions), serializer threads will concurrently mutate shared collector state, which can corrupt payload assembly or mix traces across writers.

Useful? React with 👍 / 👎.

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 don't believe we ever have a scenario where multiple OtlpWriters are initialized 🤔

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.

Correct - there should only ever be at most one OtlpWriter initialized.

But since OtlpTraceProtoCollector is only ever used inside this class we could always drop the OtlpTraceProtoCollector.INSTANCE field (as we don't need to share the instance across classes) and construct OtlpTraceProtoCollector in this constructor.

@mtoffl01 mtoffl01 added type: enhancement Enhancements and improvements comp: core Tracer core labels Apr 27, 2026
@mtoffl01 mtoffl01 changed the title Add OtlpWriter for OTLP-based trace export Add OtlpWriter for OTLP traces export Apr 27, 2026
}
}
if (sampled != null) {
collector.addTrace(sampled);
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.

Is there a reason we can't just call collector.addTrace(trace) like the non-OTLP dispatcher does?

Copy link
Copy Markdown
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

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

Just one Q about the extra sampling in OtlpPayloadDispatcher (if this is not needed then removing it may help with the E2E test) - and the GRPC signal path needs fixing.

@mtoffl01 mtoffl01 changed the base branch from master to mtoff/otlp-traces-sampler April 28, 2026 19:05
@mtoffl01 mtoffl01 force-pushed the mtoff/otlp-writer branch from f7b12c1 to 491533b Compare April 28, 2026 19:43
Base automatically changed from mtoff/otlp-traces-sampler to master April 28, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants