Skip to content
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

[EXPERIMENTAL] Support deferred matching and transformation for particular class-loaders #6887

Merged
merged 3 commits into from
May 2, 2024

Conversation

mcculls
Copy link
Contributor

@mcculls mcculls commented Apr 4, 2024

Environment variable:

DD_EXPERIMENTAL_DEFER_INTEGRATIONS_UNTIL=10m

Units of h (hours) and s (seconds) are also accepted, the default unit when omitted is seconds.

Equivalent JVM option:

-Ddd.experimental.defer.integrations.until=10m

You can also limit this feature to particular class-loaders with this environment variable:

DD_TRACE_CLASSLOADERS_DEFER=name1,name2

or this JVM option:

-Ddd.trace.classloaders.defer=name1,name2

Motivation

Allows matching and transformation to be moved out of startup to a point later on in the application's runtime, but at a cost of not being able to apply certain structural changes.

Bootstrap transformations are still applied at startup because some of them are essential to installation of the tracer (for example ensuring boot-delegation of Datadog packages) but those transformations are limited and don't take much time compared to the wider library integrations.

Additional Notes

This uses re-transformation to resume matching, which means structural changes such as field-injection cannot be applied. Using this feature may therefore result in increased memory use, because context will be tracked using a weak global map.

Jira ticket: APMS-11443

@mcculls mcculls added the comp: core Tracer core label Apr 4, 2024
@pr-commenter
Copy link

pr-commenter bot commented Apr 4, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/support-deferred-instrumentation
git_commit_date 1714584487 1714647224
git_commit_sha 5c8d55c efe7fe0
release_version 1.34.0-SNAPSHOT~5c8d55ca87 1.34.0-SNAPSHOT~efe7fe0ff6
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1714649752 1714649752
ci_job_id 502444684 502444684
ci_pipeline_id 33420933 33420933
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 48 metrics, 15 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.081 s) : 0, 1081444
Total [baseline] (8.582 s) : 0, 8582401
Agent [candidate] (1.076 s) : 0, 1075874
Total [candidate] (8.579 s) : 0, 8579136
section iast
Agent [baseline] (1.206 s) : 0, 1205641
Total [baseline] (9.007 s) : 0, 9007412
Agent [candidate] (1.197 s) : 0, 1197384
Total [candidate] (9.012 s) : 0, 9012171
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.209 s) : 0, 1209160
Total [baseline] (8.982 s) : 0, 8982068
Agent [candidate] (1.201 s) : 0, 1201448
Total [candidate] (8.983 s) : 0, 8982716
section iast_TELEMETRY_OFF
Agent [baseline] (1.197 s) : 0, 1197325
Total [baseline] (9.013 s) : 0, 9012685
Agent [candidate] (1.197 s) : 0, 1197341
Total [candidate] (9.015 s) : 0, 9014807
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.081 s -
Agent iast 1.206 s 124.197 ms (11.5%)
Agent iast_HARDCODED_SECRET_DISABLED 1.209 s 127.716 ms (11.8%)
Agent iast_TELEMETRY_OFF 1.197 s 115.882 ms (10.7%)
Total tracing 8.582 s -
Total iast 9.007 s 425.011 ms (5.0%)
Total iast_HARDCODED_SECRET_DISABLED 8.982 s 399.667 ms (4.7%)
Total iast_TELEMETRY_OFF 9.013 s 430.284 ms (5.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.076 s -
Agent iast 1.197 s 121.511 ms (11.3%)
Agent iast_HARDCODED_SECRET_DISABLED 1.201 s 125.574 ms (11.7%)
Agent iast_TELEMETRY_OFF 1.197 s 121.468 ms (11.3%)
Total tracing 8.579 s -
Total iast 9.012 s 433.035 ms (5.0%)
Total iast_HARDCODED_SECRET_DISABLED 8.983 s 403.58 ms (4.7%)
Total iast_TELEMETRY_OFF 9.015 s 435.671 ms (5.1%)
gantt
    title insecure-bank - break down per module: candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (677.784 ms) : 0, 677784
BytebuddyAgent [candidate] (673.834 ms) : 0, 673834
GlobalTracer [baseline] (311.129 ms) : 0, 311129
GlobalTracer [candidate] (310.193 ms) : 0, 310193
AppSec [baseline] (49.639 ms) : 0, 49639
AppSec [candidate] (49.414 ms) : 0, 49414
Remote Config [baseline] (666.228 µs) : 0, 666
Remote Config [candidate] (654.081 µs) : 0, 654
Telemetry [baseline] (7.663 ms) : 0, 7663
Telemetry [candidate] (7.502 ms) : 0, 7502
section iast
BytebuddyAgent [baseline] (799.622 ms) : 0, 799622
BytebuddyAgent [candidate] (792.967 ms) : 0, 792967
GlobalTracer [baseline] (289.481 ms) : 0, 289481
GlobalTracer [candidate] (287.625 ms) : 0, 287625
AppSec [baseline] (51.416 ms) : 0, 51416
AppSec [candidate] (49.532 ms) : 0, 49532
IAST [baseline] (23.293 ms) : 0, 23293
IAST [candidate] (25.013 ms) : 0, 25013
Remote Config [baseline] (645.251 µs) : 0, 645
Remote Config [candidate] (620.34 µs) : 0, 620
Telemetry [baseline] (6.632 ms) : 0, 6632
Telemetry [candidate] (7.405 ms) : 0, 7405
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (801.058 ms) : 0, 801058
BytebuddyAgent [candidate] (795.012 ms) : 0, 795012
GlobalTracer [baseline] (290.727 ms) : 0, 290727
GlobalTracer [candidate] (289.02 ms) : 0, 289020
AppSec [baseline] (51.57 ms) : 0, 51570
AppSec [candidate] (52.359 ms) : 0, 52359
IAST [baseline] (23.802 ms) : 0, 23802
IAST [candidate] (22.695 ms) : 0, 22695
Remote Config [baseline] (642.885 µs) : 0, 643
Remote Config [candidate] (1.28 ms) : 0, 1280
Telemetry [baseline] (6.754 ms) : 0, 6754
Telemetry [candidate] (6.709 ms) : 0, 6709
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (792.914 ms) : 0, 792914
BytebuddyAgent [candidate] (792.215 ms) : 0, 792215
GlobalTracer [baseline] (288.64 ms) : 0, 288640
GlobalTracer [candidate] (288.708 ms) : 0, 288708
AppSec [baseline] (50.501 ms) : 0, 50501
AppSec [candidate] (50.597 ms) : 0, 50597
IAST [baseline] (22.204 ms) : 0, 22204
IAST [candidate] (24.331 ms) : 0, 24331
Remote Config [baseline] (585.857 µs) : 0, 586
Remote Config [candidate] (570.361 µs) : 0, 570
Telemetry [baseline] (8.178 ms) : 0, 8178
Telemetry [candidate] (6.623 ms) : 0, 6623
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.076 s) : 0, 1076241
Total [baseline] (10.44 s) : 0, 10440134
Agent [candidate] (1.076 s) : 0, 1075673
Total [candidate] (10.375 s) : 0, 10374773
section appsec
Agent [baseline] (1.189 s) : 0, 1188593
Total [baseline] (10.552 s) : 0, 10552043
Agent [candidate] (1.19 s) : 0, 1190419
Total [candidate] (10.478 s) : 0, 10477857
section iast
Agent [baseline] (1.208 s) : 0, 1207834
Total [baseline] (10.743 s) : 0, 10742763
Agent [candidate] (1.201 s) : 0, 1200957
Total [candidate] (10.747 s) : 0, 10746998
section profiling
Agent [baseline] (1.276 s) : 0, 1275646
Total [baseline] (10.626 s) : 0, 10625690
Agent [candidate] (1.271 s) : 0, 1270613
Total [candidate] (10.602 s) : 0, 10602108
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.076 s -
Agent appsec 1.189 s 112.352 ms (10.4%)
Agent iast 1.208 s 131.594 ms (12.2%)
Agent profiling 1.276 s 199.406 ms (18.5%)
Total tracing 10.44 s -
Total appsec 10.552 s 111.909 ms (1.1%)
Total iast 10.743 s 302.628 ms (2.9%)
Total profiling 10.626 s 185.556 ms (1.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.076 s -
Agent appsec 1.19 s 114.746 ms (10.7%)
Agent iast 1.201 s 125.284 ms (11.6%)
Agent profiling 1.271 s 194.939 ms (18.1%)
Total tracing 10.375 s -
Total appsec 10.478 s 103.084 ms (1.0%)
Total iast 10.747 s 372.225 ms (3.6%)
Total profiling 10.602 s 227.335 ms (2.2%)
gantt
    title petclinic - break down per module: candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (674.408 ms) : 0, 674408
BytebuddyAgent [candidate] (673.336 ms) : 0, 673336
GlobalTracer [baseline] (310.028 ms) : 0, 310028
GlobalTracer [candidate] (310.197 ms) : 0, 310197
AppSec [baseline] (49.331 ms) : 0, 49331
AppSec [candidate] (49.508 ms) : 0, 49508
Remote Config [baseline] (653.023 µs) : 0, 653
Remote Config [candidate] (656.139 µs) : 0, 656
Telemetry [baseline] (7.541 ms) : 0, 7541
Telemetry [candidate] (7.59 ms) : 0, 7590
section appsec
BytebuddyAgent [baseline] (695.868 ms) : 0, 695868
BytebuddyAgent [candidate] (695.829 ms) : 0, 695829
GlobalTracer [baseline] (291.349 ms) : 0, 291349
GlobalTracer [candidate] (291.964 ms) : 0, 291964
AppSec [baseline] (149.367 ms) : 0, 149367
AppSec [candidate] (148.983 ms) : 0, 148983
IAST [baseline] (19.167 ms) : 0, 19167
IAST [candidate] (19.264 ms) : 0, 19264
Remote Config [baseline] (618.761 µs) : 0, 619
Remote Config [candidate] (620.262 µs) : 0, 620
Telemetry [baseline] (7.509 ms) : 0, 7509
Telemetry [candidate] (9.074 ms) : 0, 9074
section iast
BytebuddyAgent [baseline] (801.025 ms) : 0, 801025
BytebuddyAgent [candidate] (795.526 ms) : 0, 795526
GlobalTracer [baseline] (290.137 ms) : 0, 290137
GlobalTracer [candidate] (288.986 ms) : 0, 288986
AppSec [baseline] (48.938 ms) : 0, 48938
AppSec [candidate] (50.766 ms) : 0, 50766
IAST [baseline] (25.203 ms) : 0, 25203
IAST [candidate] (23.273 ms) : 0, 23273
Remote Config [baseline] (1.272 ms) : 0, 1272
Remote Config [candidate] (1.258 ms) : 0, 1258
Telemetry [baseline] (6.7 ms) : 0, 6700
Telemetry [candidate] (6.629 ms) : 0, 6629
section profiling
BytebuddyAgent [baseline] (682.765 ms) : 0, 682765
BytebuddyAgent [candidate] (678.727 ms) : 0, 678727
GlobalTracer [baseline] (382.285 ms) : 0, 382285
GlobalTracer [candidate] (381.04 ms) : 0, 381040
AppSec [baseline] (50.366 ms) : 0, 50366
AppSec [candidate] (50.311 ms) : 0, 50311
Remote Config [baseline] (746.02 µs) : 0, 746
Remote Config [candidate] (719.482 µs) : 0, 719
Telemetry [baseline] (7.54 ms) : 0, 7540
Telemetry [candidate] (7.489 ms) : 0, 7489
ProfilingAgent [baseline] (95.046 ms) : 0, 95046
ProfilingAgent [candidate] (95.834 ms) : 0, 95834
Profiling [baseline] (95.071 ms) : 0, 95071
Profiling [candidate] (95.858 ms) : 0, 95858

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-05-02T11:08:20 2024-05-02T11:15:08
git_branch master mcculls/support-deferred-instrumentation
git_commit_date 1714584487 1714647224
git_commit_sha 5c8d55c efe7fe0
release_version 1.34.0-SNAPSHOT~5c8d55ca87 1.34.0-SNAPSHOT~efe7fe0ff6
start_time 2024-05-02T11:08:07 2024-05-02T11:14:55
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1714648852 1714648852
ci_job_id 502444685 502444685
ci_pipeline_id 33420933 33420933
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 12 metrics, 16 unstable metrics.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.352 ms) : 1333, 1371
.   : milestone, 1352,
appsec (1.728 ms) : 1704, 1752
.   : milestone, 1728,
appsec_no_iast (1.717 ms) : 1693, 1742
.   : milestone, 1717,
iast (1.483 ms) : 1460, 1506
.   : milestone, 1483,
profiling (1.494 ms) : 1469, 1518
.   : milestone, 1494,
tracing (1.483 ms) : 1459, 1507
.   : milestone, 1483,
section candidate
no_agent (1.344 ms) : 1324, 1363
.   : milestone, 1344,
appsec (1.72 ms) : 1695, 1744
.   : milestone, 1720,
appsec_no_iast (1.724 ms) : 1700, 1748
.   : milestone, 1724,
iast (1.487 ms) : 1465, 1510
.   : milestone, 1487,
profiling (1.518 ms) : 1492, 1544
.   : milestone, 1518,
tracing (1.484 ms) : 1460, 1508
.   : milestone, 1484,
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.352 ms [1.333 ms, 1.371 ms] -
appsec 1.728 ms [1.704 ms, 1.752 ms] 376.161 µs (27.8%)
appsec_no_iast 1.717 ms [1.693 ms, 1.742 ms] 365.401 µs (27.0%)
iast 1.483 ms [1.46 ms, 1.506 ms] 131.402 µs (9.7%)
profiling 1.494 ms [1.469 ms, 1.518 ms] 142.088 µs (10.5%)
tracing 1.483 ms [1.459 ms, 1.507 ms] 131.186 µs (9.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.344 ms [1.324 ms, 1.363 ms] -
appsec 1.72 ms [1.695 ms, 1.744 ms] 375.832 µs (28.0%)
appsec_no_iast 1.724 ms [1.7 ms, 1.748 ms] 380.297 µs (28.3%)
iast 1.487 ms [1.465 ms, 1.51 ms] 143.71 µs (10.7%)
profiling 1.518 ms [1.492 ms, 1.544 ms] 174.361 µs (13.0%)
tracing 1.484 ms [1.46 ms, 1.508 ms] 139.788 µs (10.4%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87
    dateFormat X
    axisFormat %s
section baseline
no_agent (367.834 µs) : 348, 387
.   : milestone, 368,
iast (472.656 µs) : 451, 494
.   : milestone, 473,
iast_FULL (542.858 µs) : 521, 564
.   : milestone, 543,
iast_GLOBAL (496.608 µs) : 476, 517
.   : milestone, 497,
iast_HARDCODED_SECRET_DISABLED (470.319 µs) : 449, 492
.   : milestone, 470,
iast_INACTIVE (447.016 µs) : 426, 468
.   : milestone, 447,
iast_TELEMETRY_OFF (474.401 µs) : 453, 496
.   : milestone, 474,
tracing (445.41 µs) : 424, 467
.   : milestone, 445,
section candidate
no_agent (367.519 µs) : 348, 387
.   : milestone, 368,
iast (475.661 µs) : 454, 497
.   : milestone, 476,
iast_FULL (540.625 µs) : 519, 562
.   : milestone, 541,
iast_GLOBAL (491.089 µs) : 471, 512
.   : milestone, 491,
iast_HARDCODED_SECRET_DISABLED (472.162 µs) : 451, 493
.   : milestone, 472,
iast_INACTIVE (445.025 µs) : 424, 466
.   : milestone, 445,
iast_TELEMETRY_OFF (462.167 µs) : 441, 483
.   : milestone, 462,
tracing (448.43 µs) : 427, 470
.   : milestone, 448,
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 367.834 µs [348.3 µs, 387.368 µs] -
iast 472.656 µs [451.34 µs, 493.972 µs] 104.822 µs (28.5%)
iast_FULL 542.858 µs [521.334 µs, 564.383 µs] 175.025 µs (47.6%)
iast_GLOBAL 496.608 µs [475.884 µs, 517.331 µs] 128.774 µs (35.0%)
iast_HARDCODED_SECRET_DISABLED 470.319 µs [448.522 µs, 492.117 µs] 102.486 µs (27.9%)
iast_INACTIVE 447.016 µs [426.163 µs, 467.869 µs] 79.182 µs (21.5%)
iast_TELEMETRY_OFF 474.401 µs [452.911 µs, 495.891 µs] 106.567 µs (29.0%)
tracing 445.41 µs [424.293 µs, 466.527 µs] 77.576 µs (21.1%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 367.519 µs [347.604 µs, 387.435 µs] -
iast 475.661 µs [454.098 µs, 497.224 µs] 108.142 µs (29.4%)
iast_FULL 540.625 µs [518.861 µs, 562.388 µs] 173.105 µs (47.1%)
iast_GLOBAL 491.089 µs [470.676 µs, 511.503 µs] 123.57 µs (33.6%)
iast_HARDCODED_SECRET_DISABLED 472.162 µs [451.117 µs, 493.208 µs] 104.643 µs (28.5%)
iast_INACTIVE 445.025 µs [424.435 µs, 465.614 µs] 77.505 µs (21.1%)
iast_TELEMETRY_OFF 462.167 µs [441.336 µs, 482.999 µs] 94.648 µs (25.8%)
tracing 448.43 µs [427.228 µs, 469.631 µs] 80.91 µs (22.0%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/support-deferred-instrumentation
git_commit_date 1714584487 1714647224
git_commit_sha 5c8d55c efe7fe0
release_version 1.34.0-SNAPSHOT~5c8d55ca87 1.34.0-SNAPSHOT~efe7fe0ff6
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1714649372 1714649372
ci_job_id 502444686 502444686
ci_pipeline_id 33420933 33420933
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 12 metrics, 0 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.463 ms) : 1451, 1474
.   : milestone, 1463,
appsec (2.212 ms) : 2178, 2246
.   : milestone, 2212,
iast (1.878 ms) : 1843, 1912
.   : milestone, 1878,
iast_GLOBAL (1.923 ms) : 1888, 1958
.   : milestone, 1923,
profiling (1.857 ms) : 1824, 1890
.   : milestone, 1857,
tracing (1.834 ms) : 1803, 1866
.   : milestone, 1834,
section candidate
no_agent (1.467 ms) : 1455, 1478
.   : milestone, 1467,
appsec (2.218 ms) : 2184, 2252
.   : milestone, 2218,
iast (1.885 ms) : 1850, 1921
.   : milestone, 1885,
iast_GLOBAL (1.924 ms) : 1888, 1959
.   : milestone, 1924,
profiling (1.853 ms) : 1819, 1886
.   : milestone, 1853,
tracing (1.845 ms) : 1812, 1877
.   : milestone, 1845,
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.463 ms [1.451 ms, 1.474 ms] -
appsec 2.212 ms [2.178 ms, 2.246 ms] 749.181 µs (51.2%)
iast 1.878 ms [1.843 ms, 1.912 ms] 414.902 µs (28.4%)
iast_GLOBAL 1.923 ms [1.888 ms, 1.958 ms] 460.226 µs (31.5%)
profiling 1.857 ms [1.824 ms, 1.89 ms] 393.98 µs (26.9%)
tracing 1.834 ms [1.803 ms, 1.866 ms] 371.607 µs (25.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.455 ms, 1.478 ms] -
appsec 2.218 ms [2.184 ms, 2.252 ms] 751.467 µs (51.2%)
iast 1.885 ms [1.85 ms, 1.921 ms] 418.762 µs (28.6%)
iast_GLOBAL 1.924 ms [1.888 ms, 1.959 ms] 456.919 µs (31.2%)
profiling 1.853 ms [1.819 ms, 1.886 ms] 386.258 µs (26.3%)
tracing 1.845 ms [1.812 ms, 1.877 ms] 378.289 µs (25.8%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.34.0-SNAPSHOT~efe7fe0ff6, baseline=1.34.0-SNAPSHOT~5c8d55ca87
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.424 s) : 15424000, 15424000
.   : milestone, 15424000,
appsec (15.266 s) : 15266000, 15266000
.   : milestone, 15266000,
iast (18.752 s) : 18752000, 18752000
.   : milestone, 18752000,
iast_GLOBAL (18.023 s) : 18023000, 18023000
.   : milestone, 18023000,
profiling (15.359 s) : 15359000, 15359000
.   : milestone, 15359000,
tracing (14.997 s) : 14997000, 14997000
.   : milestone, 14997000,
section candidate
no_agent (15.558 s) : 15558000, 15558000
.   : milestone, 15558000,
appsec (14.856 s) : 14856000, 14856000
.   : milestone, 14856000,
iast (18.523 s) : 18523000, 18523000
.   : milestone, 18523000,
iast_GLOBAL (17.905 s) : 17905000, 17905000
.   : milestone, 17905000,
profiling (15.43 s) : 15430000, 15430000
.   : milestone, 15430000,
tracing (14.954 s) : 14954000, 14954000
.   : milestone, 14954000,
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.424 s [15.424 s, 15.424 s] -
appsec 15.266 s [15.266 s, 15.266 s] -158.0 ms (-1.0%)
iast 18.752 s [18.752 s, 18.752 s] 3.328 s (21.6%)
iast_GLOBAL 18.023 s [18.023 s, 18.023 s] 2.599 s (16.9%)
profiling 15.359 s [15.359 s, 15.359 s] -65.0 ms (-0.4%)
tracing 14.997 s [14.997 s, 14.997 s] -427.0 ms (-2.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.558 s [15.558 s, 15.558 s] -
appsec 14.856 s [14.856 s, 14.856 s] -702.0 ms (-4.5%)
iast 18.523 s [18.523 s, 18.523 s] 2.965 s (19.1%)
iast_GLOBAL 17.905 s [17.905 s, 17.905 s] 2.347 s (15.1%)
profiling 15.43 s [15.43 s, 15.43 s] -128.0 ms (-0.8%)
tracing 14.954 s [14.954 s, 14.954 s] -604.0 ms (-3.9%)

@mcculls mcculls force-pushed the mcculls/support-deferred-instrumentation branch 3 times, most recently from 2082f49 to a69f2f1 Compare April 4, 2024 13:52
@mcculls mcculls changed the title [WIP] Support deferred matching and transformation for particular class-loaders [EXPERIMENTAL] Support deferred matching and transformation for particular class-loaders Apr 4, 2024
@mcculls mcculls force-pushed the mcculls/support-deferred-instrumentation branch from a69f2f1 to 2f515b9 Compare April 4, 2024 13:57
@mcculls mcculls added the tag: experimental Experimental changes label Apr 4, 2024
@mcculls mcculls force-pushed the mcculls/support-deferred-instrumentation branch 2 times, most recently from a34888a to a793d88 Compare April 4, 2024 15:31
@mcculls mcculls marked this pull request as ready for review April 4, 2024 22:07
@mcculls mcculls requested a review from a team as a code owner April 4, 2024 22:07
@mcculls mcculls force-pushed the mcculls/support-deferred-instrumentation branch from 9e24b23 to d7a9d6e Compare April 5, 2024 09:57
/** Arranges for any deferred matching to resume at the requested trigger point. */
private void scheduleResumeMatching(Instrumentation instrumentation, String untilTrigger) {
if (null != untilTrigger && !untilTrigger.isEmpty()) {
Pattern delayPattern = Pattern.compile("(\\d+)([HhMmSs]?)");
Copy link
Contributor

Choose a reason for hiding this comment

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

For me, this would be easier to read as helper function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to shared utility class in 2b9c91b

Iterator<Iterable<Class<?>>> rediscovery =
AgentStrategies.rediscoveryStrategy().resolve(instrumentation).iterator();

List<Class<?>> resuming = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

We could probably restrict the size as the max of rediscorery's length and some upper bound.
Given the smallish number of instrumentations and one time nature of this, I'm okay with forgoing it.

…ders.

This uses re-transformation to resume matching, which means structural changes such as field-injection cannot be applied.
Using this feature may therefore result in increased memory use, because context will be tracked using a weak global map.
@mcculls mcculls force-pushed the mcculls/support-deferred-instrumentation branch from d7a9d6e to 2b9c91b Compare May 1, 2024 20:29
@mcculls mcculls enabled auto-merge May 2, 2024 11:40
@mcculls mcculls merged commit 0b24171 into master May 2, 2024
80 checks passed
@mcculls mcculls deleted the mcculls/support-deferred-instrumentation branch May 2, 2024 12:16
@github-actions github-actions bot added this to the 1.34.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: core Tracer core tag: experimental Experimental changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants