Skip to content

Conversation

@PerfectSlayer
Copy link
Contributor

@PerfectSlayer PerfectSlayer commented Jan 16, 2025

What Does This Do

First part of the refactoring only.
Only moved the API to the tracer, not the internal behavior.
Async flag should move away from the scope itself.

Motivation

This should help testing if moving the API from the scope to the tracer cause issues as the scope will implicitly be the active scope.

Additional Notes

Contributor Checklist

Jira ticket: APMAPI-954

@pr-commenter
Copy link

pr-commenter bot commented Jan 16, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/context-scope-async-propagation
git_commit_date 1737460501 1737465422
git_commit_sha 693c605 92e1a55
release_version 1.46.0-SNAPSHOT~693c605f76 1.46.0-SNAPSHOT~92e1a55c31
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1737467908 1737467908
ci_job_id 773945137 773945137
ci_pipeline_id 53547951 53547951
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for petclinic
gantt title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section tracing Agent [baseline] (1.057 s) : 0, 1057180 Total [baseline] (10.516 s) : 0, 10515563 Agent [candidate] (1.06 s) : 0, 1060267 Total [candidate] (10.426 s) : 0, 10425662 section appsec Agent [baseline] (1.19 s) : 0, 1190308 Total [baseline] (10.701 s) : 0, 10700653 Agent [candidate] (1.188 s) : 0, 1187682 Total [candidate] (10.715 s) : 0, 10714625 section iast Agent [baseline] (1.196 s) : 0, 1195932 Total [baseline] (10.991 s) : 0, 10990707 Agent [candidate] (1.183 s) : 0, 1183359 Total [candidate] (11.021 s) : 0, 11020779 section profiling Agent [baseline] (1.252 s) : 0, 1251921 Total [baseline] (10.835 s) : 0, 10835463 Agent [candidate] (1.26 s) : 0, 1259914 Total [candidate] (10.766 s) : 0, 10765638 
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.057 s -
Agent appsec 1.19 s 133.128 ms (12.6%)
Agent iast 1.196 s 138.751 ms (13.1%)
Agent profiling 1.252 s 194.741 ms (18.4%)
Total tracing 10.516 s -
Total appsec 10.701 s 185.091 ms (1.8%)
Total iast 10.991 s 475.144 ms (4.5%)
Total profiling 10.835 s 319.9 ms (3.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent appsec 1.188 s 127.415 ms (12.0%)
Agent iast 1.183 s 123.092 ms (11.6%)
Agent profiling 1.26 s 199.647 ms (18.8%)
Total tracing 10.426 s -
Total appsec 10.715 s 288.963 ms (2.8%)
Total iast 11.021 s 595.116 ms (5.7%)
Total profiling 10.766 s 339.975 ms (3.3%)
gantt title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section tracing BytebuddyAgent [baseline] (715.407 ms) : 0, 715407 BytebuddyAgent [candidate] (716.873 ms) : 0, 716873 GlobalTracer [baseline] (255.323 ms) : 0, 255323 GlobalTracer [candidate] (256.377 ms) : 0, 256377 AppSec [baseline] (56.376 ms) : 0, 56376 AppSec [candidate] (55.389 ms) : 0, 55389 Remote Config [baseline] (739.533 µs) : 0, 740 Remote Config [candidate] (717.065 µs) : 0, 717 Telemetry [baseline] (14.283 ms) : 0, 14283 Telemetry [candidate] (15.789 ms) : 0, 15789 section appsec BytebuddyAgent [baseline] (732.694 ms) : 0, 732694 BytebuddyAgent [candidate] (730.444 ms) : 0, 730444 GlobalTracer [baseline] (253.02 ms) : 0, 253020 GlobalTracer [candidate] (252.809 ms) : 0, 252809 AppSec [baseline] (170.685 ms) : 0, 170685 AppSec [candidate] (170.474 ms) : 0, 170474 Remote Config [baseline] (661.141 µs) : 0, 661 Remote Config [candidate] (665.476 µs) : 0, 665 Telemetry [baseline] (8.135 ms) : 0, 8135 Telemetry [candidate] (8.569 ms) : 0, 8569 IAST [baseline] (20.11 ms) : 0, 20110 IAST [candidate] (19.422 ms) : 0, 19422 section iast BytebuddyAgent [baseline] (841.403 ms) : 0, 841403 BytebuddyAgent [candidate] (832.31 ms) : 0, 832310 GlobalTracer [baseline] (249.638 ms) : 0, 249638 GlobalTracer [candidate] (246.674 ms) : 0, 246674 AppSec [baseline] (58.477 ms) : 0, 58477 AppSec [candidate] (58.101 ms) : 0, 58101 Remote Config [baseline] (655.219 µs) : 0, 655 Remote Config [candidate] (669.997 µs) : 0, 670 Telemetry [baseline] (8.853 ms) : 0, 8853 Telemetry [candidate] (8.82 ms) : 0, 8820 IAST [baseline] (21.845 ms) : 0, 21845 IAST [candidate] (21.742 ms) : 0, 21742 section profiling ProfilingAgent [baseline] (95.396 ms) : 0, 95396 ProfilingAgent [candidate] (95.869 ms) : 0, 95869 BytebuddyAgent [baseline] (702.24 ms) : 0, 702240 BytebuddyAgent [candidate] (707.149 ms) : 0, 707149 GlobalTracer [baseline] (348.395 ms) : 0, 348395 GlobalTracer [candidate] (350.358 ms) : 0, 350358 AppSec [baseline] (54.578 ms) : 0, 54578 AppSec [candidate] (54.722 ms) : 0, 54722 Remote Config [baseline] (696.577 µs) : 0, 697 Remote Config [candidate] (700.039 µs) : 0, 700 Telemetry [baseline] (8.698 ms) : 0, 8698 Telemetry [candidate] (8.951 ms) : 0, 8951 Profiling [baseline] (95.42 ms) : 0, 95420 Profiling [candidate] (95.893 ms) : 0, 95893 
Loading
Startup time reports for insecure-bank
gantt title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section tracing Agent [baseline] (1.057 s) : 0, 1057093 Total [baseline] (8.608 s) : 0, 8607892 Agent [candidate] (1.057 s) : 0, 1057199 Total [candidate] (8.618 s) : 0, 8618403 section iast Agent [baseline] (1.182 s) : 0, 1182113 Total [baseline] (9.274 s) : 0, 9274448 Agent [candidate] (1.181 s) : 0, 1180915 Total [candidate] (9.187 s) : 0, 9186695 section iast_HARDCODED_SECRET_DISABLED Agent [baseline] (1.185 s) : 0, 1185047 Total [baseline] (9.226 s) : 0, 9226176 Agent [candidate] (1.193 s) : 0, 1193071 Total [candidate] (9.172 s) : 0, 9172433 section iast_TELEMETRY_OFF Agent [baseline] (1.188 s) : 0, 1187527 Total [baseline] (9.189 s) : 0, 9188608 Agent [candidate] (1.186 s) : 0, 1185645 Total [candidate] (9.176 s) : 0, 9175720 
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.057 s -
Agent iast 1.182 s 125.02 ms (11.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.185 s 127.954 ms (12.1%)
Agent iast_TELEMETRY_OFF 1.188 s 130.434 ms (12.3%)
Total tracing 8.608 s -
Total iast 9.274 s 666.556 ms (7.7%)
Total iast_HARDCODED_SECRET_DISABLED 9.226 s 618.284 ms (7.2%)
Total iast_TELEMETRY_OFF 9.189 s 580.716 ms (6.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.057 s -
Agent iast 1.181 s 123.715 ms (11.7%)
Agent iast_HARDCODED_SECRET_DISABLED 1.193 s 135.872 ms (12.9%)
Agent iast_TELEMETRY_OFF 1.186 s 128.446 ms (12.1%)
Total tracing 8.618 s -
Total iast 9.187 s 568.293 ms (6.6%)
Total iast_HARDCODED_SECRET_DISABLED 9.172 s 554.03 ms (6.4%)
Total iast_TELEMETRY_OFF 9.176 s 557.317 ms (6.5%)
gantt title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section tracing BytebuddyAgent [baseline] (714.407 ms) : 0, 714407 BytebuddyAgent [candidate] (715.103 ms) : 0, 715103 GlobalTracer [baseline] (255.727 ms) : 0, 255727 GlobalTracer [candidate] (256.155 ms) : 0, 256155 AppSec [baseline] (55.52 ms) : 0, 55520 AppSec [candidate] (56.038 ms) : 0, 56038 Remote Config [baseline] (747.521 µs) : 0, 748 Remote Config [candidate] (717.206 µs) : 0, 717 Telemetry [baseline] (15.691 ms) : 0, 15691 Telemetry [candidate] (14.139 ms) : 0, 14139 section iast BytebuddyAgent [baseline] (831.877 ms) : 0, 831877 BytebuddyAgent [candidate] (830.968 ms) : 0, 830968 GlobalTracer [baseline] (246.074 ms) : 0, 246074 GlobalTracer [candidate] (246.334 ms) : 0, 246334 AppSec [baseline] (57.986 ms) : 0, 57986 AppSec [candidate] (57.741 ms) : 0, 57741 Remote Config [baseline] (676.52 µs) : 0, 677 Remote Config [candidate] (663.773 µs) : 0, 664 Telemetry [baseline] (8.872 ms) : 0, 8872 Telemetry [candidate] (8.806 ms) : 0, 8806 IAST [baseline] (21.568 ms) : 0, 21568 IAST [candidate] (21.414 ms) : 0, 21414 section iast_HARDCODED_SECRET_DISABLED BytebuddyAgent [baseline] (831.944 ms) : 0, 831944 BytebuddyAgent [candidate] (840.149 ms) : 0, 840149 GlobalTracer [baseline] (248.106 ms) : 0, 248106 GlobalTracer [candidate] (248.534 ms) : 0, 248534 AppSec [baseline] (58.618 ms) : 0, 58618 AppSec [candidate] (58.111 ms) : 0, 58111 Remote Config [baseline] (682.191 µs) : 0, 682 Remote Config [candidate] (661.426 µs) : 0, 661 Telemetry [baseline] (8.902 ms) : 0, 8902 Telemetry [candidate] (8.739 ms) : 0, 8739 IAST [baseline] (21.841 ms) : 0, 21841 IAST [candidate] (21.629 ms) : 0, 21629 section iast_TELEMETRY_OFF BytebuddyAgent [baseline] (836.477 ms) : 0, 836477 BytebuddyAgent [candidate] (835.086 ms) : 0, 835086 GlobalTracer [baseline] (247.496 ms) : 0, 247496 GlobalTracer [candidate] (247.44 ms) : 0, 247440 AppSec [baseline] (57.991 ms) : 0, 57991 AppSec [candidate] (57.508 ms) : 0, 57508 Remote Config [baseline] (661.302 µs) : 0, 661 Remote Config [candidate] (670.46 µs) : 0, 670 Telemetry [baseline] (8.737 ms) : 0, 8737 Telemetry [candidate] (8.703 ms) : 0, 8703 IAST [baseline] (21.014 ms) : 0, 21014 IAST [candidate] (21.116 ms) : 0, 21116 
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-01-21T13:28:28 2025-01-21T13:35:31
git_branch master bbujon/context-scope-async-propagation
git_commit_date 1737460501 1737465422
git_commit_sha 693c605 92e1a55
release_version 1.46.0-SNAPSHOT~693c605f76 1.46.0-SNAPSHOT~92e1a55c31
start_time 2025-01-21T13:28:15 2025-01-21T13:35:17
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1737466887 1737466887
ci_job_id 773945139 773945139
ci_pipeline_id 53547951 53547951
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

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

Request duration reports for petclinic
gantt title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section baseline no_agent (1.339 ms) : 1319, 1360 . : milestone, 1339, appsec (1.74 ms) : 1717, 1764 . : milestone, 1740, appsec_no_iast (1.756 ms) : 1732, 1780 . : milestone, 1756, iast (1.521 ms) : 1497, 1546 . : milestone, 1521, profiling (1.541 ms) : 1516, 1566 . : milestone, 1541, tracing (1.472 ms) : 1447, 1498 . : milestone, 1472, section candidate no_agent (1.334 ms) : 1313, 1354 . : milestone, 1334, appsec (1.749 ms) : 1724, 1775 . : milestone, 1749, appsec_no_iast (1.74 ms) : 1715, 1765 . : milestone, 1740, iast (1.494 ms) : 1470, 1519 . : milestone, 1494, profiling (1.495 ms) : 1472, 1518 . : milestone, 1495, tracing (1.479 ms) : 1454, 1504 . : milestone, 1479, 
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.339 ms [1.319 ms, 1.36 ms] -
appsec 1.74 ms [1.717 ms, 1.764 ms] 401.065 µs (29.9%)
appsec_no_iast 1.756 ms [1.732 ms, 1.78 ms] 416.801 µs (31.1%)
iast 1.521 ms [1.497 ms, 1.546 ms] 182.01 µs (13.6%)
profiling 1.541 ms [1.516 ms, 1.566 ms] 202.075 µs (15.1%)
tracing 1.472 ms [1.447 ms, 1.498 ms] 133.01 µs (9.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.334 ms [1.313 ms, 1.354 ms] -
appsec 1.749 ms [1.724 ms, 1.775 ms] 415.653 µs (31.2%)
appsec_no_iast 1.74 ms [1.715 ms, 1.765 ms] 406.546 µs (30.5%)
iast 1.494 ms [1.47 ms, 1.519 ms] 160.787 µs (12.1%)
profiling 1.495 ms [1.472 ms, 1.518 ms] 161.472 µs (12.1%)
tracing 1.479 ms [1.454 ms, 1.504 ms] 145.107 µs (10.9%)
Request duration reports for insecure-bank
gantt title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section baseline no_agent (375.174 µs) : 353, 397 . : milestone, 375, iast (500.452 µs) : 479, 522 . : milestone, 500, iast_FULL (736.704 µs) : 715, 758 . : milestone, 737, iast_GLOBAL (545.386 µs) : 524, 567 . : milestone, 545, iast_HARDCODED_SECRET_DISABLED (509.011 µs) : 487, 531 . : milestone, 509, iast_INACTIVE (451.66 µs) : 430, 474 . : milestone, 452, iast_TELEMETRY_OFF (487.108 µs) : 466, 509 . : milestone, 487, tracing (451.319 µs) : 430, 473 . : milestone, 451, section candidate no_agent (380.703 µs) : 361, 401 . : milestone, 381, iast (502.385 µs) : 481, 524 . : milestone, 502, iast_FULL (733.484 µs) : 712, 755 . : milestone, 733, iast_GLOBAL (553.507 µs) : 531, 576 . : milestone, 554, iast_HARDCODED_SECRET_DISABLED (502.371 µs) : 481, 524 . : milestone, 502, iast_INACTIVE (461.552 µs) : 440, 483 . : milestone, 462, iast_TELEMETRY_OFF (491.121 µs) : 469, 513 . : milestone, 491, tracing (451.432 µs) : 430, 473 . : milestone, 451, 
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 375.174 µs [353.438 µs, 396.91 µs] -
iast 500.452 µs [478.77 µs, 522.135 µs] 125.279 µs (33.4%)
iast_FULL 736.704 µs [714.944 µs, 758.463 µs] 361.53 µs (96.4%)
iast_GLOBAL 545.386 µs [523.829 µs, 566.944 µs] 170.213 µs (45.4%)
iast_HARDCODED_SECRET_DISABLED 509.011 µs [486.88 µs, 531.141 µs] 133.837 µs (35.7%)
iast_INACTIVE 451.66 µs [429.813 µs, 473.507 µs] 76.487 µs (20.4%)
iast_TELEMETRY_OFF 487.108 µs [465.562 µs, 508.654 µs] 111.935 µs (29.8%)
tracing 451.319 µs [429.8 µs, 472.839 µs] 76.146 µs (20.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 380.703 µs [360.697 µs, 400.709 µs] -
iast 502.385 µs [480.724 µs, 524.046 µs] 121.682 µs (32.0%)
iast_FULL 733.484 µs [711.578 µs, 755.391 µs] 352.781 µs (92.7%)
iast_GLOBAL 553.507 µs [530.631 µs, 576.384 µs] 172.804 µs (45.4%)
iast_HARDCODED_SECRET_DISABLED 502.371 µs [480.68 µs, 524.062 µs] 121.669 µs (32.0%)
iast_INACTIVE 461.552 µs [440.137 µs, 482.966 µs] 80.849 µs (21.2%)
iast_TELEMETRY_OFF 491.121 µs [469.148 µs, 513.095 µs] 110.419 µs (29.0%)
tracing 451.432 µs [429.672 µs, 473.192 µs] 70.729 µs (18.6%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bbujon/context-scope-async-propagation
git_commit_date 1737460501 1737465422
git_commit_sha 693c605 92e1a55
release_version 1.46.0-SNAPSHOT~693c605f76 1.46.0-SNAPSHOT~92e1a55c31
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1737467336 1737467336
ci_job_id 773945142 773945142
ci_pipeline_id 53547951 53547951
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant appsec appsec

Summary

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

Execution time for tomcat
gantt title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section baseline no_agent (1.471 ms) : 1459, 1482 . : milestone, 1471, appsec (2.343 ms) : 2300, 2386 . : milestone, 2343, iast (2.09 ms) : 2036, 2144 . : milestone, 2090, iast_GLOBAL (2.141 ms) : 2086, 2195 . : milestone, 2141, profiling (2.455 ms) : 2262, 2648 . : milestone, 2455, tracing (1.933 ms) : 1891, 1975 . : milestone, 1933, section candidate no_agent (1.473 ms) : 1462, 1485 . : milestone, 1473, appsec (2.347 ms) : 2304, 2390 . : milestone, 2347, iast (2.095 ms) : 2040, 2149 . : milestone, 2095, iast_GLOBAL (2.136 ms) : 2081, 2191 . : milestone, 2136, profiling (1.963 ms) : 1919, 2008 . : milestone, 1963, tracing (1.947 ms) : 1905, 1989 . : milestone, 1947, 
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.471 ms [1.459 ms, 1.482 ms] -
appsec 2.343 ms [2.3 ms, 2.386 ms] 872.363 µs (59.3%)
iast 2.09 ms [2.036 ms, 2.144 ms] 619.506 µs (42.1%)
iast_GLOBAL 2.141 ms [2.086 ms, 2.195 ms] 670.205 µs (45.6%)
profiling 2.455 ms [2.262 ms, 2.648 ms] 984.439 µs (66.9%)
tracing 1.933 ms [1.891 ms, 1.975 ms] 462.512 µs (31.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.473 ms [1.462 ms, 1.485 ms] -
appsec 2.347 ms [2.304 ms, 2.39 ms] 874.288 µs (59.3%)
iast 2.095 ms [2.04 ms, 2.149 ms] 621.536 µs (42.2%)
iast_GLOBAL 2.136 ms [2.081 ms, 2.191 ms] 662.91 µs (45.0%)
profiling 1.963 ms [1.919 ms, 2.008 ms] 490.194 µs (33.3%)
tracing 1.947 ms [1.905 ms, 1.989 ms] 473.935 µs (32.2%)
Execution time for biojava
gantt title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~92e1a55c31, baseline=1.46.0-SNAPSHOT~693c605f76 dateFormat X axisFormat %s section baseline no_agent (15.22 s) : 15220000, 15220000 . : milestone, 15220000, appsec (15.167 s) : 15167000, 15167000 . : milestone, 15167000, iast (18.808 s) : 18808000, 18808000 . : milestone, 18808000, iast_GLOBAL (17.87 s) : 17870000, 17870000 . : milestone, 17870000, profiling (15.199 s) : 15199000, 15199000 . : milestone, 15199000, tracing (15.093 s) : 15093000, 15093000 . : milestone, 15093000, section candidate no_agent (15.133 s) : 15133000, 15133000 . : milestone, 15133000, appsec (15.071 s) : 15071000, 15071000 . : milestone, 15071000, iast (18.427 s) : 18427000, 18427000 . : milestone, 18427000, iast_GLOBAL (18.341 s) : 18341000, 18341000 . : milestone, 18341000, profiling (15.75 s) : 15750000, 15750000 . : milestone, 15750000, tracing (15.16 s) : 15160000, 15160000 . : milestone, 15160000, 
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.22 s [15.22 s, 15.22 s] -
appsec 15.167 s [15.167 s, 15.167 s] -53.0 ms (-0.3%)
iast 18.808 s [18.808 s, 18.808 s] 3.588 s (23.6%)
iast_GLOBAL 17.87 s [17.87 s, 17.87 s] 2.65 s (17.4%)
profiling 15.199 s [15.199 s, 15.199 s] -21.0 ms (-0.1%)
tracing 15.093 s [15.093 s, 15.093 s] -127.0 ms (-0.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.133 s [15.133 s, 15.133 s] -
appsec 15.071 s [15.071 s, 15.071 s] -62.0 ms (-0.4%)
iast 18.427 s [18.427 s, 18.427 s] 3.294 s (21.8%)
iast_GLOBAL 18.341 s [18.341 s, 18.341 s] 3.208 s (21.2%)
profiling 15.75 s [15.75 s, 15.75 s] 617.0 ms (4.1%)
tracing 15.16 s [15.16 s, 15.16 s] 27.0 ms (0.2%)
@PerfectSlayer PerfectSlayer force-pushed the bbujon/context-scope-async-propagation branch from 548f1c9 to 1725b85 Compare January 16, 2025 15:27
@PerfectSlayer PerfectSlayer force-pushed the bbujon/context-scope-async-propagation branch from 1725b85 to 9a815a2 Compare January 16, 2025 15:46
@PerfectSlayer PerfectSlayer marked this pull request as ready for review January 16, 2025 17:27
@PerfectSlayer PerfectSlayer requested review from a team as code owners January 16, 2025 17:27
*/
@Deprecated
default boolean isAsyncPropagating() {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note TracerAPI is part of the internal-api

It might be better to add isAsyncPropagationEnabled / setAsyncPropagationEnabled to Tracer to mirror the change in internal-api and then you could default this to GlobalTracer.get().isAsyncPropagationEnabled()

We could keep the deprecated notice and say that these methods have been moved to Tracer and now only affect the active scope.

Copy link
Contributor Author

@PerfectSlayer PerfectSlayer Jan 21, 2025

Choose a reason for hiding this comment

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

We could. The main question is do we want to keep this API as part of our public API or not?
I moved it to TracerAPI to only open it for our instrumentations, not being sure if customers use it as part of their manual instrumentations - for context, the original API in TraceScope is part of the public API.

If we want to keep the feature open and part of our public API, I will move it to the Tracer interface.

Copy link
Contributor

@mcculls mcculls Jan 21, 2025

Choose a reason for hiding this comment

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

If we decide to keep it internal as part of TracerAPI then we cannot refer to TracerAPI here in the public docs because then customers will think that was meant to be part of the public API and open tickets asking how to build against it. So either way the reference to TracerAPI should be dropped here.

I'm leaning towards having similar methods exposed on Tracer, but also marked as deprecated, if only because we don't know for sure if anyone is using these methods. The default implementations in TraceScope could log a warning if used. That would avoid accidentally breaking anyone using them, while giving a bit of insight if they are actually used.

Copy link
Contributor Author

@PerfectSlayer PerfectSlayer Jan 21, 2025

Choose a reason for hiding this comment

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

but also marked as deprecated

Sounds fair. I wish we had a way to mark them as beta, or any unstable marker easily recognisable.

The default implementations in TraceScope could log a warning if used

While throwing an UnsupportedOperationException was a bit aggressive, I feel like adding an warning log is the right solution. As it should not be used that much, we should not expect many customers complaining about having unexpected warning entries in their logs. I will update the TraceScope default implementation then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EDIT: The API usage logging won't be done for now, as SLF4J is not available in dd-trace-api and using JUL can have some annoying side-effects when users want to use custom log managers.

def span = tracer.buildSpan("test").start()
def scope = tracer.activateSpan(span)
scope.setAsyncPropagation(true)
setAsyncPropagationEnabled(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

the calls above use tracer. setAsyncPropagationEnabled(true) while the ones below use setAsyncPropagationEnabled(true) (static AgentTracer method) - we should be consistent in this test and pick one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some tests, the setAsyncPropagationEnabled(true) would not work as the tracer under test was not the one registered in GlobalTracer.

I updated to use tracer. setAsyncPropagationEnabled(true) everywhere in this specification.

/**
* Enables or disables asynchronous propagation for the active span.
*
* <p>Asynchronous propagation is disabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is indeed. Thanks for catching it! I will update the javadoc and refer to the config

/**
* Enables or disables asynchronous propagation for the active span.
*
* <p>Asynchronous propagation is disabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is indeed. Thanks for catching it! I will update the javadoc and refer to the config

Copy link
Contributor

@mcculls mcculls left a comment

Choose a reason for hiding this comment

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

Looks good, just some comments that need fixing and a Q whether we can expose the new methods on the public Tracer (and use them in the deprecated default implementation on TraceScope) which would make migration smoother.

@PerfectSlayer PerfectSlayer merged commit d5592c6 into master Jan 21, 2025
174 of 175 checks passed
@PerfectSlayer PerfectSlayer deleted the bbujon/context-scope-async-propagation branch January 21, 2025 14:45
@github-actions github-actions bot added this to the 1.46.0 milestone Jan 21, 2025
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Jan 31, 2025
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datastore](https://github.com/googleapis/java-datastore) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `2.25.4` -> `2.26.0` | | [com.datadoghq:dd-trace-api](https://github.com/datadog/dd-trace-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.45.2` -> `1.46.0` | | [com.datadoghq:dd-trace-ot](https://github.com/datadog/dd-trace-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.45.2` -> `1.46.0` | | [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.9` -> `2.30.10` | | [software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.9` -> `2.30.10` | | [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.9` -> `2.30.10` | | [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.9` -> `2.30.10` | | [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.9` -> `2.30.10` | | [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.30.9` -> `2.30.10` | --- ### Release Notes <details> <summary>googleapis/java-datastore (com.google.cloud:google-cloud-datastore)</summary> ### [`v2.26.0`](https://github.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#2260-2025-01-29) ##### Features - Add firestoreInDatastoreMode for datastore emulator ([#&#8203;1698](googleapis/java-datastore#1698)) ([50f106d](googleapis/java-datastore@50f106d)) ##### Dependencies - Update dependency com.google.cloud:sdk-platform-java-config to v3.42.0 ([#&#8203;1725](googleapis/java-datastore#1725)) ([1cbaf22](googleapis/java-datastore@1cbaf22)) </details> <details> <summary>datadog/dd-trace-java (com.datadoghq:dd-trace-api)</summary> ### [`v1.46.0`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.46.0): 1.46.0 ##### Breaking Changes > \[!WARNING] > jnr-unixsocket is now an external dependency of dd-trace-ot and must be included when deploying dd-trace-ot. > \[!NOTE] > The API `TracerScope.setAsync(boolean)`, used to manually control asynchronous span propagation, does no more apply to the scope instance but to the active span scope. ##### Components ##### Application Security Management (IAST) - 🐛 Fix String.replace instrumentation for IAST ([#&#8203;8281](DataDog/dd-trace-java#8281) - [@&#8203;Mariovido](https://github.com/Mariovido)) - ✨ Apply the standard nomenclature to the stacktrace configs ([#&#8203;8244](DataDog/dd-trace-java#8244) - [@&#8203;jandro996](https://github.com/jandro996)) - 🐛 Exclude false positive weak randomness ([#&#8203;8232](DataDog/dd-trace-java#8232) - [@&#8203;jandro996](https://github.com/jandro996)) - ✨ Propagation of translateEscapes of String class ([#&#8203;8186](DataDog/dd-trace-java#8186) - [@&#8203;sezen-datadog](https://github.com/sezen-datadog)) - ✨ Add security control metrics ([#&#8203;8175](DataDog/dd-trace-java#8175) - [@&#8203;jandro996](https://github.com/jandro996)) - ✨ Increase IAST propagation to StringBuffer setLength ([#&#8203;8128](DataDog/dd-trace-java#8128) - [@&#8203;Mariovido](https://github.com/Mariovido)) - ✨ Add IAST taint tracking for DB values ([#&#8203;8072](DataDog/dd-trace-java#8072) - [@&#8203;Mariovido](https://github.com/Mariovido)) ##### Application Security Management (WAF) - 🐛 Prevents a NPE when there is no subscriber for user events ([#&#8203;8258](DataDog/dd-trace-java#8258) - [@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Apply the standard nomenclature to the stacktrace configs ([#&#8203;8244](DataDog/dd-trace-java#8244) - [@&#8203;jandro996](https://github.com/jandro996)) - 🐛 Ensure cached subscriptions are cleared on reconfiguration via RC ([#&#8203;8229](DataDog/dd-trace-java#8229) - [@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Add support for session tracking in Vertx ([#&#8203;8167](DataDog/dd-trace-java#8167) - [@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Create span tag: \_dd.appsec.rasp.timeout ([#&#8203;8269](DataDog/dd-trace-java#8269) - [@&#8203;Mariovido](https://github.com/Mariovido)) ##### Build & Tooling - 🐛 Ensure shaded helpers have unique names when injected into class-loaders ([#&#8203;8192](DataDog/dd-trace-java#8192) - [@&#8203;mcculls](https://github.com/mcculls)) ##### Configuration at Runtime - 🐛 Remove filtering of `DD_SERVICE` and `DD_ENV` from the tracer ([#&#8203;8176](DataDog/dd-trace-java#8176) - [@&#8203;mhlidd](https://github.com/mhlidd)) ##### Continuous Integration Visibility - 🧹 Generalize TestRetryPolicy to TestExecutionPolicy ([#&#8203;8302](DataDog/dd-trace-java#8302) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🧹 Parallelize CI Visibility settings requests ([#&#8203;8299](DataDog/dd-trace-java#8299) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🧹 Generalize test retry logic ([#&#8203;8289](DataDog/dd-trace-java#8289) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🧹 Generalize tests skipping logic ([#&#8203;8288](DataDog/dd-trace-java#8288) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🧹 Remove skip and shouldBeSkipped methods from TestEventsHandler in favor of isSkippable ([#&#8203;8286](DataDog/dd-trace-java#8286) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨⚡ Optimize Git repository information computation ([#&#8203;8270](DataDog/dd-trace-java#8270) - [@&#8203;dougqh](https://github.com/dougqh)) - ✨ Always request known tests from the backend ([#&#8203;8268](DataDog/dd-trace-java#8268) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Fix NPE when trying to get retry analyzer in Test NG ([#&#8203;8253](DataDog/dd-trace-java#8253) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Set test framework and test framework version tags atomically ([#&#8203;8252](DataDog/dd-trace-java#8252) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Add debug logging to Android Gradle module layout logic ([#&#8203;8251](DataDog/dd-trace-java#8251) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Fix source and destination folders computation for Android Gradle projects ([#&#8203;8190](DataDog/dd-trace-java#8190) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Add basic Scala Weaver sbt support ([#&#8203;8189](DataDog/dd-trace-java#8189) - [@&#8203;daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Implement impacted tests detection ([#&#8203;8188](DataDog/dd-trace-java#8188) - [@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) ##### Data Streams Monitoring - ✨ Change hash computation for protobuf to better represent impacting changes + save proto number in schema ([#&#8203;8201](DataDog/dd-trace-java#8201) - [@&#8203;vandonr](https://github.com/vandonr)) ##### Database Monitoring - Add peer service tag in dbm sql commenter ([#&#8203;7913](DataDog/dd-trace-java#7913) - [@&#8203;jordan-wong](https://github.com/jordan-wong)) ##### Dynamic Instrumentation - ✨ Add support for SymDB to scan directories ([#&#8203;8306](DataDog/dd-trace-java#8306) - [@&#8203;jpbempel](https://github.com/jpbempel)) - ✨ Add SymDB report for any jar scanning failures ([#&#8203;8300](DataDog/dd-trace-java#8300) - [@&#8203;jpbempel](https://github.com/jpbempel)) - ✨ Use two budgets depending on type ([#&#8203;8283](DataDog/dd-trace-java#8283) - [@&#8203;evanchooly](https://github.com/evanchooly)) - ✨ Institute a 10 snapshot per probe per trace budget ([#&#8203;8277](DataDog/dd-trace-java#8277) - [@&#8203;evanchooly](https://github.com/evanchooly)) - 🐛 Avoid double snapshots for Exception Replay ([#&#8203;8273](DataDog/dd-trace-java#8273) - [@&#8203;jpbempel](https://github.com/jpbempel)) - ✨ Simplify code origins. Separate out snapshot generation. ([#&#8203;8263](DataDog/dd-trace-java#8263) - [@&#8203;evanchooly](https://github.com/evanchooly)) - ✨ Add Exception probe custom instrumentation ([#&#8203;8230](DataDog/dd-trace-java#8230) - [@&#8203;jpbempel](https://github.com/jpbempel)) - ✨ Enhance log probes to honor debug session tags ([#&#8203;8215](DataDog/dd-trace-java#8215) - [@&#8203;evanchooly](https://github.com/evanchooly)) - 🐛 Don't redact env tokens from debugger probe snapshots ([#&#8203;8211](DataDog/dd-trace-java#8211) - [@&#8203;watson](https://github.com/watson)) - ✨⚡ Move Trace/SpanId capture at commit time ([#&#8203;8184](DataDog/dd-trace-java#8184) - [@&#8203;jpbempel](https://github.com/jpbempel)) - 🐛 Capture values at entry for method probe ([#&#8203;8169](DataDog/dd-trace-java#8169) - [@&#8203;jpbempel](https://github.com/jpbempel)) ##### JMX fetch - 🐛 Mute JMXFetch Shutdown in progress error ([#&#8203;8068](DataDog/dd-trace-java#8068) - [@&#8203;ygree](https://github.com/ygree)) ##### OpenTracing - ⚠️🧹 Make jnr-unixsocket an explicit dependency of dd-trace-ot ([#&#8203;8307](DataDog/dd-trace-java#8307) - [@&#8203;mcculls](https://github.com/mcculls)) ##### Profiling - 🐛 Avoid unsupported API call for creating folders on windows ([#&#8203;8304](DataDog/dd-trace-java#8304) - [@&#8203;jbachorik](https://github.com/jbachorik)) - ✨ Tag profiles for serverless ([#&#8203;8279](DataDog/dd-trace-java#8279) - [@&#8203;jbachorik](https://github.com/jbachorik)) - ✨ add queue type and length to queue events ([#&#8203;8242](DataDog/dd-trace-java#8242) - [@&#8203;richardstartin](https://github.com/richardstartin)) - 🐛 TempLocationManager Fixes and Improvements ([#&#8203;8191](DataDog/dd-trace-java#8191) - [@&#8203;jbachorik](https://github.com/jbachorik)) - ✨ Bump ddprof to 1.18.0 ([#&#8203;8173](DataDog/dd-trace-java#8173) - [@&#8203;jbachorik](https://github.com/jbachorik)) - ✨ Report profiler initialization and configuration errors to telemetry ([#&#8203;8171](DataDog/dd-trace-java#8171) - [@&#8203;jbachorik](https://github.com/jbachorik)) ##### Telemetry - ✨ Add pending traces report in tracer flares ([#&#8203;8053](DataDog/dd-trace-java#8053) - [@&#8203;mhlidd](https://github.com/mhlidd)) ##### Testing - ✨ Test http server requests in parallel ([#&#8203;8222](DataDog/dd-trace-java#8222) - [@&#8203;amarziali](https://github.com/amarziali)) ##### Trace context propagation - ✨ Add non default propagator registration ([#&#8203;8310](DataDog/dd-trace-java#8310) - [@&#8203;PerfectSlayer](https://github.com/PerfectSlayer)) ##### Tracer core - ✨ Probe for existence of IBMSASL or ACCP security providers ([#&#8203;8276](DataDog/dd-trace-java#8276) - [@&#8203;mcculls](https://github.com/mcculls)) - ✨⚡ Overhead improvement to agent feedback based sampling ([#&#8203;8265](DataDog/dd-trace-java#8265) - [@&#8203;dougqh](https://github.com/dougqh)) - 🧹 Move async propagation API from scope to tracer ([#&#8203;8231](DataDog/dd-trace-java#8231) - [@&#8203;PerfectSlayer](https://github.com/PerfectSlayer)) - ✨ Introduce context propagation API ([#&#8203;8161](DataDog/dd-trace-java#8161) - [@&#8203;PerfectSlayer](https://github.com/PerfectSlayer)) - ✨🧪 Use env-entry to add tags per webapp deployment ([#&#8203;8138](DataDog/dd-trace-java#8138) - [@&#8203;amarziali](https://github.com/amarziali)) - ✨ Introduce context helpers API ([#&#8203;8134](DataDog/dd-trace-java#8134) - [@&#8203;PerfectSlayer](https://github.com/PerfectSlayer)) - ✨ Support IPv6 values for `DD_AGENT_HOST` and `DD_TRACE_AGENT_URL` ([#&#8203;7984](DataDog/dd-trace-java#7984) - [@&#8203;mhlidd](https://github.com/mhlidd)) ##### Instrumentations ##### Apache HttpComponents - 🐛 Properly finish spans and support latest apache httpclient5 ([#&#8203;8272](DataDog/dd-trace-java#8272) - [@&#8203;amarziali](https://github.com/amarziali)) ##### AWS Lambda instrumentation - 🐛 Properly capture lambda payloads for all handler types. ([#&#8203;8264](DataDog/dd-trace-java#8264) - [@&#8203;purple4reina](https://github.com/purple4reina)) ##### AWS S3 instrumentation - 💡 Create S3 instrumentation + add span pointers ([#&#8203;8075](DataDog/dd-trace-java#8075) - [@&#8203;nhulston](https://github.com/nhulston)) ##### AWS SDK instrumentation - 🐛 Revert "Add avoid double instrumenting lambda non-streaming handlers." ([#&#8203;8247](DataDog/dd-trace-java#8247) - [@&#8203;nhulston](https://github.com/nhulston)) ##### Cassandra - ✨ Allow extracting keyspace from statement result ([#&#8203;8239](DataDog/dd-trace-java#8239) - [@&#8203;amarziali](https://github.com/amarziali)) ##### Core Java language instrumentation - ✨ Propagation of translateEscapes of String class ([#&#8203;8186](DataDog/dd-trace-java#8186) - [@&#8203;sezen-datadog](https://github.com/sezen-datadog)) ##### Eclipse Vert.x instrumentation - 🐛 Fix vertx worker propagation and error handling ([#&#8203;8237](DataDog/dd-trace-java#8237) - [@&#8203;amarziali](https://github.com/amarziali)) - ✨ Support vertx 5 ([#&#8203;8220](DataDog/dd-trace-java#8220) - [@&#8203;amarziali](https://github.com/amarziali)) - ✨ Add support for session tracking in Vertx ([#&#8203;8167](DataDog/dd-trace-java#8167) - [@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) ##### Kafka instrumentation - 🐛 Prevent possible NPE calculating Kafka record header size ([#&#8203;8292](DataDog/dd-trace-java#8292) - [@&#8203;ygree](https://github.com/ygree)) ##### Mule instrumentation - 🐛 Fix crash using Mule with JPMS ([#&#8203;8187](DataDog/dd-trace-java#8187) - [@&#8203;amarziali](https://github.com/amarziali)) ##### Protocol Buffer instrumentation - ✨ Change hash computation for protobuf to better represent impacting changes + save proto number in schema ([#&#8203;8201](DataDog/dd-trace-java#8201) - [@&#8203;vandonr](https://github.com/vandonr)) ##### Spring instrumentation - 🐛 Preserve getQualifier from spring scheduling runnables ([#&#8203;8293](DataDog/dd-trace-java#8293) - [@&#8203;amarziali](https://github.com/amarziali)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am every weekday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). GitOrigin-RevId: bb09d47e4eed77a003f630273b4d0a84003eb899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants