Skip to content

Simplify context propagation #8719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 14, 2025
Merged

Simplify context propagation #8719

merged 5 commits into from
May 14, 2025

Conversation

PerfectSlayer
Copy link
Contributor

@PerfectSlayer PerfectSlayer commented Apr 22, 2025

What Does This Do

Avoid adding terminated contexts as span links and clearing them if not needed.

Motivation

The recent trace propagation behavior complicated the context propagation and ended up creating span links that can be clear if context is restart.
In addition, it can unexpectedly void customer manually added span links too.

Additional Notes

Contributor Checklist

Jira ticket: LANGPLAT-452

@pr-commenter
Copy link

pr-commenter bot commented Apr 22, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/trace-propagation
git_commit_date 1747175449 1747199146
git_commit_sha 0903cf4 30b0291
release_version 1.50.0-SNAPSHOT~0903cf408b 1.50.0-SNAPSHOT~30b0291160
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1747201664 1747201664
ci_job_id 937175022 937175022
ci_pipeline_id 65027151 65027151
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-drbnw7cb-project-304-concurrent-0-zrdcwb2i 6.8.0-1028-aws #30~22.04.1-Ubuntu SMP Sun Apr 20 06:03:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-drbnw7cb-project-304-concurrent-0-zrdcwb2i 6.8.0-1028-aws #30~22.04.1-Ubuntu SMP Sun Apr 20 06:03:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.021 s) : 0, 1020933
Total [baseline] (10.446 s) : 0, 10446353
Agent [candidate] (1.018 s) : 0, 1018136
Total [candidate] (10.461 s) : 0, 10461041
section appsec
Agent [baseline] (1.164 s) : 0, 1163500
Total [baseline] (10.665 s) : 0, 10665048
Agent [candidate] (1.16 s) : 0, 1160343
Total [candidate] (10.695 s) : 0, 10695480
section iast
Agent [baseline] (1.151 s) : 0, 1150608
Total [baseline] (10.908 s) : 0, 10908148
Agent [candidate] (1.16 s) : 0, 1159663
Total [candidate] (10.926 s) : 0, 10925822
section profiling
Agent [baseline] (1.29 s) : 0, 1289542
Total [baseline] (10.944 s) : 0, 10944249
Agent [candidate] (1.278 s) : 0, 1277827
Total [candidate] (10.823 s) : 0, 10822741
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.021 s -
Agent appsec 1.164 s 142.567 ms (14.0%)
Agent iast 1.151 s 129.674 ms (12.7%)
Agent profiling 1.29 s 268.608 ms (26.3%)
Total tracing 10.446 s -
Total appsec 10.665 s 218.695 ms (2.1%)
Total iast 10.908 s 461.795 ms (4.4%)
Total profiling 10.944 s 497.896 ms (4.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.018 s -
Agent appsec 1.16 s 142.207 ms (14.0%)
Agent iast 1.16 s 141.527 ms (13.9%)
Agent profiling 1.278 s 259.692 ms (25.5%)
Total tracing 10.461 s -
Total appsec 10.695 s 234.439 ms (2.2%)
Total iast 10.926 s 464.781 ms (4.4%)
Total profiling 10.823 s 361.7 ms (3.5%)
gantt
    title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (684.721 ms) : 0, 684721
BytebuddyAgent [candidate] (682.752 ms) : 0, 682752
GlobalTracer [baseline] (241.001 ms) : 0, 241001
GlobalTracer [candidate] (240.184 ms) : 0, 240184
AppSec [baseline] (54.58 ms) : 0, 54580
AppSec [candidate] (54.176 ms) : 0, 54176
Debugger [baseline] (6.977 ms) : 0, 6977
Debugger [candidate] (7.601 ms) : 0, 7601
Remote Config [baseline] (714.529 µs) : 0, 715
Remote Config [candidate] (708.079 µs) : 0, 708
Telemetry [baseline] (9.133 ms) : 0, 9133
Telemetry [candidate] (9.068 ms) : 0, 9068
section appsec
BytebuddyAgent [baseline] (702.03 ms) : 0, 702030
BytebuddyAgent [candidate] (699.998 ms) : 0, 699998
GlobalTracer [baseline] (237.077 ms) : 0, 237077
GlobalTracer [candidate] (236.571 ms) : 0, 236571
AppSec [baseline] (175.845 ms) : 0, 175845
AppSec [candidate] (175.062 ms) : 0, 175062
Debugger [baseline] (5.933 ms) : 0, 5933
Debugger [candidate] (5.958 ms) : 0, 5958
Remote Config [baseline] (626.461 µs) : 0, 626
Remote Config [candidate] (624.096 µs) : 0, 624
Telemetry [baseline] (7.41 ms) : 0, 7410
Telemetry [candidate] (7.777 ms) : 0, 7777
IAST [baseline] (21.853 ms) : 0, 21853
IAST [candidate] (21.542 ms) : 0, 21542
section iast
BytebuddyAgent [baseline] (803.697 ms) : 0, 803697
BytebuddyAgent [candidate] (809.813 ms) : 0, 809813
GlobalTracer [baseline] (230.546 ms) : 0, 230546
GlobalTracer [candidate] (232.421 ms) : 0, 232421
AppSec [baseline] (51.954 ms) : 0, 51954
AppSec [candidate] (52.369 ms) : 0, 52369
Debugger [baseline] (5.945 ms) : 0, 5945
Debugger [candidate] (5.86 ms) : 0, 5860
Remote Config [baseline] (593.724 µs) : 0, 594
Remote Config [candidate] (610.468 µs) : 0, 610
Telemetry [baseline] (7.809 ms) : 0, 7809
Telemetry [candidate] (7.859 ms) : 0, 7859
IAST [baseline] (25.784 ms) : 0, 25784
IAST [candidate] (26.918 ms) : 0, 26918
section profiling
BytebuddyAgent [baseline] (678.708 ms) : 0, 678708
BytebuddyAgent [candidate] (673.142 ms) : 0, 673142
GlobalTracer [baseline] (376.558 ms) : 0, 376558
GlobalTracer [candidate] (374.055 ms) : 0, 374055
AppSec [baseline] (62.646 ms) : 0, 62646
AppSec [candidate] (62.293 ms) : 0, 62293
Debugger [baseline] (6.409 ms) : 0, 6409
Debugger [candidate] (6.3 ms) : 0, 6300
Remote Config [baseline] (672.905 µs) : 0, 673
Remote Config [candidate] (675.403 µs) : 0, 675
Telemetry [baseline] (8.412 ms) : 0, 8412
Telemetry [candidate] (8.137 ms) : 0, 8137
ProfilingAgent [baseline] (104.962 ms) : 0, 104962
ProfilingAgent [candidate] (102.501 ms) : 0, 102501
Profiling [baseline] (104.987 ms) : 0, 104987
Profiling [candidate] (102.524 ms) : 0, 102524
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.022 s) : 0, 1022273
Total [baseline] (8.661 s) : 0, 8660790
Agent [candidate] (1.022 s) : 0, 1022117
Total [candidate] (8.67 s) : 0, 8669918
section iast
Agent [baseline] (1.155 s) : 0, 1154521
Total [baseline] (9.204 s) : 0, 9203917
Agent [candidate] (1.15 s) : 0, 1150302
Total [candidate] (9.218 s) : 0, 9218049
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.157 s) : 0, 1156868
Total [baseline] (9.197 s) : 0, 9196506
Agent [candidate] (1.165 s) : 0, 1165016
Total [candidate] (9.237 s) : 0, 9237011
section iast_TELEMETRY_OFF
Agent [baseline] (1.145 s) : 0, 1145258
Total [baseline] (9.256 s) : 0, 9255951
Agent [candidate] (1.15 s) : 0, 1149746
Total [candidate] (9.254 s) : 0, 9254485
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.022 s -
Agent iast 1.155 s 132.249 ms (12.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.157 s 134.596 ms (13.2%)
Agent iast_TELEMETRY_OFF 1.145 s 122.985 ms (12.0%)
Total tracing 8.661 s -
Total iast 9.204 s 543.127 ms (6.3%)
Total iast_HARDCODED_SECRET_DISABLED 9.197 s 535.716 ms (6.2%)
Total iast_TELEMETRY_OFF 9.256 s 595.161 ms (6.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.022 s -
Agent iast 1.15 s 128.184 ms (12.5%)
Agent iast_HARDCODED_SECRET_DISABLED 1.165 s 142.898 ms (14.0%)
Agent iast_TELEMETRY_OFF 1.15 s 127.628 ms (12.5%)
Total tracing 8.67 s -
Total iast 9.218 s 548.131 ms (6.3%)
Total iast_HARDCODED_SECRET_DISABLED 9.237 s 567.093 ms (6.5%)
Total iast_TELEMETRY_OFF 9.254 s 584.566 ms (6.7%)
gantt
    title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (683.981 ms) : 0, 683981
BytebuddyAgent [candidate] (682.385 ms) : 0, 682385
GlobalTracer [baseline] (240.549 ms) : 0, 240549
GlobalTracer [candidate] (239.702 ms) : 0, 239702
AppSec [baseline] (55.975 ms) : 0, 55975
AppSec [candidate] (55.338 ms) : 0, 55338
Debugger [baseline] (7.55 ms) : 0, 7550
Debugger [candidate] (8.331 ms) : 0, 8331
Remote Config [baseline] (706.451 µs) : 0, 706
Remote Config [candidate] (710.431 µs) : 0, 710
Telemetry [baseline] (9.848 ms) : 0, 9848
Telemetry [candidate] (12.046 ms) : 0, 12046
section iast
BytebuddyAgent [baseline] (806.643 ms) : 0, 806643
BytebuddyAgent [candidate] (802.536 ms) : 0, 802536
GlobalTracer [baseline] (231.112 ms) : 0, 231112
GlobalTracer [candidate] (230.841 ms) : 0, 230841
IAST [baseline] (28.483 ms) : 0, 28483
IAST [candidate] (27.581 ms) : 0, 27581
AppSec [baseline] (50.272 ms) : 0, 50272
AppSec [candidate] (51.367 ms) : 0, 51367
Debugger [baseline] (5.933 ms) : 0, 5933
Debugger [candidate] (5.921 ms) : 0, 5921
Remote Config [baseline] (613.742 µs) : 0, 614
Remote Config [candidate] (598.898 µs) : 0, 599
Telemetry [baseline] (7.906 ms) : 0, 7906
Telemetry [candidate] (7.924 ms) : 0, 7924
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (808.252 ms) : 0, 808252
BytebuddyAgent [candidate] (813.794 ms) : 0, 813794
GlobalTracer [baseline] (231.539 ms) : 0, 231539
GlobalTracer [candidate] (233.399 ms) : 0, 233399
IAST [baseline] (28.582 ms) : 0, 28582
IAST [candidate] (29.594 ms) : 0, 29594
AppSec [baseline] (50.436 ms) : 0, 50436
AppSec [candidate] (49.846 ms) : 0, 49846
Debugger [baseline] (5.884 ms) : 0, 5884
Debugger [candidate] (5.952 ms) : 0, 5952
Remote Config [baseline] (602.449 µs) : 0, 602
Remote Config [candidate] (606.282 µs) : 0, 606
Telemetry [baseline] (7.957 ms) : 0, 7957
Telemetry [candidate] (8.036 ms) : 0, 8036
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (799.203 ms) : 0, 799203
BytebuddyAgent [candidate] (800.607 ms) : 0, 800607
GlobalTracer [baseline] (230.577 ms) : 0, 230577
GlobalTracer [candidate] (232.283 ms) : 0, 232283
IAST [baseline] (22.987 ms) : 0, 22987
IAST [candidate] (23.378 ms) : 0, 23378
AppSec [baseline] (54.851 ms) : 0, 54851
AppSec [candidate] (54.648 ms) : 0, 54648
Debugger [baseline] (5.885 ms) : 0, 5885
Debugger [candidate] (5.982 ms) : 0, 5982
Remote Config [baseline] (592.171 µs) : 0, 592
Remote Config [candidate] (626.066 µs) : 0, 626
Telemetry [baseline] (7.685 ms) : 0, 7685
Telemetry [candidate] (7.794 ms) : 0, 7794
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-05-14T05:18:05 2025-05-14T05:25:51
git_branch master bbujon/trace-propagation
git_commit_date 1747175449 1747199146
git_commit_sha 0903cf4 30b0291
release_version 1.50.0-SNAPSHOT~0903cf408b 1.50.0-SNAPSHOT~30b0291160
start_time 2025-05-14T05:17:51 2025-05-14T05:25:37
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1747200749 1747200749
ci_job_id 937175023 937175023
ci_pipeline_id 65027151 65027151
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-bhsi38qb-project-304-concurrent-0-ka4iacge 6.8.0-1028-aws #30~22.04.1-Ubuntu SMP Sun Apr 20 06:03:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-bhsi38qb-project-304-concurrent-0-ka4iacge 6.8.0-1028-aws #30~22.04.1-Ubuntu SMP Sun Apr 20 06:03:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant iast iast

Summary

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

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.356 ms) : 1336, 1375
.   : milestone, 1356,
appsec (1.726 ms) : 1703, 1750
.   : milestone, 1726,
appsec_no_iast (1.745 ms) : 1721, 1768
.   : milestone, 1745,
code_origins (1.673 ms) : 1645, 1700
.   : milestone, 1673,
iast (1.52 ms) : 1496, 1544
.   : milestone, 1520,
profiling (1.574 ms) : 1549, 1599
.   : milestone, 1574,
tracing (1.491 ms) : 1466, 1516
.   : milestone, 1491,
section candidate
no_agent (1.361 ms) : 1341, 1380
.   : milestone, 1361,
appsec (1.712 ms) : 1689, 1736
.   : milestone, 1712,
appsec_no_iast (1.726 ms) : 1703, 1750
.   : milestone, 1726,
code_origins (1.649 ms) : 1622, 1676
.   : milestone, 1649,
iast (1.509 ms) : 1484, 1533
.   : milestone, 1509,
profiling (1.534 ms) : 1509, 1559
.   : milestone, 1534,
tracing (1.496 ms) : 1472, 1521
.   : milestone, 1496,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.356 ms [1.336 ms, 1.375 ms] -
appsec 1.726 ms [1.703 ms, 1.75 ms] 370.656 µs (27.3%)
appsec_no_iast 1.745 ms [1.721 ms, 1.768 ms] 388.876 µs (28.7%)
code_origins 1.673 ms [1.645 ms, 1.7 ms] 317.017 µs (23.4%)
iast 1.52 ms [1.496 ms, 1.544 ms] 164.602 µs (12.1%)
profiling 1.574 ms [1.549 ms, 1.599 ms] 218.288 µs (16.1%)
tracing 1.491 ms [1.466 ms, 1.516 ms] 135.598 µs (10.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.361 ms [1.341 ms, 1.38 ms] -
appsec 1.712 ms [1.689 ms, 1.736 ms] 351.578 µs (25.8%)
appsec_no_iast 1.726 ms [1.703 ms, 1.75 ms] 365.813 µs (26.9%)
code_origins 1.649 ms [1.622 ms, 1.676 ms] 288.068 µs (21.2%)
iast 1.509 ms [1.484 ms, 1.533 ms] 148.131 µs (10.9%)
profiling 1.534 ms [1.509 ms, 1.559 ms] 173.257 µs (12.7%)
tracing 1.496 ms [1.472 ms, 1.521 ms] 135.703 µs (10.0%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b
    dateFormat X
    axisFormat %s
section baseline
no_agent (385.976 µs) : 366, 406
.   : milestone, 386,
iast (521.471 µs) : 499, 544
.   : milestone, 521,
iast_FULL (731.506 µs) : 709, 754
.   : milestone, 732,
iast_GLOBAL (571.172 µs) : 549, 593
.   : milestone, 571,
iast_HARDCODED_SECRET_DISABLED (526.626 µs) : 503, 550
.   : milestone, 527,
iast_INACTIVE (461.326 µs) : 439, 484
.   : milestone, 461,
iast_TELEMETRY_OFF (506.399 µs) : 484, 529
.   : milestone, 506,
tracing (466.703 µs) : 444, 489
.   : milestone, 467,
section candidate
no_agent (382.459 µs) : 362, 403
.   : milestone, 382,
iast (514.054 µs) : 492, 536
.   : milestone, 514,
iast_FULL (736.171 µs) : 714, 758
.   : milestone, 736,
iast_GLOBAL (557.15 µs) : 535, 579
.   : milestone, 557,
iast_HARDCODED_SECRET_DISABLED (524.506 µs) : 502, 547
.   : milestone, 525,
iast_INACTIVE (469.423 µs) : 447, 492
.   : milestone, 469,
iast_TELEMETRY_OFF (515.865 µs) : 493, 539
.   : milestone, 516,
tracing (460.479 µs) : 438, 483
.   : milestone, 460,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 385.976 µs [365.899 µs, 406.052 µs] -
iast 521.471 µs [499.132 µs, 543.811 µs] 135.496 µs (35.1%)
iast_FULL 731.506 µs [709.481 µs, 753.532 µs] 345.531 µs (89.5%)
iast_GLOBAL 571.172 µs [548.996 µs, 593.347 µs] 185.196 µs (48.0%)
iast_HARDCODED_SECRET_DISABLED 526.626 µs [503.056 µs, 550.196 µs] 140.651 µs (36.4%)
iast_INACTIVE 461.326 µs [438.966 µs, 483.686 µs] 75.35 µs (19.5%)
iast_TELEMETRY_OFF 506.399 µs [483.518 µs, 529.279 µs] 120.423 µs (31.2%)
tracing 466.703 µs [444.216 µs, 489.189 µs] 80.727 µs (20.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 382.459 µs [362.293 µs, 402.626 µs] -
iast 514.054 µs [492.252 µs, 535.857 µs] 131.595 µs (34.4%)
iast_FULL 736.171 µs [714.234 µs, 758.109 µs] 353.712 µs (92.5%)
iast_GLOBAL 557.15 µs [535.389 µs, 578.912 µs] 174.691 µs (45.7%)
iast_HARDCODED_SECRET_DISABLED 524.506 µs [501.69 µs, 547.322 µs] 142.047 µs (37.1%)
iast_INACTIVE 469.423 µs [446.713 µs, 492.133 µs] 86.964 µs (22.7%)
iast_TELEMETRY_OFF 515.865 µs [492.524 µs, 539.206 µs] 133.406 µs (34.9%)
tracing 460.479 µs [438.348 µs, 482.609 µs] 78.02 µs (20.4%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/trace-propagation
git_commit_date 1747175449 1747199146
git_commit_sha 0903cf4 30b0291
release_version 1.50.0-SNAPSHOT~0903cf408b 1.50.0-SNAPSHOT~30b0291160
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1747201290 1747201290
ci_job_id 937175024 937175024
ci_pipeline_id 65027151 65027151
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-drbnw7cb-project-304-concurrent-1-njws0n1j 6.8.0-1028-aws #30~22.04.1-Ubuntu SMP Sun Apr 20 06:03:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-drbnw7cb-project-304-concurrent-1-njws0n1j 6.8.0-1028-aws #30~22.04.1-Ubuntu SMP Sun Apr 20 06:03:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.267 s) : 15267000, 15267000
.   : milestone, 15267000,
appsec (15.015 s) : 15015000, 15015000
.   : milestone, 15015000,
iast (19.04 s) : 19040000, 19040000
.   : milestone, 19040000,
iast_GLOBAL (18.144 s) : 18144000, 18144000
.   : milestone, 18144000,
profiling (15.411 s) : 15411000, 15411000
.   : milestone, 15411000,
tracing (15.099 s) : 15099000, 15099000
.   : milestone, 15099000,
section candidate
no_agent (15.656 s) : 15656000, 15656000
.   : milestone, 15656000,
appsec (14.677 s) : 14677000, 14677000
.   : milestone, 14677000,
iast (18.934 s) : 18934000, 18934000
.   : milestone, 18934000,
iast_GLOBAL (18.292 s) : 18292000, 18292000
.   : milestone, 18292000,
profiling (15.63 s) : 15630000, 15630000
.   : milestone, 15630000,
tracing (14.915 s) : 14915000, 14915000
.   : milestone, 14915000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.267 s [15.267 s, 15.267 s] -
appsec 15.015 s [15.015 s, 15.015 s] -252.0 ms (-1.7%)
iast 19.04 s [19.04 s, 19.04 s] 3.773 s (24.7%)
iast_GLOBAL 18.144 s [18.144 s, 18.144 s] 2.877 s (18.8%)
profiling 15.411 s [15.411 s, 15.411 s] 144.0 ms (0.9%)
tracing 15.099 s [15.099 s, 15.099 s] -168.0 ms (-1.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.656 s [15.656 s, 15.656 s] -
appsec 14.677 s [14.677 s, 14.677 s] -979.0 ms (-6.3%)
iast 18.934 s [18.934 s, 18.934 s] 3.278 s (20.9%)
iast_GLOBAL 18.292 s [18.292 s, 18.292 s] 2.636 s (16.8%)
profiling 15.63 s [15.63 s, 15.63 s] -26.0 ms (-0.2%)
tracing 14.915 s [14.915 s, 14.915 s] -741.0 ms (-4.7%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~30b0291160, baseline=1.50.0-SNAPSHOT~0903cf408b
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.47 ms) : 1458, 1481
.   : milestone, 1470,
appsec (2.409 ms) : 2359, 2458
.   : milestone, 2409,
iast (2.196 ms) : 2134, 2258
.   : milestone, 2196,
iast_GLOBAL (2.235 ms) : 2172, 2297
.   : milestone, 2235,
profiling (2.07 ms) : 2019, 2121
.   : milestone, 2070,
tracing (2.021 ms) : 1972, 2070
.   : milestone, 2021,
section candidate
no_agent (1.479 ms) : 1467, 1490
.   : milestone, 1479,
appsec (2.408 ms) : 2359, 2458
.   : milestone, 2408,
iast (2.191 ms) : 2128, 2254
.   : milestone, 2191,
iast_GLOBAL (2.237 ms) : 2174, 2300
.   : milestone, 2237,
profiling (2.037 ms) : 1987, 2087
.   : milestone, 2037,
tracing (2.021 ms) : 1972, 2069
.   : milestone, 2021,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.47 ms [1.458 ms, 1.481 ms] -
appsec 2.409 ms [2.359 ms, 2.458 ms] 938.984 µs (63.9%)
iast 2.196 ms [2.134 ms, 2.258 ms] 726.094 µs (49.4%)
iast_GLOBAL 2.235 ms [2.172 ms, 2.297 ms] 764.802 µs (52.0%)
profiling 2.07 ms [2.019 ms, 2.121 ms] 600.261 µs (40.8%)
tracing 2.021 ms [1.972 ms, 2.07 ms] 550.84 µs (37.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.479 ms [1.467 ms, 1.49 ms] -
appsec 2.408 ms [2.359 ms, 2.458 ms] 929.423 µs (62.8%)
iast 2.191 ms [2.128 ms, 2.254 ms] 712.056 µs (48.1%)
iast_GLOBAL 2.237 ms [2.174 ms, 2.3 ms] 758.089 µs (51.3%)
profiling 2.037 ms [1.987 ms, 2.087 ms] 558.342 µs (37.8%)
tracing 2.021 ms [1.972 ms, 2.069 ms] 541.861 µs (36.6%)

Copy link
Contributor

@mhlidd mhlidd left a comment

Choose a reason for hiding this comment

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

Some feedback to match the RFC

Comment on lines -1531 to -1527
links = new ArrayList<>();
parentContext = null;
} else if (behaviorExtract == TracePropagationBehaviorExtract.RESTART) {
links = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

One feature in the RFC is that we don't want to include any span links that are created from terminated_context during the extraction phase. The resetting of the links ArrayList was to remove those, since there is a call to addTerminatedContextAsLinks() in buildSpan, prior to the call to buildSpanContext(). Maybe that call should be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was only an early try to check how the CI would behave.
Yes, the call from buildSpan went away, the main goal is to handle the terminated context / span link in a single location (buildSpanContext) to avoid multiple allocation.

I keep trying thing in this PR, because I feel the isRemote() behavior on DDSpanContext is wrong compared to its interface behavior. It's only usage what for last parent id tag, which also need improvements / refactoring.

.build())
: SpanLink.from(parentContext);
links.add(link);
if (Config.get().getTracePropagationBehaviorExtract() == RESTART) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (Config.get().getTracePropagationBehaviorExtract() == RESTART) {
if (Config.get().getTracePropagationBehaviorExtract() == RESTART || Config.get().getTracePropagationBehaviorExtract() == IGNORE) {

@PerfectSlayer PerfectSlayer force-pushed the bbujon/trace-propagation branch 2 times, most recently from 8aeb60d to cf070a5 Compare April 23, 2025 11:05
@PerfectSlayer PerfectSlayer requested a review from mhlidd April 23, 2025 12:33
@PerfectSlayer PerfectSlayer removed the tag: do not merge Do not merge changes label Apr 23, 2025
Copy link
Contributor

@mhlidd mhlidd left a comment

Choose a reason for hiding this comment

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

LGTM, one small question about something I don't understand.

if (propagationTags.getLastParentId() == null) {
if (context.isRemote()) {
CharSequence lastParentId = context.getLastParentId();
if (lastParentId != null) {
propagationTags.updateLastParentId(lastParentId);
}
} else {
propagationTags.updateLastParentId(DDSpanId.toHexStringPadded(context.getSpanId()));
}
}

propagationTags.updateLastParentId(DDSpanId.toHexStringPadded(context.getSpanId()));
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for removing this here? It feels like to me that the end effect would be different since we are no longer checking for null before doing an update of the parentId?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, and the previous behavior feels bogus to me.

We want the last parent id to be the current span id when injected, right?
The last parent id is stored in the root span (of the local pending trace).
So if at some point the last parent id is set, and later on another span of the same local trace we do injection, the last parent id will already be set (to some other span, not the current one) and it won’t be updated.

So with this change, I’m enforcing to always use the current span id as last parent id.

Should I write some test to check for the expected behavior? -- and test it again master and this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I  added some unit tests and @zacharycmontoya is writing some system tests here: DataDog/system-tests#4595

Choose a reason for hiding this comment

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

FYI @PerfectSlayer the system-tests have been merged now with a Java skip

@PerfectSlayer PerfectSlayer force-pushed the bbujon/trace-propagation branch from a84184b to b9ce87a Compare May 12, 2025 15:30
@PerfectSlayer PerfectSlayer enabled auto-merge (squash) May 12, 2025 15:30
@datadog-datadog-prod-us1
Copy link
Contributor

Datadog Summary

✅ Code Quality    ✅ Code Security    ✅ Dependencies


Was this helpful? Give us feedback!

@PerfectSlayer PerfectSlayer force-pushed the bbujon/trace-propagation branch from b9ce87a to 30b0291 Compare May 14, 2025 05:06
@PerfectSlayer PerfectSlayer requested a review from a team as a code owner May 14, 2025 05:06
@PerfectSlayer PerfectSlayer merged commit be63fb9 into master May 14, 2025
583 of 589 checks passed
@PerfectSlayer PerfectSlayer deleted the bbujon/trace-propagation branch May 14, 2025 08:21
@github-actions github-actions bot added this to the 1.50.0 milestone May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants