-
Notifications
You must be signed in to change notification settings - Fork 290
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
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 15 unstable metrics. Startup time reports for insecure-bankgantt
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
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 petclinicgantt
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
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
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
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,
Request duration reports for insecure-bankgantt
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,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
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,
Execution time for biojavagantt
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,
|
2082f49
to
a69f2f1
Compare
a69f2f1
to
2f515b9
Compare
a34888a
to
a793d88
Compare
9e24b23
to
d7a9d6e
Compare
/** 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]?)"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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<>(); |
There was a problem hiding this comment.
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.
d7a9d6e
to
2b9c91b
Compare
Environment variable:
Units of h (hours) and s (seconds) are also accepted, the default unit when omitted is seconds.
Equivalent JVM option:
You can also limit this feature to particular class-loaders with this environment variable:
or this JVM option:
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