Skip to content

Conversation

@zarirhamza
Copy link
Contributor

@zarirhamza zarirhamza commented Aug 26, 2025

What Does This Do

This PR completes the context API migration for HTTP server spans, specifically within the beforeFinish lifecycle.
All remaining logic using AgentSpan has been refactored to rely on the Context API instead.
This ensures that HTTP server request handling and span finalization are fully context-based, aligning with the ongoing context migration across the tracer.


Motivation

Migrating HTTP server spans to use context exclusively is a key step toward unifying span management under the context API.

This change enables:

  • Serverless APIGW span generation by ensuring beforeFinish hooks can access tracing state via Context instead of AgentSpan. Refactor Severless Gateway Inferred Span #9388
  • Simpler and more robust context propagation across async boundaries.
  • Consistency with other instrumentation components that have already migrated to context-first APIs.

Additional Notes

This PR builds upon prior context migration work:

No functional behavior changes are expected for traced HTTP server requests, but all lifecycle callbacks (beforeFinish, request propagation, etc.) now operate entirely through Context.


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.11% (+3.50%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 82884df | 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 1762988581 1762993968
git_commit_sha 83fdea5 82884df
release_version 1.56.0-SNAPSHOT~83fdea5642 1.53.0-SNAPSHOT~82884df8d7
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1762995814 1762995814
ci_job_id 1231599074 1231599074
ci_pipeline_id 82187489 82187489
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-w569mfqb 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-w569mfqb 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 59 metrics, 6 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.102 s) : 0, 1101561
Total [baseline] (8.805 s) : 0, 8805351
Agent [candidate] (1.107 s) : 0, 1107110
Total [candidate] (8.872 s) : 0, 8871698
section iast
Agent [baseline] (1.246 s) : 0, 1246105
Total [baseline] (9.567 s) : 0, 9567405
Agent [candidate] (1.248 s) : 0, 1248465
Total [candidate] (9.615 s) : 0, 9615392
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.102 s -
Agent iast 1.246 s 144.544 ms (13.1%)
Total tracing 8.805 s -
Total iast 9.567 s 762.054 ms (8.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.107 s -
Agent iast 1.248 s 141.356 ms (12.8%)
Total tracing 8.872 s -
Total iast 9.615 s 743.694 ms (8.4%)
gantt
    title insecure-bank - break down per module: candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.453 ms) : 0, 1453
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (704.6 ms) : 0, 704600
BytebuddyAgent [candidate] (706.964 ms) : 0, 706964
GlobalTracer [baseline] (247.857 ms) : 0, 247857
GlobalTracer [candidate] (250.04 ms) : 0, 250040
AppSec [baseline] (32.272 ms) : 0, 32272
AppSec [candidate] (32.629 ms) : 0, 32629
Debugger [baseline] (68.342 ms) : 0, 68342
Debugger [candidate] (68.763 ms) : 0, 68763
Remote Config [baseline] (634.748 µs) : 0, 635
Remote Config [candidate] (640.864 µs) : 0, 641
Telemetry [baseline] (8.11 ms) : 0, 8110
Telemetry [candidate] (8.183 ms) : 0, 8183
Flare Poller [baseline] (3.683 ms) : 0, 3683
Flare Poller [candidate] (3.753 ms) : 0, 3753
section iast
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.444 ms) : 0, 1444
BytebuddyAgent [baseline] (834.354 ms) : 0, 834354
BytebuddyAgent [candidate] (834.441 ms) : 0, 834441
GlobalTracer [baseline] (237.611 ms) : 0, 237611
GlobalTracer [candidate] (238.342 ms) : 0, 238342
AppSec [baseline] (31.279 ms) : 0, 31279
AppSec [candidate] (31.522 ms) : 0, 31522
Debugger [baseline] (65.093 ms) : 0, 65093
Debugger [candidate] (65.611 ms) : 0, 65611
Remote Config [baseline] (559.998 µs) : 0, 560
Remote Config [candidate] (553.94 µs) : 0, 554
Telemetry [baseline] (7.71 ms) : 0, 7710
Telemetry [candidate] (7.741 ms) : 0, 7741
Flare Poller [baseline] (3.579 ms) : 0, 3579
Flare Poller [candidate] (3.645 ms) : 0, 3645
IAST [baseline] (29.732 ms) : 0, 29732
IAST [candidate] (30.547 ms) : 0, 30547
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.105 s) : 0, 1104522
Total [baseline] (10.742 s) : 0, 10741876
Agent [candidate] (1.103 s) : 0, 1103452
Total [candidate] (10.767 s) : 0, 10767187
section appsec
Agent [baseline] (1.279 s) : 0, 1278500
Total [baseline] (11.084 s) : 0, 11084440
Agent [candidate] (1.281 s) : 0, 1281321
Total [candidate] (11.117 s) : 0, 11117471
section iast
Agent [baseline] (1.24 s) : 0, 1240422
Total [baseline] (11.274 s) : 0, 11274084
Agent [candidate] (1.244 s) : 0, 1244412
Total [candidate] (11.26 s) : 0, 11259728
section profiling
Agent [baseline] (1.228 s) : 0, 1227674
Total [baseline] (10.999 s) : 0, 10999091
Agent [candidate] (1.232 s) : 0, 1231690
Total [candidate] (11.058 s) : 0, 11058387
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.105 s -
Agent appsec 1.279 s 173.978 ms (15.8%)
Agent iast 1.24 s 135.9 ms (12.3%)
Agent profiling 1.228 s 123.153 ms (11.1%)
Total tracing 10.742 s -
Total appsec 11.084 s 342.564 ms (3.2%)
Total iast 11.274 s 532.209 ms (5.0%)
Total profiling 10.999 s 257.215 ms (2.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.103 s -
Agent appsec 1.281 s 177.87 ms (16.1%)
Agent iast 1.244 s 140.961 ms (12.8%)
Agent profiling 1.232 s 128.238 ms (11.6%)
Total tracing 10.767 s -
Total appsec 11.117 s 350.284 ms (3.3%)
Total iast 11.26 s 492.541 ms (4.6%)
Total profiling 11.058 s 291.2 ms (2.7%)
gantt
    title petclinic - break down per module: candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.452 ms) : 0, 1452
crashtracking [candidate] (1.458 ms) : 0, 1458
BytebuddyAgent [baseline] (706.148 ms) : 0, 706148
BytebuddyAgent [candidate] (703.662 ms) : 0, 703662
GlobalTracer [baseline] (248.53 ms) : 0, 248530
GlobalTracer [candidate] (249.328 ms) : 0, 249328
AppSec [baseline] (32.42 ms) : 0, 32420
AppSec [candidate] (32.494 ms) : 0, 32494
Debugger [baseline] (68.827 ms) : 0, 68827
Debugger [candidate] (69.283 ms) : 0, 69283
Remote Config [baseline] (630.808 µs) : 0, 631
Remote Config [candidate] (632.69 µs) : 0, 633
Telemetry [baseline] (8.18 ms) : 0, 8180
Telemetry [candidate] (8.281 ms) : 0, 8281
Flare Poller [baseline] (3.714 ms) : 0, 3714
Flare Poller [candidate] (3.697 ms) : 0, 3697
section appsec
crashtracking [baseline] (1.447 ms) : 0, 1447
crashtracking [candidate] (1.463 ms) : 0, 1463
BytebuddyAgent [baseline] (728.96 ms) : 0, 728960
BytebuddyAgent [candidate] (730.513 ms) : 0, 730513
GlobalTracer [baseline] (240.342 ms) : 0, 240342
GlobalTracer [candidate] (241.637 ms) : 0, 241637
AppSec [baseline] (173.823 ms) : 0, 173823
AppSec [candidate] (174.167 ms) : 0, 174167
Debugger [baseline] (61.432 ms) : 0, 61432
Debugger [candidate] (60.853 ms) : 0, 60853
Remote Config [baseline] (656.429 µs) : 0, 656
Remote Config [candidate] (661.377 µs) : 0, 661
Telemetry [baseline] (8.424 ms) : 0, 8424
Telemetry [candidate] (8.326 ms) : 0, 8326
Flare Poller [baseline] (3.877 ms) : 0, 3877
Flare Poller [candidate] (3.846 ms) : 0, 3846
IAST [baseline] (24.833 ms) : 0, 24833
IAST [candidate] (25.019 ms) : 0, 25019
section iast
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.447 ms) : 0, 1447
BytebuddyAgent [baseline] (827.68 ms) : 0, 827680
BytebuddyAgent [candidate] (830.606 ms) : 0, 830606
GlobalTracer [baseline] (237.225 ms) : 0, 237225
GlobalTracer [candidate] (238.332 ms) : 0, 238332
AppSec [baseline] (30.557 ms) : 0, 30557
AppSec [candidate] (33.179 ms) : 0, 33179
Debugger [baseline] (66.173 ms) : 0, 66173
Debugger [candidate] (65.89 ms) : 0, 65890
Remote Config [baseline] (554.906 µs) : 0, 555
Remote Config [candidate] (544.072 µs) : 0, 544
Telemetry [baseline] (7.79 ms) : 0, 7790
Telemetry [candidate] (7.699 ms) : 0, 7699
Flare Poller [baseline] (3.634 ms) : 0, 3634
Flare Poller [candidate] (3.531 ms) : 0, 3531
IAST [baseline] (30.721 ms) : 0, 30721
IAST [candidate] (28.371 ms) : 0, 28371
section profiling
ProfilingAgent [baseline] (96.018 ms) : 0, 96018
ProfilingAgent [candidate] (96.515 ms) : 0, 96515
crashtracking [baseline] (1.417 ms) : 0, 1417
crashtracking [candidate] (1.44 ms) : 0, 1440
BytebuddyAgent [baseline] (727.731 ms) : 0, 727731
BytebuddyAgent [candidate] (729.814 ms) : 0, 729814
GlobalTracer [baseline] (221.312 ms) : 0, 221312
GlobalTracer [candidate] (221.934 ms) : 0, 221934
AppSec [baseline] (32.125 ms) : 0, 32125
AppSec [candidate] (32.283 ms) : 0, 32283
Debugger [baseline] (67.347 ms) : 0, 67347
Debugger [candidate] (67.767 ms) : 0, 67767
Remote Config [baseline] (652.299 µs) : 0, 652
Remote Config [candidate] (635.277 µs) : 0, 635
Telemetry [baseline] (7.839 ms) : 0, 7839
Telemetry [candidate] (7.873 ms) : 0, 7873
Flare Poller [baseline] (3.732 ms) : 0, 3732
Flare Poller [candidate] (3.764 ms) : 0, 3764
Profiling [baseline] (96.586 ms) : 0, 96586
Profiling [candidate] (97.096 ms) : 0, 97096
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master zarir/context-api-finish
git_commit_date 1762988581 1762993968
git_commit_sha 83fdea5 82884df
release_version 1.56.0-SNAPSHOT~83fdea5642 1.53.0-SNAPSHOT~82884df8d7
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1762996388 1762996388
ci_job_id 1231599075 1231599075
ci_pipeline_id 82187489 82187489
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-4vezbbao 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-4vezbbao 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 3 performance regressions! Performance is the same for 17 metrics, 16 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:profiling:high_load worse
[+41.551µs; +153.532µs] or [+2.632%; +9.725%]
unstable
[+115.963µs; +934.460µs] or [+2.705%; +21.800%]
unstable
[-447.020op/s; +97.520op/s] or [-18.841%; +4.110%]
1.676ms 4.812ms 2197.781op/s 1.579ms 4.287ms 2372.531op/s
scenario:load:petclinic:appsec:high_load worse
[+0.709ms; +1.470ms] or [+3.890%; +8.063%]
worse
[+0.859ms; +2.047ms] or [+2.888%; +6.887%]
unstable
[-37.336op/s; +11.711op/s] or [-14.892%; +4.671%]
19.315ms 31.182ms 237.906op/s 18.226ms 29.729ms 250.719op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.202 ms) : 1190, 1213
.   : milestone, 1202,
iast (3.204 ms) : 3156, 3252
.   : milestone, 3204,
iast_FULL (5.721 ms) : 5648, 5794
.   : milestone, 5721,
iast_GLOBAL (3.547 ms) : 3492, 3602
.   : milestone, 3547,
profiling (1.899 ms) : 1883, 1915
.   : milestone, 1899,
tracing (1.853 ms) : 1837, 1869
.   : milestone, 1853,
section candidate
no_agent (1.183 ms) : 1171, 1194
.   : milestone, 1183,
iast (3.195 ms) : 3153, 3236
.   : milestone, 3195,
iast_FULL (5.778 ms) : 5720, 5837
.   : milestone, 5778,
iast_GLOBAL (3.596 ms) : 3476, 3717
.   : milestone, 3596,
profiling (2.056 ms) : 2038, 2074
.   : milestone, 2056,
tracing (1.798 ms) : 1783, 1813
.   : milestone, 1798,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.202 ms [1.19 ms, 1.213 ms] -
iast 3.204 ms [3.156 ms, 3.252 ms] 2.002 ms (166.6%)
iast_FULL 5.721 ms [5.648 ms, 5.794 ms] 4.519 ms (376.1%)
iast_GLOBAL 3.547 ms [3.492 ms, 3.602 ms] 2.346 ms (195.2%)
profiling 1.899 ms [1.883 ms, 1.915 ms] 697.564 µs (58.1%)
tracing 1.853 ms [1.837 ms, 1.869 ms] 651.122 µs (54.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.183 ms [1.171 ms, 1.194 ms] -
iast 3.195 ms [3.153 ms, 3.236 ms] 2.012 ms (170.2%)
iast_FULL 5.778 ms [5.72 ms, 5.837 ms] 4.596 ms (388.6%)
iast_GLOBAL 3.596 ms [3.476 ms, 3.717 ms] 2.414 ms (204.1%)
profiling 2.056 ms [2.038 ms, 2.074 ms] 873.575 µs (73.9%)
tracing 1.798 ms [1.783 ms, 1.813 ms] 615.409 µs (52.0%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642
    dateFormat X
    axisFormat %s
section baseline
no_agent (18.132 ms) : 17947, 18318
.   : milestone, 18132,
appsec (18.61 ms) : 18424, 18796
.   : milestone, 18610,
code_origins (17.899 ms) : 17722, 18076
.   : milestone, 17899,
iast (17.893 ms) : 17716, 18069
.   : milestone, 17893,
profiling (18.783 ms) : 18594, 18971
.   : milestone, 18783,
tracing (17.489 ms) : 17315, 17662
.   : milestone, 17489,
section candidate
no_agent (18.263 ms) : 18075, 18451
.   : milestone, 18263,
appsec (19.615 ms) : 19415, 19814
.   : milestone, 19615,
code_origins (17.681 ms) : 17506, 17856
.   : milestone, 17681,
iast (18.318 ms) : 18133, 18503
.   : milestone, 18318,
profiling (18.482 ms) : 18296, 18668
.   : milestone, 18482,
tracing (17.58 ms) : 17407, 17753
.   : milestone, 17580,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.132 ms [17.947 ms, 18.318 ms] -
appsec 18.61 ms [18.424 ms, 18.796 ms] 477.693 µs (2.6%)
code_origins 17.899 ms [17.722 ms, 18.076 ms] -233.534 µs (-1.3%)
iast 17.893 ms [17.716 ms, 18.069 ms] -239.489 µs (-1.3%)
profiling 18.783 ms [18.594 ms, 18.971 ms] 650.288 µs (3.6%)
tracing 17.489 ms [17.315 ms, 17.662 ms] -643.651 µs (-3.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.263 ms [18.075 ms, 18.451 ms] -
appsec 19.615 ms [19.415 ms, 19.814 ms] 1.352 ms (7.4%)
code_origins 17.681 ms [17.506 ms, 17.856 ms] -582.175 µs (-3.2%)
iast 18.318 ms [18.133 ms, 18.503 ms] 54.458 µs (0.3%)
profiling 18.482 ms [18.296 ms, 18.668 ms] 218.816 µs (1.2%)
tracing 17.58 ms [17.407 ms, 17.753 ms] -683.0 µs (-3.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master zarir/context-api-finish
git_commit_date 1762988581 1762993968
git_commit_sha 83fdea5 82884df
release_version 1.56.0-SNAPSHOT~83fdea5642 1.53.0-SNAPSHOT~82884df8d7
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1762996036 1762996036
ci_job_id 1231599076 1231599076
ci_pipeline_id 82187489 82187489
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-6h3muo5b 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-6h3muo5b 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~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.626 s) : 15626000, 15626000
.   : milestone, 15626000,
appsec (15.184 s) : 15184000, 15184000
.   : milestone, 15184000,
iast (18.575 s) : 18575000, 18575000
.   : milestone, 18575000,
iast_GLOBAL (18.019 s) : 18019000, 18019000
.   : milestone, 18019000,
profiling (14.847 s) : 14847000, 14847000
.   : milestone, 14847000,
tracing (14.73 s) : 14730000, 14730000
.   : milestone, 14730000,
section candidate
no_agent (15.631 s) : 15631000, 15631000
.   : milestone, 15631000,
appsec (14.912 s) : 14912000, 14912000
.   : milestone, 14912000,
iast (18.338 s) : 18338000, 18338000
.   : milestone, 18338000,
iast_GLOBAL (18.057 s) : 18057000, 18057000
.   : milestone, 18057000,
profiling (15.026 s) : 15026000, 15026000
.   : milestone, 15026000,
tracing (14.543 s) : 14543000, 14543000
.   : milestone, 14543000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.626 s [15.626 s, 15.626 s] -
appsec 15.184 s [15.184 s, 15.184 s] -442.0 ms (-2.8%)
iast 18.575 s [18.575 s, 18.575 s] 2.949 s (18.9%)
iast_GLOBAL 18.019 s [18.019 s, 18.019 s] 2.393 s (15.3%)
profiling 14.847 s [14.847 s, 14.847 s] -779.0 ms (-5.0%)
tracing 14.73 s [14.73 s, 14.73 s] -896.0 ms (-5.7%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.631 s [15.631 s, 15.631 s] -
appsec 14.912 s [14.912 s, 14.912 s] -719.0 ms (-4.6%)
iast 18.338 s [18.338 s, 18.338 s] 2.707 s (17.3%)
iast_GLOBAL 18.057 s [18.057 s, 18.057 s] 2.426 s (15.5%)
profiling 15.026 s [15.026 s, 15.026 s] -605.0 ms (-3.9%)
tracing 14.543 s [14.543 s, 14.543 s] -1.088 s (-7.0%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~82884df8d7, baseline=1.56.0-SNAPSHOT~83fdea5642
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.47 ms) : 1459, 1482
.   : milestone, 1470,
appsec (3.563 ms) : 3356, 3771
.   : milestone, 3563,
iast (2.205 ms) : 2142, 2269
.   : milestone, 2205,
iast_GLOBAL (2.234 ms) : 2171, 2297
.   : milestone, 2234,
profiling (2.048 ms) : 1996, 2100
.   : milestone, 2048,
tracing (2.015 ms) : 1966, 2064
.   : milestone, 2015,
section candidate
no_agent (1.475 ms) : 1463, 1486
.   : milestone, 1475,
appsec (3.625 ms) : 3411, 3839
.   : milestone, 3625,
iast (2.191 ms) : 2128, 2254
.   : milestone, 2191,
iast_GLOBAL (2.236 ms) : 2172, 2299
.   : milestone, 2236,
profiling (2.066 ms) : 2013, 2119
.   : milestone, 2066,
tracing (2.014 ms) : 1965, 2063
.   : milestone, 2014,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.47 ms [1.459 ms, 1.482 ms] -
appsec 3.563 ms [3.356 ms, 3.771 ms] 2.093 ms (142.4%)
iast 2.205 ms [2.142 ms, 2.269 ms] 734.936 µs (50.0%)
iast_GLOBAL 2.234 ms [2.171 ms, 2.297 ms] 764.039 µs (52.0%)
profiling 2.048 ms [1.996 ms, 2.1 ms] 577.667 µs (39.3%)
tracing 2.015 ms [1.966 ms, 2.064 ms] 545.107 µs (37.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.463 ms, 1.486 ms] -
appsec 3.625 ms [3.411 ms, 3.839 ms] 2.15 ms (145.8%)
iast 2.191 ms [2.128 ms, 2.254 ms] 716.53 µs (48.6%)
iast_GLOBAL 2.236 ms [2.172 ms, 2.299 ms] 760.984 µs (51.6%)
profiling 2.066 ms [2.013 ms, 2.119 ms] 591.391 µs (40.1%)
tracing 2.014 ms [1.965 ms, 2.063 ms] 539.63 µs (36.6%)

@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
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.

Few small questions/nits

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.

One leftover. Thanks for the changes!

Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

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

Thanks! The change looks good. A couple of suggestions:

  • Remove BaseDecorator.beforeFinish(final AgentSpan span). It doesn't seem to be used anymore.
  • Also, remove the extra indentation by using an early exit if there is no context. This will make the code easier to read and maintain. Additionally, your change will be more targeted.
  • Remove the assignments inside the conditions. These changes will make the code easier to read and maintain.

@zarirhamza
Copy link
Contributor Author

  • Remove BaseDecorator.beforeFinish(final AgentSpan span). It doesn't seem to be used anymore.

We cannot do this because it is still used in the majority of client spans. This refactor removed the dependency in server spans

@zarirhamza zarirhamza force-pushed the zarir/context-api-finish branch from 8ca345f to 82884df Compare November 13, 2025 00:33
@zarirhamza zarirhamza enabled auto-merge (squash) November 13, 2025 00:37
@zarirhamza zarirhamza merged commit b99070a into master Nov 13, 2025
540 checks passed
@zarirhamza zarirhamza deleted the zarir/context-api-finish branch November 13, 2025 01:25
@github-actions github-actions bot added this to the 1.56.0 milestone Nov 13, 2025
@PerfectSlayer PerfectSlayer added the tag: no release notes Changes to exclude from release notes label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: others All other instrumentations tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants