Skip to content

Conversation

@zarirhamza
Copy link
Contributor

@zarirhamza zarirhamza commented Aug 26, 2025

What Does This Do

Finishes context API migration in regards to beforeFinish using context instead of span
Refactors everything to use context instead of span across requests

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

jordan-wong and others added 3 commits August 21, 2025 09:43
* Creates inferred proxy spans for API Gateway calls via presence of http headers

---------

Co-authored-by: Zarir Hamza <[email protected]>
Avoid duplicate expensive context extraction
Avoid subclassing tracing span for serverless but used serverless context element instead to store / track inferred span while keep tracing feature untouched
Improved propagator to not create / capture inferred span context element on invalid data
Rework context element to hold the inferred spans and its captured data
Release captured data as soon as they span start (never read after this point so reclaiming memory)
Refactor context element and propagator into the right package, not context component (product / feature agnostic)
Refactor unit tests
@zarirhamza zarirhamza added inst: others All other instrumentations type: refactoring tag: serverless Serverless support and removed tag: serverless Serverless support labels Aug 26, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Aug 26, 2025

🎯 Code Coverage
Patch Coverage: 0.00%
Total Coverage: 63.29% (+3.59%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0c4ab54 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Aug 26, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master zarir/context-api-finish
git_commit_date 1761835849 1761847525
git_commit_sha 9b91826 0c4ab54
release_version 1.55.0-SNAPSHOT~9b91826873 1.53.0-SNAPSHOT~0c4ab54349
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1761849306 1761849306
ci_job_id 1207571705 1207571705
ci_pipeline_id 80789619 80789619
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-imfus8px 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-imfus8px 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 53 metrics, 12 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.04 s) : 0, 1039839
Total [baseline] (10.831 s) : 0, 10831178
Agent [candidate] (1.032 s) : 0, 1032273
Total [candidate] (10.933 s) : 0, 10933219
section appsec
Agent [baseline] (1.208 s) : 0, 1208155
Total [baseline] (11.051 s) : 0, 11051235
Agent [candidate] (1.204 s) : 0, 1203572
Total [candidate] (10.89 s) : 0, 10890336
section iast
Agent [baseline] (1.173 s) : 0, 1172820
Total [baseline] (11.095 s) : 0, 11095049
Agent [candidate] (1.165 s) : 0, 1164921
Total [candidate] (11.131 s) : 0, 11130919
section profiling
Agent [baseline] (1.172 s) : 0, 1172148
Total [baseline] (10.905 s) : 0, 10905487
Agent [candidate] (1.179 s) : 0, 1179304
Total [candidate] (10.97 s) : 0, 10970120
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.04 s -
Agent appsec 1.208 s 168.316 ms (16.2%)
Agent iast 1.173 s 132.981 ms (12.8%)
Agent profiling 1.172 s 132.31 ms (12.7%)
Total tracing 10.831 s -
Total appsec 11.051 s 220.057 ms (2.0%)
Total iast 11.095 s 263.871 ms (2.4%)
Total profiling 10.905 s 74.31 ms (0.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.032 s -
Agent appsec 1.204 s 171.299 ms (16.6%)
Agent iast 1.165 s 132.647 ms (12.9%)
Agent profiling 1.179 s 147.031 ms (14.2%)
Total tracing 10.933 s -
Total appsec 10.89 s -42.883 ms (-0.4%)
Total iast 11.131 s 197.7 ms (1.8%)
Total profiling 10.97 s 36.901 ms (0.3%)
gantt
    title petclinic - break down per module: candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.499 ms) : 0, 1499
crashtracking [candidate] (1.489 ms) : 0, 1489
BytebuddyAgent [baseline] (709.546 ms) : 0, 709546
BytebuddyAgent [candidate] (703.741 ms) : 0, 703741
GlobalTracer [baseline] (246.544 ms) : 0, 246544
GlobalTracer [candidate] (245.502 ms) : 0, 245502
AppSec [baseline] (32.652 ms) : 0, 32652
AppSec [candidate] (32.297 ms) : 0, 32297
Debugger [baseline] (6.457 ms) : 0, 6457
Debugger [candidate] (6.36 ms) : 0, 6360
Remote Config [baseline] (683.665 µs) : 0, 684
Remote Config [candidate] (677.718 µs) : 0, 678
Telemetry [baseline] (15.288 ms) : 0, 15288
Telemetry [candidate] (14.474 ms) : 0, 14474
Flare Poller [baseline] (5.725 ms) : 0, 5725
Flare Poller [candidate] (6.446 ms) : 0, 6446
section appsec
crashtracking [baseline] (1.481 ms) : 0, 1481
crashtracking [candidate] (1.466 ms) : 0, 1466
BytebuddyAgent [baseline] (728.384 ms) : 0, 728384
BytebuddyAgent [candidate] (726.896 ms) : 0, 726896
GlobalTracer [baseline] (236.752 ms) : 0, 236752
GlobalTracer [candidate] (236.04 ms) : 0, 236040
IAST [baseline] (25.089 ms) : 0, 25089
IAST [candidate] (24.882 ms) : 0, 24882
AppSec [baseline] (176.046 ms) : 0, 176046
AppSec [candidate] (174.344 ms) : 0, 174344
Debugger [baseline] (6.018 ms) : 0, 6018
Debugger [candidate] (5.925 ms) : 0, 5925
Remote Config [baseline] (638.907 µs) : 0, 639
Remote Config [candidate] (624.313 µs) : 0, 624
Telemetry [baseline] (8.614 ms) : 0, 8614
Telemetry [candidate] (8.38 ms) : 0, 8380
Flare Poller [baseline] (3.947 ms) : 0, 3947
Flare Poller [candidate] (3.862 ms) : 0, 3862
section iast
crashtracking [baseline] (1.481 ms) : 0, 1481
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (833.606 ms) : 0, 833606
BytebuddyAgent [candidate] (826.285 ms) : 0, 826285
GlobalTracer [baseline] (235.032 ms) : 0, 235032
GlobalTracer [candidate] (234.711 ms) : 0, 234711
IAST [baseline] (35.262 ms) : 0, 35262
IAST [candidate] (31.905 ms) : 0, 31905
AppSec [baseline] (26.545 ms) : 0, 26545
AppSec [candidate] (29.707 ms) : 0, 29707
Debugger [baseline] (6.195 ms) : 0, 6195
Debugger [candidate] (6.172 ms) : 0, 6172
Remote Config [baseline] (608.072 µs) : 0, 608
Remote Config [candidate] (604.406 µs) : 0, 604
Telemetry [baseline] (8.541 ms) : 0, 8541
Telemetry [candidate] (8.558 ms) : 0, 8558
Flare Poller [baseline] (4.139 ms) : 0, 4139
Flare Poller [candidate] (4.201 ms) : 0, 4201
section profiling
crashtracking [baseline] (1.467 ms) : 0, 1467
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (726.125 ms) : 0, 726125
BytebuddyAgent [candidate] (730.945 ms) : 0, 730945
GlobalTracer [baseline] (219.885 ms) : 0, 219885
GlobalTracer [candidate] (221.301 ms) : 0, 221301
AppSec [baseline] (32.147 ms) : 0, 32147
AppSec [candidate] (33.301 ms) : 0, 33301
Debugger [baseline] (11.344 ms) : 0, 11344
Debugger [candidate] (9.991 ms) : 0, 9991
Remote Config [baseline] (1.485 ms) : 0, 1485
Remote Config [candidate] (2.098 ms) : 0, 2098
Telemetry [baseline] (9.963 ms) : 0, 9963
Telemetry [candidate] (10.694 ms) : 0, 10694
Flare Poller [baseline] (4.057 ms) : 0, 4057
Flare Poller [candidate] (4.112 ms) : 0, 4112
ProfilingAgent [baseline] (109.407 ms) : 0, 109407
ProfilingAgent [candidate] (109.585 ms) : 0, 109585
Profiling [baseline] (110.052 ms) : 0, 110052
Profiling [candidate] (110.205 ms) : 0, 110205
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.032 s) : 0, 1031648
Total [baseline] (8.724 s) : 0, 8724048
Agent [candidate] (1.038 s) : 0, 1038456
Total [candidate] (8.705 s) : 0, 8705303
section iast
Agent [baseline] (1.165 s) : 0, 1164984
Total [baseline] (9.438 s) : 0, 9438284
Agent [candidate] (1.165 s) : 0, 1165461
Total [candidate] (9.369 s) : 0, 9368625
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.032 s -
Agent iast 1.165 s 133.337 ms (12.9%)
Total tracing 8.724 s -
Total iast 9.438 s 714.236 ms (8.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.038 s -
Agent iast 1.165 s 127.006 ms (12.2%)
Total tracing 8.705 s -
Total iast 9.369 s 663.322 ms (7.6%)
gantt
    title insecure-bank - break down per module: candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.466 ms) : 0, 1466
crashtracking [candidate] (1.488 ms) : 0, 1488
BytebuddyAgent [baseline] (703.841 ms) : 0, 703841
BytebuddyAgent [candidate] (709.536 ms) : 0, 709536
GlobalTracer [baseline] (244.917 ms) : 0, 244917
GlobalTracer [candidate] (245.56 ms) : 0, 245560
AppSec [baseline] (32.16 ms) : 0, 32160
AppSec [candidate] (32.346 ms) : 0, 32346
Debugger [baseline] (6.378 ms) : 0, 6378
Debugger [candidate] (6.398 ms) : 0, 6398
Remote Config [baseline] (689.018 µs) : 0, 689
Remote Config [candidate] (679.122 µs) : 0, 679
Telemetry [baseline] (13.021 ms) : 0, 13021
Telemetry [candidate] (14.993 ms) : 0, 14993
Flare Poller [baseline] (7.978 ms) : 0, 7978
Flare Poller [candidate] (6.07 ms) : 0, 6070
section iast
crashtracking [baseline] (1.492 ms) : 0, 1492
crashtracking [candidate] (1.466 ms) : 0, 1466
BytebuddyAgent [baseline] (824.368 ms) : 0, 824368
BytebuddyAgent [candidate] (826.489 ms) : 0, 826489
GlobalTracer [baseline] (235.723 ms) : 0, 235723
GlobalTracer [candidate] (235.397 ms) : 0, 235397
AppSec [baseline] (29.346 ms) : 0, 29346
AppSec [candidate] (29.808 ms) : 0, 29808
Debugger [baseline] (6.155 ms) : 0, 6155
Debugger [candidate] (6.08 ms) : 0, 6080
Remote Config [baseline] (607.911 µs) : 0, 608
Remote Config [candidate] (598.699 µs) : 0, 599
Telemetry [baseline] (8.612 ms) : 0, 8612
Telemetry [candidate] (8.507 ms) : 0, 8507
Flare Poller [baseline] (4.21 ms) : 0, 4210
Flare Poller [candidate] (4.039 ms) : 0, 4039
IAST [baseline] (33.156 ms) : 0, 33156
IAST [candidate] (31.725 ms) : 0, 31725
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master zarir/context-api-finish
git_commit_date 1761835849 1761847525
git_commit_sha 9b91826 0c4ab54
release_version 1.55.0-SNAPSHOT~9b91826873 1.53.0-SNAPSHOT~0c4ab54349
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1761849796 1761849796
ci_job_id 1207571707 1207571707
ci_pipeline_id 80789619 80789619
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-1-pl9nl2ib 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-1-pl9nl2ib 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 3 performance improvements and 3 performance regressions! Performance is the same for 6 metrics, 12 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:insecure-bank:tracing:high_load worse
[+46.737µs; +80.723µs] or [+2.615%; +4.517%]
unstable
[-362.594op/s; +196.844op/s] or [-14.419%; +7.828%]
1.851ms 2431.875op/s 1.787ms 2514.750op/s
scenario:load:insecure-bank:profiling:high_load better
[-79.241µs; -45.180µs] or [-4.052%; -2.310%]
unstable
[-195.363op/s; +343.488op/s] or [-8.475%; +14.901%]
1.893ms 2379.188op/s 1.956ms 2305.125op/s
scenario:load:insecure-bank:iast_FULL:high_load worse
[+320.961µs; +445.779µs] or [+5.722%; +7.948%]
unstable
[-134.744op/s; +30.681op/s] or [-16.353%; +3.724%]
5.992ms 771.938op/s 5.609ms 823.969op/s
scenario:load:insecure-bank:iast:high_load better
[-188.475µs; -89.703µs] or [-5.647%; -2.688%]
unstable
[-94.868op/s; +211.305op/s] or [-6.916%; +15.404%]
3.198ms 1429.969op/s 3.337ms 1371.750op/s
scenario:load:petclinic:tracing:high_load better
[-1130.814µs; -740.397µs] or [-6.102%; -3.995%]
unstable
[-13.608op/s; +40.296op/s] or [-5.403%; +15.998%]
17.596ms 265.219op/s 18.531ms 251.875op/s
scenario:load:petclinic:profiling:high_load worse
[+643.213µs; +1067.718µs] or [+3.335%; +5.535%]
unstable
[-34.957op/s; +14.582op/s] or [-14.445%; +6.026%]
20.145ms 231.812op/s 19.289ms 242.000op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.202 ms) : 1190, 1214
.   : milestone, 1202,
iast (3.337 ms) : 3288, 3387
.   : milestone, 3337,
iast_FULL (5.609 ms) : 5554, 5664
.   : milestone, 5609,
iast_GLOBAL (3.598 ms) : 3532, 3664
.   : milestone, 3598,
profiling (1.956 ms) : 1939, 1972
.   : milestone, 1956,
tracing (1.787 ms) : 1771, 1803
.   : milestone, 1787,
section candidate
no_agent (1.197 ms) : 1185, 1209
.   : milestone, 1197,
iast (3.198 ms) : 3156, 3241
.   : milestone, 3198,
iast_FULL (5.992 ms) : 5931, 6053
.   : milestone, 5992,
iast_GLOBAL (3.619 ms) : 3566, 3671
.   : milestone, 3619,
profiling (1.893 ms) : 1878, 1908
.   : milestone, 1893,
tracing (1.851 ms) : 1835, 1866
.   : milestone, 1851,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.202 ms [1.19 ms, 1.214 ms] -
iast 3.337 ms [3.288 ms, 3.387 ms] 2.136 ms (177.7%)
iast_FULL 5.609 ms [5.554 ms, 5.664 ms] 4.407 ms (366.7%)
iast_GLOBAL 3.598 ms [3.532 ms, 3.664 ms] 2.396 ms (199.4%)
profiling 1.956 ms [1.939 ms, 1.972 ms] 753.737 µs (62.7%)
tracing 1.787 ms [1.771 ms, 1.803 ms] 585.168 µs (48.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.197 ms [1.185 ms, 1.209 ms] -
iast 3.198 ms [3.156 ms, 3.241 ms] 2.001 ms (167.2%)
iast_FULL 5.992 ms [5.931 ms, 6.053 ms] 4.795 ms (400.5%)
iast_GLOBAL 3.619 ms [3.566 ms, 3.671 ms] 2.421 ms (202.3%)
profiling 1.893 ms [1.878 ms, 1.908 ms] 696.124 µs (58.1%)
tracing 1.851 ms [1.835 ms, 1.866 ms] 653.496 µs (54.6%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873
    dateFormat X
    axisFormat %s
section baseline
no_agent (18.083 ms) : 17900, 18266
.   : milestone, 18083,
appsec (19.799 ms) : 19594, 20004
.   : milestone, 19799,
code_origins (18.371 ms) : 18187, 18554
.   : milestone, 18371,
iast (18.526 ms) : 18338, 18714
.   : milestone, 18526,
profiling (19.289 ms) : 19094, 19484
.   : milestone, 19289,
tracing (18.531 ms) : 18344, 18718
.   : milestone, 18531,
section candidate
no_agent (18.273 ms) : 18086, 18459
.   : milestone, 18273,
appsec (19.605 ms) : 19403, 19808
.   : milestone, 19605,
code_origins (18.431 ms) : 18246, 18616
.   : milestone, 18431,
iast (18.394 ms) : 18207, 18581
.   : milestone, 18394,
profiling (20.145 ms) : 19945, 20344
.   : milestone, 20145,
tracing (17.596 ms) : 17420, 17771
.   : milestone, 17596,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.083 ms [17.9 ms, 18.266 ms] -
appsec 19.799 ms [19.594 ms, 20.004 ms] 1.716 ms (9.5%)
code_origins 18.371 ms [18.187 ms, 18.554 ms] 287.715 µs (1.6%)
iast 18.526 ms [18.338 ms, 18.714 ms] 443.229 µs (2.5%)
profiling 19.289 ms [19.094 ms, 19.484 ms] 1.206 ms (6.7%)
tracing 18.531 ms [18.344 ms, 18.718 ms] 448.498 µs (2.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.273 ms [18.086 ms, 18.459 ms] -
appsec 19.605 ms [19.403 ms, 19.808 ms] 1.333 ms (7.3%)
code_origins 18.431 ms [18.246 ms, 18.616 ms] 158.356 µs (0.9%)
iast 18.394 ms [18.207 ms, 18.581 ms] 121.386 µs (0.7%)
profiling 20.145 ms [19.945 ms, 20.344 ms] 1.872 ms (10.2%)
tracing 17.596 ms [17.42 ms, 17.771 ms] -676.936 µs (-3.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master zarir/context-api-finish
git_commit_date 1761835849 1761847525
git_commit_sha 9b91826 0c4ab54
release_version 1.55.0-SNAPSHOT~9b91826873 1.53.0-SNAPSHOT~0c4ab54349
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1761849469 1761849469
ci_job_id 1207571709 1207571709
ci_pipeline_id 80789619 80789619
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-2-47dr8n67 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-2-47dr8n67 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.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.672 s) : 15672000, 15672000
.   : milestone, 15672000,
appsec (15.011 s) : 15011000, 15011000
.   : milestone, 15011000,
iast (18.986 s) : 18986000, 18986000
.   : milestone, 18986000,
iast_GLOBAL (18.323 s) : 18323000, 18323000
.   : milestone, 18323000,
profiling (15.287 s) : 15287000, 15287000
.   : milestone, 15287000,
tracing (15.137 s) : 15137000, 15137000
.   : milestone, 15137000,
section candidate
no_agent (15.558 s) : 15558000, 15558000
.   : milestone, 15558000,
appsec (14.893 s) : 14893000, 14893000
.   : milestone, 14893000,
iast (18.497 s) : 18497000, 18497000
.   : milestone, 18497000,
iast_GLOBAL (17.804 s) : 17804000, 17804000
.   : milestone, 17804000,
profiling (15.343 s) : 15343000, 15343000
.   : milestone, 15343000,
tracing (15.287 s) : 15287000, 15287000
.   : milestone, 15287000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.672 s [15.672 s, 15.672 s] -
appsec 15.011 s [15.011 s, 15.011 s] -661.0 ms (-4.2%)
iast 18.986 s [18.986 s, 18.986 s] 3.314 s (21.1%)
iast_GLOBAL 18.323 s [18.323 s, 18.323 s] 2.651 s (16.9%)
profiling 15.287 s [15.287 s, 15.287 s] -385.0 ms (-2.5%)
tracing 15.137 s [15.137 s, 15.137 s] -535.0 ms (-3.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.558 s [15.558 s, 15.558 s] -
appsec 14.893 s [14.893 s, 14.893 s] -665.0 ms (-4.3%)
iast 18.497 s [18.497 s, 18.497 s] 2.939 s (18.9%)
iast_GLOBAL 17.804 s [17.804 s, 17.804 s] 2.246 s (14.4%)
profiling 15.343 s [15.343 s, 15.343 s] -215.0 ms (-1.4%)
tracing 15.287 s [15.287 s, 15.287 s] -271.0 ms (-1.7%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~0c4ab54349, baseline=1.55.0-SNAPSHOT~9b91826873
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.476 ms) : 1465, 1488
.   : milestone, 1476,
appsec (3.712 ms) : 3493, 3931
.   : milestone, 3712,
iast (2.216 ms) : 2152, 2279
.   : milestone, 2216,
iast_GLOBAL (2.261 ms) : 2197, 2325
.   : milestone, 2261,
profiling (2.08 ms) : 2026, 2133
.   : milestone, 2080,
tracing (2.031 ms) : 1981, 2081
.   : milestone, 2031,
section candidate
no_agent (1.475 ms) : 1463, 1486
.   : milestone, 1475,
appsec (3.719 ms) : 3502, 3937
.   : milestone, 3719,
iast (2.212 ms) : 2148, 2276
.   : milestone, 2212,
iast_GLOBAL (2.243 ms) : 2179, 2307
.   : milestone, 2243,
profiling (2.08 ms) : 2027, 2133
.   : milestone, 2080,
tracing (2.041 ms) : 1991, 2091
.   : milestone, 2041,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.476 ms [1.465 ms, 1.488 ms] -
appsec 3.712 ms [3.493 ms, 3.931 ms] 2.236 ms (151.4%)
iast 2.216 ms [2.152 ms, 2.279 ms] 739.422 µs (50.1%)
iast_GLOBAL 2.261 ms [2.197 ms, 2.325 ms] 784.535 µs (53.1%)
profiling 2.08 ms [2.026 ms, 2.133 ms] 603.589 µs (40.9%)
tracing 2.031 ms [1.981 ms, 2.081 ms] 554.287 µs (37.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.463 ms, 1.486 ms] -
appsec 3.719 ms [3.502 ms, 3.937 ms] 2.245 ms (152.2%)
iast 2.212 ms [2.148 ms, 2.276 ms] 737.225 µs (50.0%)
iast_GLOBAL 2.243 ms [2.179 ms, 2.307 ms] 768.695 µs (52.1%)
profiling 2.08 ms [2.027 ms, 2.133 ms] 605.525 µs (41.1%)
tracing 2.041 ms [1.991 ms, 2.091 ms] 566.088 µs (38.4%)

@zarirhamza zarirhamza added the tag: serverless Serverless support label Aug 26, 2025
@zarirhamza zarirhamza marked this pull request as ready for review August 26, 2025 21:47
@zarirhamza zarirhamza requested review from a team as code owners August 26, 2025 21:47
@zarirhamza zarirhamza requested review from PerfectSlayer, dougqh, robertpi and sezen-datadog and removed request for a team August 26, 2025 21:47
@zarirhamza zarirhamza changed the base branch from master to bbujon/gateway-inferred-span2 August 27, 2025 15:14
@zarirhamza zarirhamza requested a review from a team as a code owner August 27, 2025 15:14
@zarirhamza zarirhamza requested a review from Mariovido August 27, 2025 15:14
@zarirhamza zarirhamza changed the base branch from bbujon/gateway-inferred-span2 to master August 27, 2025 15:18
@zarirhamza zarirhamza removed the tag: serverless Serverless support label Aug 27, 2025
Comment on lines 85 to 87
public AgentSpan beforeFinish(final AgentSpan span) {
return span;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that the only one blocker? Because the WebSocketDecorator is calling the empty BaseDecorator.beforeFinish() and has no override... So technically, the call is doing nothing :/
So we can move it from BaseDecorator to WebSocketDecorator and migrate it in a second pass.

@amarziali What's the effort to migrate the WebSocket instrumentation to context rather than span?

@@ -53,42 +55,58 @@ public void methodAdvice(MethodTransformer transformer) {

static class HandleAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
static AgentScope onEnter(
static ContextScope onEnter(
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 notes: Note for myself. Time boxed the review to 1h and paused here for Today

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.

I miss baggage about Jetty instrumentation but mixing main context and dispatch span feels different than the original behavior. Did I miss something?

@zarirhamza
Copy link
Contributor Author

System Tests are fixed here - DataDog/system-tests#5430

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.

👋 I didn't get the chance to fully review all files but I do have a concern.

Whenever scope.context() is called, we may need to make sure that the scope used is a ContextScope. If it is invoked on an AgentScope (like it is in many files now), we will get an AgentSpan back, which will lead to the wrong implementation of beforeFinish being called and the InferredProxySpan not actually getting finished.

Curious to what @PerfectSlayer and @mcculls think about this.

if (throwable != null) {
DECORATE.onError(span, throwable);
DECORATE.beforeFinish(span);
DECORATE.beforeFinish(scope.context());
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here, may need to migrate to ContextScope.

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

Labels

inst: others All other instrumentations type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants