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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

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 1745613844 1745826453
git_commit_sha 4d01d58 84184b02cd
release_version 1.49.0-SNAPSHOT~4d01d583bb 1.49.0-SNAPSHOT~a84184b02cd
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1745828297 1745828297
ci_job_id 914320537 914320537
ci_pipeline_id 63453400 63453400
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-srkfmchj-project-304-concurrent-0-xyx3d1ox 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-srkfmchj-project-304-concurrent-0-xyx3d1ox 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

Found 8 performance improvements and 22 performance regressions! Performance is the same for 33 metrics, 8 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:iast:BytebuddyAgent worse
[+25.697ms; +54.315ms] or [+3.222%; +6.811%]
837.470ms 797.464ms
scenario:startup:insecure-bank:iast:Debugger better
[-1.680ms; -1.514ms] or [-28.631%; -25.793%]
4.272ms 5.869ms
scenario:startup:insecure-bank:iast:Telemetry worse
[+805.208µs; +1065.889µs] or [+10.355%; +13.707%]
8.712ms 7.776ms
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:Agent.start worse
[+46.018ms; +52.931ms] or [+4.052%; +4.661%]
1.185s 1.136s
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:BytebuddyAgent worse
[+48.370ms; +53.583ms] or [+6.131%; +6.792%]
839.867ms 788.890ms
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:Debugger better
[-1.765ms; -1.648ms] or [-29.937%; -27.946%]
4.189ms 5.896ms
scenario:startup:insecure-bank:iast_HARDCODED_SECRET_DISABLED:Telemetry worse
[+695.769µs; +938.962µs] or [+8.849%; +11.942%]
8.680ms 7.863ms
scenario:startup:insecure-bank:iast_TELEMETRY_OFF:Agent.start worse
[+29.087ms; +55.513ms] or [+2.563%; +4.892%]
1.177s 1.135s
scenario:startup:insecure-bank:iast_TELEMETRY_OFF:BytebuddyAgent worse
[+33.200ms; +57.487ms] or [+4.206%; +7.283%]
834.655ms 789.311ms
scenario:startup:insecure-bank:iast_TELEMETRY_OFF:Debugger better
[-1.837ms; -1.678ms] or [-31.547%; -28.806%]
4.066ms 5.824ms
scenario:startup:insecure-bank:iast_TELEMETRY_OFF:Telemetry worse
[+666.953µs; +931.657µs] or [+8.663%; +12.101%]
8.498ms 7.699ms
scenario:startup:insecure-bank:tracing:Agent.start worse
[+45.107ms; +73.838ms] or [+4.490%; +7.349%]
1.064s 1.005s
scenario:startup:insecure-bank:tracing:BytebuddyAgent worse
[+45.313ms; +65.208ms] or [+6.770%; +9.743%]
724.554ms 669.293ms
scenario:startup:insecure-bank:tracing:Debugger better
[-1.805ms; -1.600ms] or [-29.573%; -26.214%]
4.401ms 6.103ms
scenario:startup:petclinic:appsec:Agent.start worse
[+37.235ms; +67.183ms] or [+3.241%; +5.847%]
1.201s 1.149s
scenario:startup:petclinic:appsec:BytebuddyAgent worse
[+43.800ms; +62.908ms] or [+6.362%; +9.138%]
741.795ms 688.441ms
scenario:startup:petclinic:appsec:Debugger better
[-1.744ms; -1.605ms] or [-29.653%; -27.282%]
4.208ms 5.883ms
scenario:startup:petclinic:iast:Agent.start worse
[+44.048ms; +76.936ms] or [+3.881%; +6.778%]
1.196s 1.135s
scenario:startup:petclinic:iast:BytebuddyAgent worse
[+46.083ms; +71.673ms] or [+5.844%; +9.090%]
847.382ms 788.503ms
scenario:startup:petclinic:iast:Debugger better
[-1.667ms; -1.463ms] or [-28.515%; -25.029%]
4.281ms 5.847ms
scenario:startup:petclinic:iast:Telemetry worse
[+0.858ms; +1.241ms] or [+10.974%; +15.884%]
8.864ms 7.814ms
scenario:startup:petclinic:profiling:Agent.start worse
[+32.353ms; +69.153ms] or [+2.570%; +5.493%]
1.310s 1.259s
scenario:startup:petclinic:profiling:ProfilingAgent worse
[+2.260ms; +5.603ms] or [+2.322%; +5.758%]
101.253ms 97.322ms
scenario:startup:petclinic:profiling:BytebuddyAgent worse
[+37.036ms; +61.626ms] or [+5.564%; +9.258%]
715.000ms 665.669ms
scenario:startup:petclinic:profiling:Debugger better
[-1.911ms; -1.697ms] or [-30.832%; -27.393%]
4.393ms 6.196ms
scenario:startup:petclinic:profiling:Telemetry worse
[+488.351µs; +850.889µs] or [+5.908%; +10.293%]
8.936ms 8.266ms
scenario:startup:petclinic:profiling:Profiling worse
[+2.263ms; +5.605ms] or [+2.324%; +5.758%]
101.280ms 97.346ms
scenario:startup:petclinic:tracing:Agent.start worse
[+46.622ms; +54.903ms] or [+4.644%; +5.469%]
1.055s 1.004s
scenario:startup:petclinic:tracing:BytebuddyAgent worse
[+47.606ms; +52.378ms] or [+7.107%; +7.820%]
719.798ms 669.806ms
scenario:startup:petclinic:tracing:Debugger better
[-1.832ms; -1.709ms] or [-29.984%; -27.971%]
4.340ms 6.111ms
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.005 s) : 0, 1004665
Total [baseline] (8.651 s) : 0, 8651453
Agent [candidate] (1.064 s) : 0, 1064138
Total [candidate] (8.652 s) : 0, 8652218
section iast
Agent [baseline] (1.144 s) : 0, 1144310
Total [baseline] (9.2 s) : 0, 9200394
Agent [candidate] (1.183 s) : 0, 1182774
Total [candidate] (9.205 s) : 0, 9205259
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.136 s) : 0, 1135670
Total [baseline] (9.151 s) : 0, 9151465
Agent [candidate] (1.185 s) : 0, 1185144
Total [candidate] (9.203 s) : 0, 9202712
section iast_TELEMETRY_OFF
Agent [baseline] (1.135 s) : 0, 1134860
Total [baseline] (9.169 s) : 0, 9168549
Agent [candidate] (1.177 s) : 0, 1177160
Total [candidate] (9.256 s) : 0, 9255726
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.005 s -
Agent iast 1.144 s 139.644 ms (13.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.136 s 131.005 ms (13.0%)
Agent iast_TELEMETRY_OFF 1.135 s 130.194 ms (13.0%)
Total tracing 8.651 s -
Total iast 9.2 s 548.941 ms (6.3%)
Total iast_HARDCODED_SECRET_DISABLED 9.151 s 500.012 ms (5.8%)
Total iast_TELEMETRY_OFF 9.169 s 517.096 ms (6.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.064 s -
Agent iast 1.183 s 118.636 ms (11.1%)
Agent iast_HARDCODED_SECRET_DISABLED 1.185 s 121.007 ms (11.4%)
Agent iast_TELEMETRY_OFF 1.177 s 113.022 ms (10.6%)
Total tracing 8.652 s -
Total iast 9.205 s 553.041 ms (6.4%)
Total iast_HARDCODED_SECRET_DISABLED 9.203 s 550.494 ms (6.4%)
Total iast_TELEMETRY_OFF 9.256 s 603.508 ms (7.0%)
gantt
    title insecure-bank - break down per module: candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (669.293 ms) : 0, 669293
BytebuddyAgent [candidate] (724.554 ms) : 0, 724554
GlobalTracer [baseline] (239.914 ms) : 0, 239914
GlobalTracer [candidate] (240.302 ms) : 0, 240302
AppSec [baseline] (54.525 ms) : 0, 54525
AppSec [candidate] (56.321 ms) : 0, 56321
Debugger [baseline] (6.103 ms) : 0, 6103
Debugger [candidate] (4.401 ms) : 0, 4401
Remote Config [baseline] (689.715 µs) : 0, 690
Remote Config [candidate] (2.24 ms) : 0, 2240
Telemetry [baseline] (10.605 ms) : 0, 10605
Telemetry [candidate] (12.874 ms) : 0, 12874
section iast
BytebuddyAgent [baseline] (797.464 ms) : 0, 797464
BytebuddyAgent [candidate] (837.47 ms) : 0, 837470
GlobalTracer [baseline] (230.294 ms) : 0, 230294
GlobalTracer [candidate] (229.406 ms) : 0, 229406
IAST [baseline] (22.895 ms) : 0, 22895
IAST [candidate] (22.885 ms) : 0, 22885
AppSec [baseline] (55.874 ms) : 0, 55874
AppSec [candidate] (56.046 ms) : 0, 56046
Debugger [baseline] (5.869 ms) : 0, 5869
Debugger [candidate] (4.272 ms) : 0, 4272
Remote Config [baseline] (596.312 µs) : 0, 596
Remote Config [candidate] (606.428 µs) : 0, 606
Telemetry [baseline] (7.776 ms) : 0, 7776
Telemetry [candidate] (8.712 ms) : 0, 8712
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (788.89 ms) : 0, 788890
BytebuddyAgent [candidate] (839.867 ms) : 0, 839867
GlobalTracer [baseline] (229.731 ms) : 0, 229731
GlobalTracer [candidate] (229.814 ms) : 0, 229814
IAST [baseline] (22.995 ms) : 0, 22995
IAST [candidate] (24.285 ms) : 0, 24285
AppSec [baseline] (56.339 ms) : 0, 56339
AppSec [candidate] (54.253 ms) : 0, 54253
Debugger [baseline] (5.896 ms) : 0, 5896
Debugger [candidate] (4.189 ms) : 0, 4189
Remote Config [baseline] (611.299 µs) : 0, 611
Remote Config [candidate] (610.336 µs) : 0, 610
Telemetry [baseline] (7.863 ms) : 0, 7863
Telemetry [candidate] (8.68 ms) : 0, 8680
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (789.311 ms) : 0, 789311
BytebuddyAgent [candidate] (834.655 ms) : 0, 834655
GlobalTracer [baseline] (229.695 ms) : 0, 229695
GlobalTracer [candidate] (228.576 ms) : 0, 228576
IAST [baseline] (22.262 ms) : 0, 22262
IAST [candidate] (22.156 ms) : 0, 22156
AppSec [baseline] (56.006 ms) : 0, 56006
AppSec [candidate] (55.347 ms) : 0, 55347
Debugger [baseline] (5.824 ms) : 0, 5824
Debugger [candidate] (4.066 ms) : 0, 4066
Remote Config [baseline] (589.517 µs) : 0, 590
Remote Config [candidate] (599.655 µs) : 0, 600
Telemetry [baseline] (7.699 ms) : 0, 7699
Telemetry [candidate] (8.498 ms) : 0, 8498
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.004 s) : 0, 1003829
Total [baseline] (10.428 s) : 0, 10427955
Agent [candidate] (1.055 s) : 0, 1054591
Total [candidate] (10.439 s) : 0, 10439493
section appsec
Agent [baseline] (1.149 s) : 0, 1149015
Total [baseline] (10.631 s) : 0, 10630741
Agent [candidate] (1.201 s) : 0, 1201224
Total [candidate] (10.779 s) : 0, 10778960
section iast
Agent [baseline] (1.135 s) : 0, 1135028
Total [baseline] (10.794 s) : 0, 10793761
Agent [candidate] (1.196 s) : 0, 1195520
Total [candidate] (11.096 s) : 0, 11095633
section profiling
Agent [baseline] (1.259 s) : 0, 1258912
Total [baseline] (10.754 s) : 0, 10754266
Agent [candidate] (1.31 s) : 0, 1309665
Total [candidate] (10.898 s) : 0, 10897772
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.004 s -
Agent appsec 1.149 s 145.186 ms (14.5%)
Agent iast 1.135 s 131.2 ms (13.1%)
Agent profiling 1.259 s 255.083 ms (25.4%)
Total tracing 10.428 s -
Total appsec 10.631 s 202.786 ms (1.9%)
Total iast 10.794 s 365.806 ms (3.5%)
Total profiling 10.754 s 326.311 ms (3.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.055 s -
Agent appsec 1.201 s 146.633 ms (13.9%)
Agent iast 1.196 s 140.929 ms (13.4%)
Agent profiling 1.31 s 255.074 ms (24.2%)
Total tracing 10.439 s -
Total appsec 10.779 s 339.468 ms (3.3%)
Total iast 11.096 s 656.14 ms (6.3%)
Total profiling 10.898 s 458.279 ms (4.4%)
gantt
    title petclinic - break down per module: candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (669.806 ms) : 0, 669806
BytebuddyAgent [candidate] (719.798 ms) : 0, 719798
GlobalTracer [baseline] (240.042 ms) : 0, 240042
GlobalTracer [candidate] (239.218 ms) : 0, 239218
AppSec [baseline] (54.508 ms) : 0, 54508
AppSec [candidate] (55.818 ms) : 0, 55818
Debugger [baseline] (6.111 ms) : 0, 6111
Debugger [candidate] (4.34 ms) : 0, 4340
Remote Config [baseline] (706.0 µs) : 0, 706
Remote Config [candidate] (685.944 µs) : 0, 686
Telemetry [baseline] (9.195 ms) : 0, 9195
Telemetry [candidate] (11.412 ms) : 0, 11412
section appsec
BytebuddyAgent [baseline] (688.441 ms) : 0, 688441
BytebuddyAgent [candidate] (741.795 ms) : 0, 741795
GlobalTracer [baseline] (236.106 ms) : 0, 236106
GlobalTracer [candidate] (236.466 ms) : 0, 236466
AppSec [baseline] (174.385 ms) : 0, 174385
AppSec [candidate] (175.112 ms) : 0, 175112
Debugger [baseline] (5.883 ms) : 0, 5883
Debugger [candidate] (4.208 ms) : 0, 4208
Remote Config [baseline] (633.4 µs) : 0, 633
Remote Config [candidate] (631.724 µs) : 0, 632
Telemetry [baseline] (9.316 ms) : 0, 9316
Telemetry [candidate] (8.469 ms) : 0, 8469
IAST [baseline] (21.635 ms) : 0, 21635
IAST [candidate] (22.067 ms) : 0, 22067
section iast
BytebuddyAgent [baseline] (788.503 ms) : 0, 788503
BytebuddyAgent [candidate] (847.382 ms) : 0, 847382
GlobalTracer [baseline] (229.81 ms) : 0, 229810
GlobalTracer [candidate] (231.184 ms) : 0, 231184
AppSec [baseline] (56.433 ms) : 0, 56433
AppSec [candidate] (54.852 ms) : 0, 54852
Debugger [baseline] (5.847 ms) : 0, 5847
Debugger [candidate] (4.281 ms) : 0, 4281
Remote Config [baseline] (580.419 µs) : 0, 580
Remote Config [candidate] (625.125 µs) : 0, 625
Telemetry [baseline] (7.814 ms) : 0, 7814
Telemetry [candidate] (8.864 ms) : 0, 8864
IAST [baseline] (22.702 ms) : 0, 22702
IAST [candidate] (24.782 ms) : 0, 24782
section profiling
BytebuddyAgent [baseline] (665.669 ms) : 0, 665669
BytebuddyAgent [candidate] (715.0 ms) : 0, 715000
GlobalTracer [baseline] (375.71 ms) : 0, 375710
GlobalTracer [candidate] (375.55 ms) : 0, 375550
AppSec [baseline] (54.698 ms) : 0, 54698
AppSec [candidate] (53.262 ms) : 0, 53262
Debugger [baseline] (6.196 ms) : 0, 6196
Debugger [candidate] (4.393 ms) : 0, 4393
Remote Config [baseline] (664.526 µs) : 0, 665
Remote Config [candidate] (685.306 µs) : 0, 685
Telemetry [baseline] (8.266 ms) : 0, 8266
Telemetry [candidate] (8.936 ms) : 0, 8936
ProfilingAgent [baseline] (97.322 ms) : 0, 97322
ProfilingAgent [candidate] (101.253 ms) : 0, 101253
Profiling [baseline] (97.346 ms) : 0, 97346
Profiling [candidate] (101.28 ms) : 0, 101280
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-04-28T07:48:49 2025-04-28T07:56:33
git_branch master bbujon/trace-propagation
git_commit_date 1745613844 1745826461
git_commit_sha 4d01d58 84184b02cd
release_version 1.49.0-SNAPSHOT~4d01d583bb 1.49.0-SNAPSHOT~a84184b02cd
start_time 2025-04-28T07:48:34 2025-04-28T07:56:19
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1745827392 1745827392
ci_job_id 914320538 914320538
ci_pipeline_id 63453400 63453400
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-srkfmchj-project-304-concurrent-1-683tgfsc 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-srkfmchj-project-304-concurrent-1-683tgfsc 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 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 insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb
    dateFormat X
    axisFormat %s
section baseline
no_agent (389.823 µs) : 370, 410
.   : milestone, 390,
iast (526.246 µs) : 503, 550
.   : milestone, 526,
iast_FULL (741.573 µs) : 718, 765
.   : milestone, 742,
iast_GLOBAL (576.151 µs) : 553, 599
.   : milestone, 576,
iast_HARDCODED_SECRET_DISABLED (532.006 µs) : 509, 555
.   : milestone, 532,
iast_INACTIVE (465.015 µs) : 443, 487
.   : milestone, 465,
iast_TELEMETRY_OFF (515.449 µs) : 492, 539
.   : milestone, 515,
tracing (462.326 µs) : 441, 484
.   : milestone, 462,
section candidate
no_agent (380.532 µs) : 361, 400
.   : milestone, 381,
iast (517.835 µs) : 496, 540
.   : milestone, 518,
iast_FULL (738.229 µs) : 716, 761
.   : milestone, 738,
iast_GLOBAL (570.95 µs) : 548, 594
.   : milestone, 571,
iast_HARDCODED_SECRET_DISABLED (515.023 µs) : 493, 537
.   : milestone, 515,
iast_INACTIVE (472.543 µs) : 451, 494
.   : milestone, 473,
iast_TELEMETRY_OFF (502.946 µs) : 481, 524
.   : milestone, 503,
tracing (464.957 µs) : 443, 487
.   : milestone, 465,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 389.823 µs [370.014 µs, 409.632 µs] -
iast 526.246 µs [502.87 µs, 549.623 µs] 136.424 µs (35.0%)
iast_FULL 741.573 µs [718.379 µs, 764.767 µs] 351.75 µs (90.2%)
iast_GLOBAL 576.151 µs [552.92 µs, 599.382 µs] 186.328 µs (47.8%)
iast_HARDCODED_SECRET_DISABLED 532.006 µs [508.948 µs, 555.064 µs] 142.183 µs (36.5%)
iast_INACTIVE 465.015 µs [442.934 µs, 487.095 µs] 75.192 µs (19.3%)
iast_TELEMETRY_OFF 515.449 µs [491.888 µs, 539.01 µs] 125.626 µs (32.2%)
tracing 462.326 µs [440.887 µs, 483.764 µs] 72.503 µs (18.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 380.532 µs [360.98 µs, 400.083 µs] -
iast 517.835 µs [495.972 µs, 539.698 µs] 137.303 µs (36.1%)
iast_FULL 738.229 µs [715.525 µs, 760.933 µs] 357.697 µs (94.0%)
iast_GLOBAL 570.95 µs [547.912 µs, 593.989 µs] 190.419 µs (50.0%)
iast_HARDCODED_SECRET_DISABLED 515.023 µs [493.276 µs, 536.771 µs] 134.492 µs (35.3%)
iast_INACTIVE 472.543 µs [451.102 µs, 493.984 µs] 92.011 µs (24.2%)
iast_TELEMETRY_OFF 502.946 µs [481.405 µs, 524.488 µs] 122.415 µs (32.2%)
tracing 464.957 µs [443.217 µs, 486.697 µs] 84.426 µs (22.2%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.379 ms) : 1359, 1399
.   : milestone, 1379,
appsec (1.738 ms) : 1713, 1763
.   : milestone, 1738,
appsec_no_iast (1.744 ms) : 1721, 1768
.   : milestone, 1744,
code_origins (1.681 ms) : 1654, 1708
.   : milestone, 1681,
iast (1.519 ms) : 1495, 1544
.   : milestone, 1519,
profiling (1.525 ms) : 1501, 1548
.   : milestone, 1525,
tracing (1.488 ms) : 1464, 1512
.   : milestone, 1488,
section candidate
no_agent (1.347 ms) : 1328, 1367
.   : milestone, 1347,
appsec (1.744 ms) : 1720, 1767
.   : milestone, 1744,
appsec_no_iast (1.754 ms) : 1731, 1777
.   : milestone, 1754,
code_origins (1.679 ms) : 1652, 1706
.   : milestone, 1679,
iast (1.52 ms) : 1495, 1545
.   : milestone, 1520,
profiling (1.523 ms) : 1500, 1546
.   : milestone, 1523,
tracing (1.504 ms) : 1479, 1529
.   : milestone, 1504,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.379 ms [1.359 ms, 1.399 ms] -
appsec 1.738 ms [1.713 ms, 1.763 ms] 359.187 µs (26.0%)
appsec_no_iast 1.744 ms [1.721 ms, 1.768 ms] 365.54 µs (26.5%)
code_origins 1.681 ms [1.654 ms, 1.708 ms] 302.446 µs (21.9%)
iast 1.519 ms [1.495 ms, 1.544 ms] 140.443 µs (10.2%)
profiling 1.525 ms [1.501 ms, 1.548 ms] 145.958 µs (10.6%)
tracing 1.488 ms [1.464 ms, 1.512 ms] 108.937 µs (7.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.347 ms [1.328 ms, 1.367 ms] -
appsec 1.744 ms [1.72 ms, 1.767 ms] 396.412 µs (29.4%)
appsec_no_iast 1.754 ms [1.731 ms, 1.777 ms] 406.679 µs (30.2%)
code_origins 1.679 ms [1.652 ms, 1.706 ms] 331.835 µs (24.6%)
iast 1.52 ms [1.495 ms, 1.545 ms] 172.902 µs (12.8%)
profiling 1.523 ms [1.5 ms, 1.546 ms] 175.613 µs (13.0%)
tracing 1.504 ms [1.479 ms, 1.529 ms] 156.795 µs (11.6%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/trace-propagation
git_commit_date 1745613844 1745826462
git_commit_sha 4d01d58 84184b02cd
release_version 1.49.0-SNAPSHOT~4d01d583bb 1.49.0-SNAPSHOT~a84184b02cd
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1745827876 1745827876
ci_job_id 914320539 914320539
ci_pipeline_id 63453400 63453400
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-srkfmchj-project-304-concurrent-2-ktph800l 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-srkfmchj-project-304-concurrent-2-ktph800l 6.8.0-1024-aws #26~22.04.1-Ubuntu SMP Wed Feb 19 06:54:57 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.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.826 s) : 14826000, 14826000
.   : milestone, 14826000,
appsec (15.126 s) : 15126000, 15126000
.   : milestone, 15126000,
iast (18.958 s) : 18958000, 18958000
.   : milestone, 18958000,
iast_GLOBAL (18.059 s) : 18059000, 18059000
.   : milestone, 18059000,
profiling (14.786 s) : 14786000, 14786000
.   : milestone, 14786000,
tracing (14.848 s) : 14848000, 14848000
.   : milestone, 14848000,
section candidate
no_agent (15.428 s) : 15428000, 15428000
.   : milestone, 15428000,
appsec (15.076 s) : 15076000, 15076000
.   : milestone, 15076000,
iast (18.767 s) : 18767000, 18767000
.   : milestone, 18767000,
iast_GLOBAL (18.287 s) : 18287000, 18287000
.   : milestone, 18287000,
profiling (15.011 s) : 15011000, 15011000
.   : milestone, 15011000,
tracing (14.948 s) : 14948000, 14948000
.   : milestone, 14948000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.826 s [14.826 s, 14.826 s] -
appsec 15.126 s [15.126 s, 15.126 s] 300.0 ms (2.0%)
iast 18.958 s [18.958 s, 18.958 s] 4.132 s (27.9%)
iast_GLOBAL 18.059 s [18.059 s, 18.059 s] 3.233 s (21.8%)
profiling 14.786 s [14.786 s, 14.786 s] -40.0 ms (-0.3%)
tracing 14.848 s [14.848 s, 14.848 s] 22.0 ms (0.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.428 s [15.428 s, 15.428 s] -
appsec 15.076 s [15.076 s, 15.076 s] -352.0 ms (-2.3%)
iast 18.767 s [18.767 s, 18.767 s] 3.339 s (21.6%)
iast_GLOBAL 18.287 s [18.287 s, 18.287 s] 2.859 s (18.5%)
profiling 15.011 s [15.011 s, 15.011 s] -417.0 ms (-2.7%)
tracing 14.948 s [14.948 s, 14.948 s] -480.0 ms (-3.1%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~a84184b02cd, baseline=1.49.0-SNAPSHOT~4d01d583bb
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.473 ms) : 1461, 1484
.   : milestone, 1473,
appsec (2.369 ms) : 2323, 2416
.   : milestone, 2369,
iast (2.155 ms) : 2096, 2214
.   : milestone, 2155,
iast_GLOBAL (2.192 ms) : 2133, 2251
.   : milestone, 2192,
profiling (2.025 ms) : 1977, 2073
.   : milestone, 2025,
tracing (1.978 ms) : 1932, 2023
.   : milestone, 1978,
section candidate
no_agent (1.474 ms) : 1462, 1485
.   : milestone, 1474,
appsec (2.372 ms) : 2325, 2419
.   : milestone, 2372,
iast (2.152 ms) : 2093, 2211
.   : milestone, 2152,
iast_GLOBAL (2.2 ms) : 2141, 2260
.   : milestone, 2200,
profiling (2.013 ms) : 1964, 2061
.   : milestone, 2013,
tracing (1.987 ms) : 1941, 2032
.   : milestone, 1987,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.473 ms [1.461 ms, 1.484 ms] -
appsec 2.369 ms [2.323 ms, 2.416 ms] 896.727 µs (60.9%)
iast 2.155 ms [2.096 ms, 2.214 ms] 682.212 µs (46.3%)
iast_GLOBAL 2.192 ms [2.133 ms, 2.251 ms] 719.307 µs (48.8%)
profiling 2.025 ms [1.977 ms, 2.073 ms] 552.106 µs (37.5%)
tracing 1.978 ms [1.932 ms, 2.023 ms] 505.026 µs (34.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.474 ms [1.462 ms, 1.485 ms] -
appsec 2.372 ms [2.325 ms, 2.419 ms] 898.208 µs (60.9%)
iast 2.152 ms [2.093 ms, 2.211 ms] 677.938 µs (46.0%)
iast_GLOBAL 2.2 ms [2.141 ms, 2.26 ms] 726.609 µs (49.3%)
profiling 2.013 ms [1.964 ms, 2.061 ms] 538.911 µs (36.6%)
tracing 1.987 ms [1.941 ms, 2.032 ms] 513.148 µs (34.8%)

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 -1534
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 from 02351e0 to 5b031c9 Compare April 23, 2025 07:03
@PerfectSlayer PerfectSlayer force-pushed the bbujon/trace-propagation branch 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

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.

2 participants