-
Notifications
You must be signed in to change notification settings - Fork 298
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
Provide access to VM arguments via shared CLIHelper #8538
Conversation
internal-api/src/main/java/datadog/trace/bootstrap/config/provider/VMArgsCache.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/bootstrap/config/provider/VMArgsCache.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/bootstrap/config/provider/VMArgsCache.java
Outdated
Show resolved
Hide resolved
…ider/VMArgsCache.java Co-authored-by: datadog-datadog-prod-us1[bot] <88084959+datadog-datadog-prod-us1[bot]@users.noreply.github.com>
…ider/VMArgsCache.java Co-authored-by: datadog-datadog-prod-us1[bot] <88084959+datadog-datadog-prod-us1[bot]@users.noreply.github.com>
…ider/VMArgsCache.java Co-authored-by: datadog-datadog-prod-us1[bot] <88084959+datadog-datadog-prod-us1[bot]@users.noreply.github.com>
internal-api/src/main/java/datadog/trace/bootstrap/config/provider/VMArgsCache.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/bootstrap/config/provider/VMArgsCache.java
Outdated
Show resolved
Hide resolved
internal-api/src/main/java/datadog/trace/bootstrap/config/provider/VMArgsCache.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/AgentBootstrap.java
Outdated
Show resolved
Hide resolved
dd-java-agent/src/main/java/datadog/trace/bootstrap/AgentBootstrap.java
Outdated
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 65 metrics, 6 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047816
Total [baseline] (10.463 s) : 0, 10462788
Agent [candidate] (1.045 s) : 0, 1044553
Total [candidate] (10.412 s) : 0, 10411662
section appsec
Agent [baseline] (1.191 s) : 0, 1191037
Total [baseline] (10.765 s) : 0, 10765395
Agent [candidate] (1.189 s) : 0, 1189247
Total [candidate] (10.709 s) : 0, 10709113
section iast
Agent [baseline] (1.178 s) : 0, 1178343
Total [baseline] (10.989 s) : 0, 10989266
Agent [candidate] (1.2 s) : 0, 1200379
Total [candidate] (11.027 s) : 0, 11027252
section profiling
Agent [baseline] (1.27 s) : 0, 1270115
Total [baseline] (10.871 s) : 0, 10871033
Agent [candidate] (1.278 s) : 0, 1278033
Total [candidate] (10.897 s) : 0, 10896706
gantt
title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (717.662 ms) : 0, 717662
BytebuddyAgent [candidate] (718.59 ms) : 0, 718590
GlobalTracer [baseline] (240.96 ms) : 0, 240960
GlobalTracer [candidate] (239.611 ms) : 0, 239611
AppSec [baseline] (54.97 ms) : 0, 54970
AppSec [candidate] (54.5 ms) : 0, 54500
Debugger [baseline] (5.168 ms) : 0, 5168
Debugger [candidate] (5.15 ms) : 0, 5150
Remote Config [baseline] (726.589 µs) : 0, 727
Remote Config [candidate] (708.941 µs) : 0, 709
Telemetry [baseline] (12.236 ms) : 0, 12236
Telemetry [candidate] (9.959 ms) : 0, 9959
section appsec
BytebuddyAgent [baseline] (738.837 ms) : 0, 738837
BytebuddyAgent [candidate] (736.484 ms) : 0, 736484
GlobalTracer [baseline] (236.206 ms) : 0, 236206
GlobalTracer [candidate] (236.462 ms) : 0, 236462
IAST [baseline] (21.384 ms) : 0, 21384
IAST [candidate] (21.535 ms) : 0, 21535
AppSec [baseline] (176.007 ms) : 0, 176007
AppSec [candidate] (176.36 ms) : 0, 176360
Debugger [baseline] (4.32 ms) : 0, 4320
Debugger [candidate] (4.303 ms) : 0, 4303
Remote Config [baseline] (656.816 µs) : 0, 657
Remote Config [candidate] (644.113 µs) : 0, 644
Telemetry [baseline] (8.225 ms) : 0, 8225
Telemetry [candidate] (8.196 ms) : 0, 8196
section iast
BytebuddyAgent [baseline] (839.299 ms) : 0, 839299
BytebuddyAgent [candidate] (856.953 ms) : 0, 856953
GlobalTracer [baseline] (230.883 ms) : 0, 230883
GlobalTracer [candidate] (233.638 ms) : 0, 233638
IAST [baseline] (23.557 ms) : 0, 23557
IAST [candidate] (23.199 ms) : 0, 23199
AppSec [baseline] (55.013 ms) : 0, 55013
AppSec [candidate] (56.657 ms) : 0, 56657
Debugger [baseline] (4.166 ms) : 0, 4166
Debugger [candidate] (4.196 ms) : 0, 4196
Remote Config [baseline] (594.452 µs) : 0, 594
Remote Config [candidate] (615.856 µs) : 0, 616
Telemetry [baseline] (8.817 ms) : 0, 8817
Telemetry [candidate] (8.924 ms) : 0, 8924
section profiling
BytebuddyAgent [baseline] (709.245 ms) : 0, 709245
BytebuddyAgent [candidate] (713.459 ms) : 0, 713459
GlobalTracer [baseline] (349.499 ms) : 0, 349499
GlobalTracer [candidate] (351.592 ms) : 0, 351592
AppSec [baseline] (54.258 ms) : 0, 54258
AppSec [candidate] (54.011 ms) : 0, 54011
Debugger [baseline] (4.257 ms) : 0, 4257
Debugger [candidate] (4.318 ms) : 0, 4318
Remote Config [baseline] (685.17 µs) : 0, 685
Remote Config [candidate] (704.746 µs) : 0, 705
Telemetry [baseline] (8.881 ms) : 0, 8881
Telemetry [candidate] (9.021 ms) : 0, 9021
ProfilingAgent [baseline] (101.676 ms) : 0, 101676
ProfilingAgent [candidate] (103.067 ms) : 0, 103067
Profiling [baseline] (101.702 ms) : 0, 101702
Profiling [candidate] (103.093 ms) : 0, 103093
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.051 s) : 0, 1050585
Total [baseline] (8.707 s) : 0, 8706611
Agent [candidate] (1.046 s) : 0, 1046467
Total [candidate] (8.661 s) : 0, 8661499
section iast
Agent [baseline] (1.172 s) : 0, 1172312
Total [baseline] (9.224 s) : 0, 9223706
Agent [candidate] (1.176 s) : 0, 1175831
Total [candidate] (9.269 s) : 0, 9268849
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.176 s) : 0, 1175561
Total [baseline] (9.229 s) : 0, 9229276
Agent [candidate] (1.176 s) : 0, 1175678
Total [candidate] (9.19 s) : 0, 9189870
section iast_TELEMETRY_OFF
Agent [baseline] (1.18 s) : 0, 1179520
Total [baseline] (9.225 s) : 0, 9225386
Agent [candidate] (1.174 s) : 0, 1173527
Total [candidate] (9.21 s) : 0, 9210016
gantt
title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (719.007 ms) : 0, 719007
BytebuddyAgent [candidate] (717.943 ms) : 0, 717943
GlobalTracer [baseline] (240.769 ms) : 0, 240769
GlobalTracer [candidate] (240.197 ms) : 0, 240197
AppSec [baseline] (56.019 ms) : 0, 56019
AppSec [candidate] (54.351 ms) : 0, 54351
Debugger [baseline] (4.457 ms) : 0, 4457
Debugger [candidate] (4.399 ms) : 0, 4399
Remote Config [baseline] (711.983 µs) : 0, 712
Remote Config [candidate] (708.595 µs) : 0, 709
Telemetry [baseline] (13.524 ms) : 0, 13524
Telemetry [candidate] (12.813 ms) : 0, 12813
section iast
BytebuddyAgent [baseline] (835.084 ms) : 0, 835084
BytebuddyAgent [candidate] (837.807 ms) : 0, 837807
GlobalTracer [baseline] (229.274 ms) : 0, 229274
GlobalTracer [candidate] (229.816 ms) : 0, 229816
IAST [baseline] (22.655 ms) : 0, 22655
IAST [candidate] (23.635 ms) : 0, 23635
AppSec [baseline] (55.88 ms) : 0, 55880
AppSec [candidate] (55.105 ms) : 0, 55105
Debugger [baseline] (4.163 ms) : 0, 4163
Debugger [candidate] (4.148 ms) : 0, 4148
Remote Config [baseline] (607.092 µs) : 0, 607
Remote Config [candidate] (594.517 µs) : 0, 595
Telemetry [baseline] (8.716 ms) : 0, 8716
Telemetry [candidate] (8.733 ms) : 0, 8733
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (837.714 ms) : 0, 837714
BytebuddyAgent [candidate] (837.259 ms) : 0, 837259
GlobalTracer [baseline] (230.165 ms) : 0, 230165
GlobalTracer [candidate] (230.353 ms) : 0, 230353
IAST [baseline] (22.651 ms) : 0, 22651
IAST [candidate] (23.532 ms) : 0, 23532
AppSec [baseline] (55.555 ms) : 0, 55555
AppSec [candidate] (55.208 ms) : 0, 55208
Debugger [baseline] (4.112 ms) : 0, 4112
Debugger [candidate] (4.074 ms) : 0, 4074
Remote Config [baseline] (592.278 µs) : 0, 592
Remote Config [candidate] (588.861 µs) : 0, 589
Telemetry [baseline] (8.747 ms) : 0, 8747
Telemetry [candidate] (8.709 ms) : 0, 8709
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (840.645 ms) : 0, 840645
BytebuddyAgent [candidate] (835.517 ms) : 0, 835517
GlobalTracer [baseline] (230.984 ms) : 0, 230984
GlobalTracer [candidate] (230.079 ms) : 0, 230079
IAST [baseline] (22.452 ms) : 0, 22452
IAST [candidate] (22.474 ms) : 0, 22474
AppSec [baseline] (55.965 ms) : 0, 55965
AppSec [candidate] (56.14 ms) : 0, 56140
Debugger [baseline] (4.124 ms) : 0, 4124
Debugger [candidate] (4.151 ms) : 0, 4151
Remote Config [baseline] (592.925 µs) : 0, 593
Remote Config [candidate] (605.201 µs) : 0, 605
Telemetry [baseline] (8.669 ms) : 0, 8669
Telemetry [candidate] (8.574 ms) : 0, 8574
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 13 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section baseline
no_agent (1.368 ms) : 1348, 1388
. : milestone, 1368,
appsec (1.744 ms) : 1720, 1768
. : milestone, 1744,
appsec_no_iast (1.762 ms) : 1738, 1785
. : milestone, 1762,
code_origins (1.696 ms) : 1669, 1722
. : milestone, 1696,
iast (1.498 ms) : 1473, 1523
. : milestone, 1498,
profiling (1.515 ms) : 1491, 1538
. : milestone, 1515,
tracing (1.511 ms) : 1486, 1537
. : milestone, 1511,
section candidate
no_agent (1.363 ms) : 1344, 1382
. : milestone, 1363,
appsec (1.748 ms) : 1724, 1772
. : milestone, 1748,
appsec_no_iast (1.738 ms) : 1715, 1762
. : milestone, 1738,
code_origins (1.696 ms) : 1669, 1724
. : milestone, 1696,
iast (1.52 ms) : 1497, 1544
. : milestone, 1520,
profiling (1.577 ms) : 1552, 1602
. : milestone, 1577,
tracing (1.521 ms) : 1497, 1545
. : milestone, 1521,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section baseline
no_agent (380.184 µs) : 361, 400
. : milestone, 380,
iast (511.561 µs) : 490, 533
. : milestone, 512,
iast_FULL (737.467 µs) : 716, 759
. : milestone, 737,
iast_GLOBAL (562.327 µs) : 541, 584
. : milestone, 562,
iast_HARDCODED_SECRET_DISABLED (517.451 µs) : 495, 540
. : milestone, 517,
iast_INACTIVE (474.104 µs) : 453, 496
. : milestone, 474,
iast_TELEMETRY_OFF (505.337 µs) : 484, 527
. : milestone, 505,
tracing (464.829 µs) : 444, 486
. : milestone, 465,
section candidate
no_agent (393.692 µs) : 374, 414
. : milestone, 394,
iast (517.676 µs) : 496, 539
. : milestone, 518,
iast_FULL (733.842 µs) : 712, 756
. : milestone, 734,
iast_GLOBAL (559.06 µs) : 537, 581
. : milestone, 559,
iast_HARDCODED_SECRET_DISABLED (515.657 µs) : 494, 537
. : milestone, 516,
iast_INACTIVE (472.953 µs) : 452, 494
. : milestone, 473,
iast_TELEMETRY_OFF (505.955 µs) : 484, 528
. : milestone, 506,
tracing (462.991 µs) : 442, 484
. : milestone, 463,
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.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section baseline
no_agent (14.958 s) : 14958000, 14958000
. : milestone, 14958000,
appsec (14.847 s) : 14847000, 14847000
. : milestone, 14847000,
iast (18.866 s) : 18866000, 18866000
. : milestone, 18866000,
iast_GLOBAL (17.737 s) : 17737000, 17737000
. : milestone, 17737000,
profiling (14.89 s) : 14890000, 14890000
. : milestone, 14890000,
tracing (14.987 s) : 14987000, 14987000
. : milestone, 14987000,
section candidate
no_agent (15.434 s) : 15434000, 15434000
. : milestone, 15434000,
appsec (15.022 s) : 15022000, 15022000
. : milestone, 15022000,
iast (19.117 s) : 19117000, 19117000
. : milestone, 19117000,
iast_GLOBAL (18.067 s) : 18067000, 18067000
. : milestone, 18067000,
profiling (15.138 s) : 15138000, 15138000
. : milestone, 15138000,
tracing (15.093 s) : 15093000, 15093000
. : milestone, 15093000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~8837a21358, baseline=1.48.0-SNAPSHOT~fe8895f92a
dateFormat X
axisFormat %s
section baseline
no_agent (1.476 ms) : 1464, 1487
. : milestone, 1476,
appsec (2.355 ms) : 2311, 2399
. : milestone, 2355,
iast (2.131 ms) : 2075, 2187
. : milestone, 2131,
iast_GLOBAL (2.177 ms) : 2120, 2233
. : milestone, 2177,
profiling (1.992 ms) : 1946, 2037
. : milestone, 1992,
tracing (1.97 ms) : 1927, 2013
. : milestone, 1970,
section candidate
no_agent (1.475 ms) : 1464, 1487
. : milestone, 1475,
appsec (2.349 ms) : 2305, 2393
. : milestone, 2349,
iast (2.131 ms) : 2075, 2187
. : milestone, 2131,
iast_GLOBAL (2.168 ms) : 2112, 2224
. : milestone, 2168,
profiling (1.971 ms) : 1927, 2015
. : milestone, 1971,
tracing (1.955 ms) : 1913, 1998
. : milestone, 1955,
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
Moving this back to draft temporarily while I modify jvm args data structure to better support stable config. |
a8b93c7
to
2798bed
Compare
* store args in static field, make available via static getter * use list of strings as storage type to begin with * prefer NIO methods to read content (defaults to UTF8) * use try-with-resources to ensure reader is closed * check file exists as a quick short-circuit
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.
LGTM
What Does This Do
Moves existing logic for getting VM arguments out of AgentBootstrap.java and into a new component, CLIHlper class. This class gets all VM Args on startup and stores them in a HashSet for optimized querying.

This PR also expands the existing logic for getting VM Args to include a linux-specific check via procfs; the
/proc/self/cmdline
symlink on linux systems allows for reading jvm args of the current process.https://hub.docker.com/_/busybox
Motivation
Checking VM args is a requirement for the Stable Configuration Phase 2 project (Draft PR | RFC). The Stable Configuration logic will check whether specific process arguments are set on the process and, if so, apply some tracer configuration. Theoretically, we could expect an infinite number of queries for specific process arguments, and that's why I chose HashSet (as opposed to a List) as the underlying data structure. The existing logic in getAgentFilesFromVMArguments, which iterates over all the existing keys to check for those that start with "javaagent", is still O(n), but that has not changed.
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: [PROJ-IDENT]