-
Notifications
You must be signed in to change notification settings - Fork 292
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
Refactor DI startup to make Exception Replay can be started up alone #7648
Conversation
Make sure Exception Replay can be started up without DI. Remote Config subscription is not started if DI is not enabled now. The debugger agent is initialized if either Dynamic Instrumentation or Exception Replay is enabled
@@ -149,6 +151,7 @@ public boolean isEnabledByDefault() { | |||
private static boolean usmEnabled = false; | |||
private static boolean telemetryEnabled = true; | |||
private static boolean debuggerEnabled = false; | |||
private static boolean exceptionDebuggingEnabled = false; |
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.
🟠 Code Quality Violation
private static boolean exceptionDebuggingEnabled = false; | |
private static boolean exceptionDebuggingEnabled; |
Remove initialization, this is already the default value. (...read more)
When initializing fields, prevent initializing fields to the default value. Any additional initialization means more bytecode instructions, and allocating many of these objects may impact your application performance.
If you initialize to a default value, remove the initialization.
Debugger benchmarksParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 9 metrics, 6 unstable metrics. See unchanged results
Request duration reports for reportsgantt
title reports - request duration [CI 0.99] : candidate=None, baseline=None
dateFormat X
axisFormat %s
section baseline
noprobe (297.492 µs) : 272, 323
. : milestone, 297,
basic (296.466 µs) : 288, 305
. : milestone, 296,
loop (10.977 ms) : 10950, 11003
. : milestone, 10977,
section candidate
noprobe (313.154 µs) : 257, 369
. : milestone, 313,
basic (306.925 µs) : 294, 320
. : milestone, 307,
loop (10.994 ms) : 10970, 11019
. : milestone, 10994,
|
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 14 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.067 s) : 0, 1066824
Total [baseline] (10.391 s) : 0, 10391004
Agent [candidate] (1.067 s) : 0, 1067409
Total [candidate] (10.404 s) : 0, 10404015
section appsec
Agent [baseline] (1.204 s) : 0, 1203767
Total [baseline] (10.646 s) : 0, 10646416
Agent [candidate] (1.202 s) : 0, 1202403
Total [candidate] (10.624 s) : 0, 10624260
section iast
Agent [baseline] (1.198 s) : 0, 1197549
Total [baseline] (10.863 s) : 0, 10862764
Agent [candidate] (1.205 s) : 0, 1204501
Total [candidate] (10.845 s) : 0, 10845278
section profiling
Agent [baseline] (1.274 s) : 0, 1274004
Total [baseline] (10.62 s) : 0, 10620443
Agent [candidate] (1.27 s) : 0, 1270322
Total [candidate] (10.642 s) : 0, 10641537
gantt
title petclinic - break down per module: candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (679.984 ms) : 0, 679984
BytebuddyAgent [candidate] (679.641 ms) : 0, 679641
GlobalTracer [baseline] (311.065 ms) : 0, 311065
GlobalTracer [candidate] (311.686 ms) : 0, 311686
AppSec [baseline] (53.766 ms) : 0, 53766
AppSec [candidate] (53.946 ms) : 0, 53946
Remote Config [baseline] (675.483 µs) : 0, 675
Remote Config [candidate] (680.525 µs) : 0, 681
Telemetry [baseline] (7.6 ms) : 0, 7600
Telemetry [candidate] (7.655 ms) : 0, 7655
section appsec
BytebuddyAgent [baseline] (702.18 ms) : 0, 702180
BytebuddyAgent [candidate] (702.141 ms) : 0, 702141
GlobalTracer [baseline] (304.379 ms) : 0, 304379
GlobalTracer [candidate] (304.092 ms) : 0, 304092
AppSec [baseline] (163.351 ms) : 0, 163351
AppSec [candidate] (162.765 ms) : 0, 162765
Remote Config [baseline] (641.445 µs) : 0, 641
Remote Config [candidate] (647.894 µs) : 0, 648
Telemetry [baseline] (9.866 ms) : 0, 9866
Telemetry [candidate] (9.078 ms) : 0, 9078
IAST [baseline] (19.324 ms) : 0, 19324
IAST [candidate] (19.905 ms) : 0, 19905
section iast
BytebuddyAgent [baseline] (795.743 ms) : 0, 795743
BytebuddyAgent [candidate] (801.226 ms) : 0, 801226
GlobalTracer [baseline] (301.366 ms) : 0, 301366
GlobalTracer [candidate] (302.38 ms) : 0, 302380
AppSec [baseline] (55.746 ms) : 0, 55746
AppSec [candidate] (55.38 ms) : 0, 55380
Remote Config [baseline] (634.736 µs) : 0, 635
Remote Config [candidate] (615.315 µs) : 0, 615
Telemetry [baseline] (7.397 ms) : 0, 7397
Telemetry [candidate] (7.314 ms) : 0, 7314
IAST [baseline] (22.873 ms) : 0, 22873
IAST [candidate] (23.682 ms) : 0, 23682
section profiling
BytebuddyAgent [baseline] (677.837 ms) : 0, 677837
BytebuddyAgent [candidate] (674.924 ms) : 0, 674924
GlobalTracer [baseline] (398.232 ms) : 0, 398232
GlobalTracer [candidate] (397.832 ms) : 0, 397832
AppSec [baseline] (54.643 ms) : 0, 54643
AppSec [candidate] (54.581 ms) : 0, 54581
Remote Config [baseline] (714.342 µs) : 0, 714
Remote Config [candidate] (659.058 µs) : 0, 659
Telemetry [baseline] (7.491 ms) : 0, 7491
Telemetry [candidate] (7.494 ms) : 0, 7494
ProfilingAgent [baseline] (96.685 ms) : 0, 96685
ProfilingAgent [candidate] (96.486 ms) : 0, 96486
Profiling [baseline] (96.709 ms) : 0, 96709
Profiling [candidate] (96.51 ms) : 0, 96510
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.069 s) : 0, 1069122
Total [baseline] (8.593 s) : 0, 8592830
Agent [candidate] (1.077 s) : 0, 1076723
Total [candidate] (8.61 s) : 0, 8609576
section iast
Agent [baseline] (1.203 s) : 0, 1203088
Total [baseline] (9.079 s) : 0, 9078657
Agent [candidate] (1.192 s) : 0, 1192407
Total [candidate] (9.013 s) : 0, 9012658
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.201 s) : 0, 1201475
Total [baseline] (8.986 s) : 0, 8986099
Agent [candidate] (1.202 s) : 0, 1202111
Total [candidate] (9.044 s) : 0, 9044445
section iast_TELEMETRY_OFF
Agent [baseline] (1.198 s) : 0, 1197566
Total [baseline] (9.03 s) : 0, 9030112
Agent [candidate] (1.193 s) : 0, 1192581
Total [candidate] (9.019 s) : 0, 9018996
gantt
title insecure-bank - break down per module: candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (681.673 ms) : 0, 681673
BytebuddyAgent [candidate] (686.127 ms) : 0, 686127
GlobalTracer [baseline] (311.597 ms) : 0, 311597
GlobalTracer [candidate] (313.989 ms) : 0, 313989
AppSec [baseline] (53.785 ms) : 0, 53785
AppSec [candidate] (54.347 ms) : 0, 54347
Remote Config [baseline] (673.404 µs) : 0, 673
Remote Config [candidate] (672.37 µs) : 0, 672
Telemetry [baseline] (7.579 ms) : 0, 7579
Telemetry [candidate] (7.704 ms) : 0, 7704
section iast
BytebuddyAgent [baseline] (800.221 ms) : 0, 800221
BytebuddyAgent [candidate] (792.65 ms) : 0, 792650
GlobalTracer [baseline] (302.07 ms) : 0, 302070
GlobalTracer [candidate] (299.716 ms) : 0, 299716
AppSec [baseline] (54.309 ms) : 0, 54309
AppSec [candidate] (56.384 ms) : 0, 56384
Remote Config [baseline] (601.221 µs) : 0, 601
Remote Config [candidate] (608.407 µs) : 0, 608
Telemetry [baseline] (7.378 ms) : 0, 7378
Telemetry [candidate] (7.336 ms) : 0, 7336
IAST [baseline] (24.608 ms) : 0, 24608
IAST [candidate] (21.909 ms) : 0, 21909
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (798.543 ms) : 0, 798543
BytebuddyAgent [candidate] (798.023 ms) : 0, 798023
GlobalTracer [baseline] (302.17 ms) : 0, 302170
GlobalTracer [candidate] (302.486 ms) : 0, 302486
AppSec [baseline] (55.224 ms) : 0, 55224
AppSec [candidate] (54.528 ms) : 0, 54528
Remote Config [baseline] (661.902 µs) : 0, 662
Remote Config [candidate] (637.803 µs) : 0, 638
Telemetry [baseline] (7.365 ms) : 0, 7365
Telemetry [candidate] (7.454 ms) : 0, 7454
IAST [baseline] (23.611 ms) : 0, 23611
IAST [candidate] (25.046 ms) : 0, 25046
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (795.785 ms) : 0, 795785
BytebuddyAgent [candidate] (791.359 ms) : 0, 791359
GlobalTracer [baseline] (302.047 ms) : 0, 302047
GlobalTracer [candidate] (300.77 ms) : 0, 300770
AppSec [baseline] (53.832 ms) : 0, 53832
AppSec [candidate] (54.452 ms) : 0, 54452
Remote Config [baseline] (615.414 µs) : 0, 615
Remote Config [candidate] (2.241 ms) : 0, 2241
Telemetry [baseline] (7.254 ms) : 0, 7254
Telemetry [candidate] (7.29 ms) : 0, 7290
IAST [baseline] (24.125 ms) : 0, 24125
IAST [candidate] (22.627 ms) : 0, 22627
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section baseline
no_agent (369.587 µs) : 350, 389
. : milestone, 370,
iast (493.54 µs) : 472, 515
. : milestone, 494,
iast_FULL (559.431 µs) : 538, 580
. : milestone, 559,
iast_GLOBAL (516.96 µs) : 495, 539
. : milestone, 517,
iast_HARDCODED_SECRET_DISABLED (496.931 µs) : 475, 518
. : milestone, 497,
iast_INACTIVE (455.393 µs) : 434, 477
. : milestone, 455,
iast_TELEMETRY_OFF (486.811 µs) : 464, 510
. : milestone, 487,
tracing (450.011 µs) : 430, 470
. : milestone, 450,
section candidate
no_agent (375.771 µs) : 356, 396
. : milestone, 376,
iast (490.738 µs) : 470, 512
. : milestone, 491,
iast_FULL (560.099 µs) : 539, 581
. : milestone, 560,
iast_GLOBAL (518.84 µs) : 497, 541
. : milestone, 519,
iast_HARDCODED_SECRET_DISABLED (487.502 µs) : 466, 509
. : milestone, 488,
iast_INACTIVE (457.819 µs) : 436, 479
. : milestone, 458,
iast_TELEMETRY_OFF (484.223 µs) : 461, 507
. : milestone, 484,
tracing (448.295 µs) : 428, 469
. : milestone, 448,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section baseline
no_agent (1.353 ms) : 1333, 1372
. : milestone, 1353,
appsec (1.719 ms) : 1697, 1742
. : milestone, 1719,
appsec_no_iast (1.739 ms) : 1714, 1763
. : milestone, 1739,
iast (1.479 ms) : 1456, 1502
. : milestone, 1479,
profiling (1.523 ms) : 1497, 1549
. : milestone, 1523,
tracing (1.485 ms) : 1460, 1510
. : milestone, 1485,
section candidate
no_agent (1.332 ms) : 1313, 1351
. : milestone, 1332,
appsec (1.735 ms) : 1712, 1758
. : milestone, 1735,
appsec_no_iast (1.731 ms) : 1706, 1755
. : milestone, 1731,
iast (1.492 ms) : 1470, 1514
. : milestone, 1492,
profiling (1.496 ms) : 1471, 1520
. : milestone, 1496,
tracing (1.481 ms) : 1456, 1506
. : milestone, 1481,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section baseline
no_agent (15.142 s) : 15142000, 15142000
. : milestone, 15142000,
appsec (15.311 s) : 15311000, 15311000
. : milestone, 15311000,
iast (19.059 s) : 19059000, 19059000
. : milestone, 19059000,
iast_GLOBAL (18.119 s) : 18119000, 18119000
. : milestone, 18119000,
profiling (15.419 s) : 15419000, 15419000
. : milestone, 15419000,
tracing (15.084 s) : 15084000, 15084000
. : milestone, 15084000,
section candidate
no_agent (15.128 s) : 15128000, 15128000
. : milestone, 15128000,
appsec (15.375 s) : 15375000, 15375000
. : milestone, 15375000,
iast (19.025 s) : 19025000, 19025000
. : milestone, 19025000,
iast_GLOBAL (18.265 s) : 18265000, 18265000
. : milestone, 18265000,
profiling (15.336 s) : 15336000, 15336000
. : milestone, 15336000,
tracing (15.217 s) : 15217000, 15217000
. : milestone, 15217000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.40.0-SNAPSHOT~884b5594f2, baseline=1.40.0-SNAPSHOT~b4718bd887
dateFormat X
axisFormat %s
section baseline
no_agent (1.468 ms) : 1456, 1479
. : milestone, 1468,
appsec (2.325 ms) : 2285, 2366
. : milestone, 2325,
iast (2.047 ms) : 1998, 2096
. : milestone, 2047,
iast_GLOBAL (2.102 ms) : 2051, 2153
. : milestone, 2102,
profiling (1.941 ms) : 1900, 1982
. : milestone, 1941,
tracing (1.914 ms) : 1875, 1953
. : milestone, 1914,
section candidate
no_agent (1.466 ms) : 1455, 1478
. : milestone, 1466,
appsec (2.307 ms) : 2267, 2348
. : milestone, 2307,
iast (2.043 ms) : 1995, 2091
. : milestone, 2043,
iast_GLOBAL (2.102 ms) : 2051, 2152
. : milestone, 2102,
profiling (1.927 ms) : 1888, 1967
. : milestone, 1927,
tracing (1.912 ms) : 1874, 1950
. : milestone, 1912,
|
@@ -34,6 +34,8 @@ protected ProcessBuilder createProcessBuilder(Path logFilePath, String... params | |||
commandParams.add("-Ddd.exception.replay.enabled=true"); // enable exception replay | |||
commandParams.add("-Ddd.internal.exception.replay.only.local.root=false"); // for all spans | |||
commandParams.add("-Ddd.third.party.excludes=datadog.smoketest"); | |||
// disable DI to make sure exception debugger works alone | |||
commandParams.remove("-Ddd.dynamic.instrumentation.enabled=true"); |
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.
false?
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.
nop, we are removing the config added in the getDebuggerParams()
method
Note: shutdown hooks are tricky because JVM holds reference for them forever preventing | ||
GC for anything that is reachable from it. | ||
*/ | ||
Runtime.getRuntime().addShutdownHook(new ShutdownHook(configurationPoller, debuggerSink)); |
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.
configurationPoller can be null, is that a problem?
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.
not a problem, the weakReference will be null and by nature the weakRef is checked against null
Make sure Exception Replay can be started up without DI. Remote Config subscription is not started if DI is not enabled now. The debugger agent is initialized if either Dynamic Instrumentation or Exception Replay is enabled
What Does This Do
Make sure Exception Replay can be started up without DI. Remote Config subscription is not started if DI is not enabled now. The debugger agent is initialized if either Dynamic Instrumentation or
Exception Replay is enabled
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: DEBUG-2735