Skip to content

Migrating all HttpServer Instrumentations to Extract full Context #8820

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

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

mhlidd
Copy link
Contributor

@mhlidd mhlidd commented May 13, 2025

What Does This Do

Migrate all Http Server Instrumentations to extract full Context. This PR adds functions in HttpServerDecorator.java to use a full Context in all instrumentation decorator calls. Additionally, it replaces the usage of activateSpan and AgentScope to Context.attach() and ContextScope to allow the scopeStack to track full Context rather than just SpanContexts.

Once merged, a follow-up PR will be opened to remove all Http Server decorator calls that were based upon Span Contexts. The new Context-based decorator functions will be used instead.

This PR enables full W3C Baggage extraction for all Http Server instrumentations.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@pr-commenter
Copy link

pr-commenter bot commented May 13, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/migrate_http_server_instrumentations
git_commit_date 1747743756 1747744971
git_commit_sha 0ebd52b 80529d3
release_version 1.50.0-SNAPSHOT~0ebd52ba72 1.50.0-SNAPSHOT~80529d3a40
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1747747337 1747747337
ci_job_id 945766100 945766100
ci_pipeline_id 65601299 65601299
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-ub2wu-al-project-304-concurrent-1-1hiapos4 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-ub2wu-al-project-304-concurrent-1-1hiapos4 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 54 metrics, 17 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.026 s) : 0, 1025659
Total [baseline] (10.498 s) : 0, 10498071
Agent [candidate] (1.027 s) : 0, 1027164
Total [candidate] (10.528 s) : 0, 10528171
section appsec
Agent [baseline] (1.163 s) : 0, 1162622
Total [baseline] (10.755 s) : 0, 10755274
Agent [candidate] (1.168 s) : 0, 1167676
Total [candidate] (10.719 s) : 0, 10719365
section iast
Agent [baseline] (1.161 s) : 0, 1160787
Total [baseline] (11.05 s) : 0, 11050165
Agent [candidate] (1.148 s) : 0, 1147890
Total [candidate] (10.867 s) : 0, 10867289
section profiling
Agent [baseline] (1.279 s) : 0, 1279021
Total [baseline] (10.84 s) : 0, 10839852
Agent [candidate] (1.278 s) : 0, 1278381
Total [candidate] (10.857 s) : 0, 10856922
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.026 s -
Agent appsec 1.163 s 136.963 ms (13.4%)
Agent iast 1.161 s 135.128 ms (13.2%)
Agent profiling 1.279 s 253.362 ms (24.7%)
Total tracing 10.498 s -
Total appsec 10.755 s 257.203 ms (2.5%)
Total iast 11.05 s 552.094 ms (5.3%)
Total profiling 10.84 s 341.781 ms (3.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.027 s -
Agent appsec 1.168 s 140.512 ms (13.7%)
Agent iast 1.148 s 120.725 ms (11.8%)
Agent profiling 1.278 s 251.217 ms (24.5%)
Total tracing 10.528 s -
Total appsec 10.719 s 191.194 ms (1.8%)
Total iast 10.867 s 339.118 ms (3.2%)
Total profiling 10.857 s 328.751 ms (3.1%)
gantt
    title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.163 ms) : 0, 687163
BytebuddyAgent [candidate] (686.814 ms) : 0, 686814
GlobalTracer [baseline] (241.453 ms) : 0, 241453
GlobalTracer [candidate] (241.346 ms) : 0, 241346
AppSec [baseline] (54.908 ms) : 0, 54908
AppSec [candidate] (55.554 ms) : 0, 55554
Debugger [baseline] (6.969 ms) : 0, 6969
Debugger [candidate] (7.764 ms) : 0, 7764
Remote Config [baseline] (723.453 µs) : 0, 723
Remote Config [candidate] (710.183 µs) : 0, 710
Telemetry [baseline] (10.729 ms) : 0, 10729
Telemetry [candidate] (11.47 ms) : 0, 11470
section appsec
BytebuddyAgent [baseline] (701.309 ms) : 0, 701309
BytebuddyAgent [candidate] (704.374 ms) : 0, 704374
GlobalTracer [baseline] (236.951 ms) : 0, 236951
GlobalTracer [candidate] (238.04 ms) : 0, 238040
AppSec [baseline] (175.815 ms) : 0, 175815
AppSec [candidate] (176.331 ms) : 0, 176331
Debugger [baseline] (5.938 ms) : 0, 5938
Debugger [candidate] (5.946 ms) : 0, 5946
Remote Config [baseline] (638.516 µs) : 0, 639
Remote Config [candidate] (629.374 µs) : 0, 629
Telemetry [baseline] (7.386 ms) : 0, 7386
Telemetry [candidate] (7.738 ms) : 0, 7738
IAST [baseline] (21.863 ms) : 0, 21863
IAST [candidate] (21.926 ms) : 0, 21926
section iast
BytebuddyAgent [baseline] (809.89 ms) : 0, 809890
BytebuddyAgent [candidate] (800.727 ms) : 0, 800727
GlobalTracer [baseline] (232.287 ms) : 0, 232287
GlobalTracer [candidate] (230.58 ms) : 0, 230580
AppSec [baseline] (51.381 ms) : 0, 51381
AppSec [candidate] (50.285 ms) : 0, 50285
Debugger [baseline] (6.045 ms) : 0, 6045
Debugger [candidate] (5.924 ms) : 0, 5924
Remote Config [baseline] (647.839 µs) : 0, 648
Remote Config [candidate] (589.689 µs) : 0, 590
Telemetry [baseline] (8.111 ms) : 0, 8111
Telemetry [candidate] (7.881 ms) : 0, 7881
IAST [baseline] (28.704 ms) : 0, 28704
IAST [candidate] (28.41 ms) : 0, 28410
section profiling
ProfilingAgent [baseline] (102.773 ms) : 0, 102773
ProfilingAgent [candidate] (103.013 ms) : 0, 103013
BytebuddyAgent [baseline] (673.608 ms) : 0, 673608
BytebuddyAgent [candidate] (673.077 ms) : 0, 673077
GlobalTracer [baseline] (374.886 ms) : 0, 374886
GlobalTracer [candidate] (374.658 ms) : 0, 374658
AppSec [baseline] (61.788 ms) : 0, 61788
AppSec [candidate] (61.675 ms) : 0, 61675
Debugger [baseline] (6.303 ms) : 0, 6303
Debugger [candidate] (6.272 ms) : 0, 6272
Remote Config [baseline] (663.569 µs) : 0, 664
Remote Config [candidate] (660.306 µs) : 0, 660
Telemetry [baseline] (8.218 ms) : 0, 8218
Telemetry [candidate] (8.198 ms) : 0, 8198
Profiling [baseline] (102.797 ms) : 0, 102797
Profiling [candidate] (103.037 ms) : 0, 103037
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.035 s) : 0, 1034649
Total [baseline] (8.659 s) : 0, 8659306
Agent [candidate] (1.023 s) : 0, 1022611
Total [candidate] (8.665 s) : 0, 8664772
section iast
Agent [baseline] (1.148 s) : 0, 1147908
Total [baseline] (9.218 s) : 0, 9217941
Agent [candidate] (1.154 s) : 0, 1153929
Total [candidate] (9.241 s) : 0, 9240729
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.158 s) : 0, 1158202
Total [baseline] (9.173 s) : 0, 9172924
Agent [candidate] (1.148 s) : 0, 1147862
Total [candidate] (9.184 s) : 0, 9183551
section iast_TELEMETRY_OFF
Agent [baseline] (1.144 s) : 0, 1144471
Total [baseline] (9.219 s) : 0, 9218790
Agent [candidate] (1.162 s) : 0, 1162458
Total [candidate] (9.245 s) : 0, 9245250
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.035 s -
Agent iast 1.148 s 113.259 ms (10.9%)
Agent iast_HARDCODED_SECRET_DISABLED 1.158 s 123.553 ms (11.9%)
Agent iast_TELEMETRY_OFF 1.144 s 109.822 ms (10.6%)
Total tracing 8.659 s -
Total iast 9.218 s 558.635 ms (6.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.173 s 513.619 ms (5.9%)
Total iast_TELEMETRY_OFF 9.219 s 559.484 ms (6.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.023 s -
Agent iast 1.154 s 131.318 ms (12.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.148 s 125.251 ms (12.2%)
Agent iast_TELEMETRY_OFF 1.162 s 139.847 ms (13.7%)
Total tracing 8.665 s -
Total iast 9.241 s 575.957 ms (6.6%)
Total iast_HARDCODED_SECRET_DISABLED 9.184 s 518.78 ms (6.0%)
Total iast_TELEMETRY_OFF 9.245 s 580.478 ms (6.7%)
gantt
    title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.955 ms) : 0, 690955
BytebuddyAgent [candidate] (684.029 ms) : 0, 684029
GlobalTracer [baseline] (242.511 ms) : 0, 242511
GlobalTracer [candidate] (241.9 ms) : 0, 241900
AppSec [baseline] (56.468 ms) : 0, 56468
AppSec [candidate] (54.743 ms) : 0, 54743
Debugger [baseline] (8.318 ms) : 0, 8318
Debugger [candidate] (7.626 ms) : 0, 7626
Remote Config [baseline] (691.103 µs) : 0, 691
Remote Config [candidate] (704.512 µs) : 0, 705
Telemetry [baseline] (11.97 ms) : 0, 11970
Telemetry [candidate] (10.016 ms) : 0, 10016
section iast
BytebuddyAgent [baseline] (801.496 ms) : 0, 801496
BytebuddyAgent [candidate] (804.745 ms) : 0, 804745
GlobalTracer [baseline] (230.214 ms) : 0, 230214
GlobalTracer [candidate] (231.863 ms) : 0, 231863
IAST [baseline] (29.049 ms) : 0, 29049
IAST [candidate] (27.662 ms) : 0, 27662
AppSec [baseline] (49.332 ms) : 0, 49332
AppSec [candidate] (50.912 ms) : 0, 50912
Debugger [baseline] (5.885 ms) : 0, 5885
Debugger [candidate] (5.932 ms) : 0, 5932
Remote Config [baseline] (587.715 µs) : 0, 588
Remote Config [candidate] (621.227 µs) : 0, 621
Telemetry [baseline] (7.835 ms) : 0, 7835
Telemetry [candidate] (7.879 ms) : 0, 7879
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (808.777 ms) : 0, 808777
BytebuddyAgent [candidate] (800.186 ms) : 0, 800186
GlobalTracer [baseline] (232.191 ms) : 0, 232191
GlobalTracer [candidate] (230.73 ms) : 0, 230730
IAST [baseline] (26.93 ms) : 0, 26930
IAST [candidate] (28.613 ms) : 0, 28613
AppSec [baseline] (51.36 ms) : 0, 51360
AppSec [candidate] (50.435 ms) : 0, 50435
Debugger [baseline] (5.948 ms) : 0, 5948
Debugger [candidate] (5.946 ms) : 0, 5946
Remote Config [baseline] (591.048 µs) : 0, 591
Remote Config [candidate] (596.947 µs) : 0, 597
Telemetry [baseline] (7.959 ms) : 0, 7959
Telemetry [candidate] (7.912 ms) : 0, 7912
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (797.461 ms) : 0, 797461
BytebuddyAgent [candidate] (809.81 ms) : 0, 809810
GlobalTracer [baseline] (230.493 ms) : 0, 230493
GlobalTracer [candidate] (234.503 ms) : 0, 234503
IAST [baseline] (23.059 ms) : 0, 23059
IAST [candidate] (23.704 ms) : 0, 23704
AppSec [baseline] (55.455 ms) : 0, 55455
AppSec [candidate] (56.032 ms) : 0, 56032
Debugger [baseline] (6.055 ms) : 0, 6055
Debugger [candidate] (6.045 ms) : 0, 6045
Remote Config [baseline] (608.356 µs) : 0, 608
Remote Config [candidate] (611.538 µs) : 0, 612
Telemetry [baseline] (7.845 ms) : 0, 7845
Telemetry [candidate] (7.881 ms) : 0, 7881
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-05-20T12:52:35 2025-05-20T13:00:19
git_branch master mhlidd/migrate_http_server_instrumentations
git_commit_date 1747743756 1747744971
git_commit_sha 0ebd52b 80529d3
release_version 1.50.0-SNAPSHOT~0ebd52ba72 1.50.0-SNAPSHOT~80529d3a40
start_time 2025-05-20T12:52:21 2025-05-20T13:00:05
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1747746415 1747746415
ci_job_id 945766105 945766105
ci_pipeline_id 65601299 65601299
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-6ae23wjf-project-304-concurrent-0-8jeyqsol 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-6ae23wjf-project-304-concurrent-0-8jeyqsol 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 insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72
    dateFormat X
    axisFormat %s
section baseline
no_agent (373.832 µs) : 354, 393
.   : milestone, 374,
iast (516.04 µs) : 493, 539
.   : milestone, 516,
iast_FULL (730.142 µs) : 708, 752
.   : milestone, 730,
iast_GLOBAL (569.313 µs) : 546, 593
.   : milestone, 569,
iast_HARDCODED_SECRET_DISABLED (522.846 µs) : 500, 546
.   : milestone, 523,
iast_INACTIVE (459.518 µs) : 437, 482
.   : milestone, 460,
iast_TELEMETRY_OFF (506.815 µs) : 483, 530
.   : milestone, 507,
tracing (452.089 µs) : 430, 474
.   : milestone, 452,
section candidate
no_agent (383.498 µs) : 364, 403
.   : milestone, 383,
iast (518.69 µs) : 497, 540
.   : milestone, 519,
iast_FULL (731.134 µs) : 709, 753
.   : milestone, 731,
iast_GLOBAL (564.235 µs) : 542, 587
.   : milestone, 564,
iast_HARDCODED_SECRET_DISABLED (519.293 µs) : 496, 543
.   : milestone, 519,
iast_INACTIVE (460.761 µs) : 439, 482
.   : milestone, 461,
iast_TELEMETRY_OFF (510.765 µs) : 488, 534
.   : milestone, 511,
tracing (459.676 µs) : 438, 482
.   : milestone, 460,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 373.832 µs [354.218 µs, 393.445 µs] -
iast 516.04 µs [492.698 µs, 539.383 µs] 142.209 µs (38.0%)
iast_FULL 730.142 µs [708.155 µs, 752.13 µs] 356.31 µs (95.3%)
iast_GLOBAL 569.313 µs [546.071 µs, 592.554 µs] 195.481 µs (52.3%)
iast_HARDCODED_SECRET_DISABLED 522.846 µs [499.915 µs, 545.777 µs] 149.014 µs (39.9%)
iast_INACTIVE 459.518 µs [437.131 µs, 481.905 µs] 85.686 µs (22.9%)
iast_TELEMETRY_OFF 506.815 µs [483.431 µs, 530.199 µs] 132.983 µs (35.6%)
tracing 452.089 µs [430.017 µs, 474.16 µs] 78.257 µs (20.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 383.498 µs [363.774 µs, 403.223 µs] -
iast 518.69 µs [496.896 µs, 540.485 µs] 135.192 µs (35.3%)
iast_FULL 731.134 µs [709.344 µs, 752.925 µs] 347.636 µs (90.6%)
iast_GLOBAL 564.235 µs [541.875 µs, 586.596 µs] 180.737 µs (47.1%)
iast_HARDCODED_SECRET_DISABLED 519.293 µs [495.758 µs, 542.828 µs] 135.795 µs (35.4%)
iast_INACTIVE 460.761 µs [439.371 µs, 482.151 µs] 77.263 µs (20.1%)
iast_TELEMETRY_OFF 510.765 µs [487.559 µs, 533.971 µs] 127.266 µs (33.2%)
tracing 459.676 µs [437.765 µs, 481.586 µs] 76.177 µs (19.9%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.357 ms) : 1338, 1376
.   : milestone, 1357,
appsec (1.717 ms) : 1693, 1741
.   : milestone, 1717,
appsec_no_iast (1.726 ms) : 1703, 1750
.   : milestone, 1726,
code_origins (1.662 ms) : 1636, 1689
.   : milestone, 1662,
iast (1.512 ms) : 1488, 1536
.   : milestone, 1512,
profiling (1.563 ms) : 1538, 1587
.   : milestone, 1563,
tracing (1.487 ms) : 1463, 1510
.   : milestone, 1487,
section candidate
no_agent (1.347 ms) : 1328, 1366
.   : milestone, 1347,
appsec (1.734 ms) : 1711, 1757
.   : milestone, 1734,
appsec_no_iast (1.728 ms) : 1704, 1751
.   : milestone, 1728,
code_origins (1.671 ms) : 1645, 1698
.   : milestone, 1671,
iast (1.513 ms) : 1488, 1538
.   : milestone, 1513,
profiling (1.506 ms) : 1482, 1530
.   : milestone, 1506,
tracing (1.481 ms) : 1456, 1506
.   : milestone, 1481,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.357 ms [1.338 ms, 1.376 ms] -
appsec 1.717 ms [1.693 ms, 1.741 ms] 359.835 µs (26.5%)
appsec_no_iast 1.726 ms [1.703 ms, 1.75 ms] 369.219 µs (27.2%)
code_origins 1.662 ms [1.636 ms, 1.689 ms] 305.264 µs (22.5%)
iast 1.512 ms [1.488 ms, 1.536 ms] 154.729 µs (11.4%)
profiling 1.563 ms [1.538 ms, 1.587 ms] 205.525 µs (15.1%)
tracing 1.487 ms [1.463 ms, 1.51 ms] 129.399 µs (9.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.347 ms [1.328 ms, 1.366 ms] -
appsec 1.734 ms [1.711 ms, 1.757 ms] 386.442 µs (28.7%)
appsec_no_iast 1.728 ms [1.704 ms, 1.751 ms] 380.502 µs (28.2%)
code_origins 1.671 ms [1.645 ms, 1.698 ms] 324.337 µs (24.1%)
iast 1.513 ms [1.488 ms, 1.538 ms] 165.493 µs (12.3%)
profiling 1.506 ms [1.482 ms, 1.53 ms] 158.79 µs (11.8%)
tracing 1.481 ms [1.456 ms, 1.506 ms] 133.495 µs (9.9%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mhlidd/migrate_http_server_instrumentations
git_commit_date 1747743756 1747744971
git_commit_sha 0ebd52b 80529d3
release_version 1.50.0-SNAPSHOT~0ebd52ba72 1.50.0-SNAPSHOT~80529d3a40
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1747746888 1747746888
ci_job_id 945766108 945766108
ci_pipeline_id 65601299 65601299
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-ub2wu-al-project-304-concurrent-2-y87795yw 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-ub2wu-al-project-304-concurrent-2-y87795yw 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 tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.473 ms) : 1462, 1485
.   : milestone, 1473,
appsec (2.392 ms) : 2342, 2441
.   : milestone, 2392,
iast (2.18 ms) : 2118, 2242
.   : milestone, 2180,
iast_GLOBAL (2.224 ms) : 2162, 2286
.   : milestone, 2224,
profiling (2.042 ms) : 1990, 2093
.   : milestone, 2042,
tracing (2.004 ms) : 1956, 2052
.   : milestone, 2004,
section candidate
no_agent (1.47 ms) : 1459, 1482
.   : milestone, 1470,
appsec (2.396 ms) : 2347, 2446
.   : milestone, 2396,
iast (2.184 ms) : 2122, 2247
.   : milestone, 2184,
iast_GLOBAL (2.225 ms) : 2163, 2287
.   : milestone, 2225,
profiling (2.03 ms) : 1980, 2079
.   : milestone, 2030,
tracing (1.996 ms) : 1948, 2044
.   : milestone, 1996,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.473 ms [1.462 ms, 1.485 ms] -
appsec 2.392 ms [2.342 ms, 2.441 ms] 918.396 µs (62.3%)
iast 2.18 ms [2.118 ms, 2.242 ms] 706.752 µs (48.0%)
iast_GLOBAL 2.224 ms [2.162 ms, 2.286 ms] 750.575 µs (50.9%)
profiling 2.042 ms [1.99 ms, 2.093 ms] 568.351 µs (38.6%)
tracing 2.004 ms [1.956 ms, 2.052 ms] 531.127 µs (36.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.47 ms [1.459 ms, 1.482 ms] -
appsec 2.396 ms [2.347 ms, 2.446 ms] 926.107 µs (63.0%)
iast 2.184 ms [2.122 ms, 2.247 ms] 714.092 µs (48.6%)
iast_GLOBAL 2.225 ms [2.163 ms, 2.287 ms] 754.669 µs (51.3%)
profiling 2.03 ms [1.98 ms, 2.079 ms] 559.49 µs (38.1%)
tracing 1.996 ms [1.948 ms, 2.044 ms] 525.894 µs (35.8%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~80529d3a40, baseline=1.50.0-SNAPSHOT~0ebd52ba72
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.93 s) : 14930000, 14930000
.   : milestone, 14930000,
appsec (14.983 s) : 14983000, 14983000
.   : milestone, 14983000,
iast (18.926 s) : 18926000, 18926000
.   : milestone, 18926000,
iast_GLOBAL (18.056 s) : 18056000, 18056000
.   : milestone, 18056000,
profiling (15.421 s) : 15421000, 15421000
.   : milestone, 15421000,
tracing (14.987 s) : 14987000, 14987000
.   : milestone, 14987000,
section candidate
no_agent (15.466 s) : 15466000, 15466000
.   : milestone, 15466000,
appsec (15.142 s) : 15142000, 15142000
.   : milestone, 15142000,
iast (18.797 s) : 18797000, 18797000
.   : milestone, 18797000,
iast_GLOBAL (18.202 s) : 18202000, 18202000
.   : milestone, 18202000,
profiling (15.156 s) : 15156000, 15156000
.   : milestone, 15156000,
tracing (14.976 s) : 14976000, 14976000
.   : milestone, 14976000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.93 s [14.93 s, 14.93 s] -
appsec 14.983 s [14.983 s, 14.983 s] 53.0 ms (0.4%)
iast 18.926 s [18.926 s, 18.926 s] 3.996 s (26.8%)
iast_GLOBAL 18.056 s [18.056 s, 18.056 s] 3.126 s (20.9%)
profiling 15.421 s [15.421 s, 15.421 s] 491.0 ms (3.3%)
tracing 14.987 s [14.987 s, 14.987 s] 57.0 ms (0.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.466 s [15.466 s, 15.466 s] -
appsec 15.142 s [15.142 s, 15.142 s] -324.0 ms (-2.1%)
iast 18.797 s [18.797 s, 18.797 s] 3.331 s (21.5%)
iast_GLOBAL 18.202 s [18.202 s, 18.202 s] 2.736 s (17.7%)
profiling 15.156 s [15.156 s, 15.156 s] -310.0 ms (-2.0%)
tracing 14.976 s [14.976 s, 14.976 s] -490.0 ms (-3.2%)

@mhlidd mhlidd changed the title updating akkahttp Migrating all HttpServer Instrumentations to use Context and ContextScope May 13, 2025
@mhlidd mhlidd changed the base branch from mhlidd/migrate_tomcat_okhttp to master May 14, 2025 14:11
@mhlidd mhlidd changed the title Migrating all HttpServer Instrumentations to use Context and ContextScope Migrating all HttpServer Instrumentations to Extract full Context May 15, 2025
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

Forgot to submit my comment 😅

return extractedSpan == null ? null : (AgentSpanContext.Extracted) extractedSpan.context();
}

public AgentSpan onRequestWithContext(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be named onRequest. It won't conflict as the parameters are different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PerfectSlayer there is actually an issue with onRequest where they pass in null as a context, which then leads to the compiler being confused about which which function to use 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Was it null as the new API Context or as AgentSpan.Extracted?
For Context, it should never be null but root() instead.
For AgentSpan.Extracted, you may hint the compiler by using (AgentSpan.Extracted) null -- not ideal but the issue is more on using null arg than casting them 😇

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 don't think there are any direct passing of null. When a context gets extracted in instrumentation handlers, the context gets passed to onRequest, but if the value is null, then there is no way to know which one implementation to call. Is there a way to bypass this?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can always cast to (AgentSpan.Extracted) when you know you expect this type.
But for the runtime to be indecisive, I would expect the var type to be not strongly typed (like Object). Can you point me to the code that was failing so I can have a look?

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 was incorrect. There are calls to onRequest with null being passed in.

@mhlidd mhlidd force-pushed the mhlidd/migrate_http_server_instrumentations branch from 2a6d442 to 4e94f29 Compare May 16, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants