-
Notifications
You must be signed in to change notification settings - Fork 316
Service discovery - remove dependency on memfd_create #9913
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
base: master
Are you sure you want to change the base?
Conversation
|
🎯 Code Coverage 🔗 Commit SHA: f784c67 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 6 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.101 s) : 0, 1100587
Total [baseline] (10.805 s) : 0, 10804754
Agent [candidate] (1.1 s) : 0, 1099972
Total [candidate] (10.831 s) : 0, 10831109
section appsec
Agent [baseline] (1.282 s) : 0, 1281675
Total [baseline] (11.098 s) : 0, 11098045
Agent [candidate] (1.281 s) : 0, 1280514
Total [candidate] (10.972 s) : 0, 10971989
section iast
Agent [baseline] (1.248 s) : 0, 1248064
Total [baseline] (11.236 s) : 0, 11235759
Agent [candidate] (1.238 s) : 0, 1237962
Total [candidate] (11.252 s) : 0, 11252351
section profiling
Agent [baseline] (1.229 s) : 0, 1228925
Total [baseline] (11.127 s) : 0, 11127473
Agent [candidate] (1.236 s) : 0, 1235937
Total [candidate] (11.255 s) : 0, 11254617
gantt
title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.456 ms) : 0, 1456
crashtracking [candidate] (1.445 ms) : 0, 1445
BytebuddyAgent [baseline] (706.705 ms) : 0, 706705
BytebuddyAgent [candidate] (706.416 ms) : 0, 706416
GlobalTracer [baseline] (248.536 ms) : 0, 248536
GlobalTracer [candidate] (248.583 ms) : 0, 248583
AppSec [baseline] (32.123 ms) : 0, 32123
AppSec [candidate] (32.195 ms) : 0, 32195
Debugger [baseline] (64.2 ms) : 0, 64200
Debugger [candidate] (64.053 ms) : 0, 64053
Remote Config [baseline] (633.734 µs) : 0, 634
Remote Config [candidate] (623.581 µs) : 0, 624
Telemetry [baseline] (8.343 ms) : 0, 8343
Telemetry [candidate] (8.199 ms) : 0, 8199
Flare Poller [baseline] (3.735 ms) : 0, 3735
Flare Poller [candidate] (3.708 ms) : 0, 3708
section appsec
crashtracking [baseline] (1.451 ms) : 0, 1451
crashtracking [candidate] (1.442 ms) : 0, 1442
BytebuddyAgent [baseline] (729.969 ms) : 0, 729969
BytebuddyAgent [candidate] (731.343 ms) : 0, 731343
GlobalTracer [baseline] (240.973 ms) : 0, 240973
GlobalTracer [candidate] (241.115 ms) : 0, 241115
IAST [baseline] (25.202 ms) : 0, 25202
IAST [candidate] (24.86 ms) : 0, 24860
AppSec [baseline] (174.886 ms) : 0, 174886
AppSec [candidate] (173.599 ms) : 0, 173599
Debugger [baseline] (61.23 ms) : 0, 61230
Debugger [candidate] (60.587 ms) : 0, 60587
Remote Config [baseline] (691.921 µs) : 0, 692
Remote Config [candidate] (678.913 µs) : 0, 679
Telemetry [baseline] (8.401 ms) : 0, 8401
Telemetry [candidate] (8.154 ms) : 0, 8154
Flare Poller [baseline] (3.858 ms) : 0, 3858
Flare Poller [candidate] (3.836 ms) : 0, 3836
section iast
crashtracking [baseline] (1.466 ms) : 0, 1466
crashtracking [candidate] (1.444 ms) : 0, 1444
BytebuddyAgent [baseline] (837.243 ms) : 0, 837243
BytebuddyAgent [candidate] (829.398 ms) : 0, 829398
GlobalTracer [baseline] (239.79 ms) : 0, 239790
GlobalTracer [candidate] (238.258 ms) : 0, 238258
IAST [baseline] (30.117 ms) : 0, 30117
IAST [candidate] (31.44 ms) : 0, 31440
AppSec [baseline] (31.416 ms) : 0, 31416
AppSec [candidate] (29.745 ms) : 0, 29745
Debugger [baseline] (61.31 ms) : 0, 61310
Debugger [candidate] (61.0 ms) : 0, 61000
Remote Config [baseline] (555.075 µs) : 0, 555
Remote Config [candidate] (546.095 µs) : 0, 546
Telemetry [baseline] (7.676 ms) : 0, 7676
Telemetry [candidate] (7.804 ms) : 0, 7804
Flare Poller [baseline] (3.476 ms) : 0, 3476
Flare Poller [candidate] (3.523 ms) : 0, 3523
section profiling
crashtracking [baseline] (1.43 ms) : 0, 1430
crashtracking [candidate] (1.455 ms) : 0, 1455
BytebuddyAgent [baseline] (730.438 ms) : 0, 730438
BytebuddyAgent [candidate] (735.469 ms) : 0, 735469
GlobalTracer [baseline] (222.627 ms) : 0, 222627
GlobalTracer [candidate] (223.253 ms) : 0, 223253
AppSec [baseline] (32.329 ms) : 0, 32329
AppSec [candidate] (32.412 ms) : 0, 32412
Debugger [baseline] (63.049 ms) : 0, 63049
Debugger [candidate] (63.785 ms) : 0, 63785
Remote Config [baseline] (642.434 µs) : 0, 642
Remote Config [candidate] (663.332 µs) : 0, 663
Telemetry [baseline] (7.945 ms) : 0, 7945
Telemetry [candidate] (7.929 ms) : 0, 7929
Flare Poller [baseline] (3.743 ms) : 0, 3743
Flare Poller [candidate] (3.795 ms) : 0, 3795
ProfilingAgent [baseline] (97.093 ms) : 0, 97093
ProfilingAgent [candidate] (97.076 ms) : 0, 97076
Profiling [baseline] (97.687 ms) : 0, 97687
Profiling [candidate] (97.663 ms) : 0, 97663
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.1 s) : 0, 1100433
Total [baseline] (8.859 s) : 0, 8858721
Agent [candidate] (1.109 s) : 0, 1109493
Total [candidate] (8.812 s) : 0, 8812484
section iast
Agent [baseline] (1.234 s) : 0, 1233578
Total [baseline] (9.549 s) : 0, 9549150
Agent [candidate] (1.239 s) : 0, 1238740
Total [candidate] (9.569 s) : 0, 9568745
gantt
title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.449 ms) : 0, 1449
crashtracking [candidate] (1.46 ms) : 0, 1460
BytebuddyAgent [baseline] (707.277 ms) : 0, 707277
BytebuddyAgent [candidate] (712.068 ms) : 0, 712068
GlobalTracer [baseline] (248.419 ms) : 0, 248419
GlobalTracer [candidate] (251.639 ms) : 0, 251639
AppSec [baseline] (32.424 ms) : 0, 32424
AppSec [candidate] (32.941 ms) : 0, 32941
Debugger [baseline] (63.531 ms) : 0, 63531
Debugger [candidate] (63.908 ms) : 0, 63908
Remote Config [baseline] (635.634 µs) : 0, 636
Remote Config [candidate] (636.419 µs) : 0, 636
Telemetry [baseline] (8.252 ms) : 0, 8252
Telemetry [candidate] (8.154 ms) : 0, 8154
Flare Poller [baseline] (3.715 ms) : 0, 3715
Flare Poller [candidate] (3.702 ms) : 0, 3702
section iast
crashtracking [baseline] (1.449 ms) : 0, 1449
crashtracking [candidate] (1.451 ms) : 0, 1451
BytebuddyAgent [baseline] (827.537 ms) : 0, 827537
BytebuddyAgent [candidate] (830.742 ms) : 0, 830742
GlobalTracer [baseline] (236.782 ms) : 0, 236782
GlobalTracer [candidate] (238.307 ms) : 0, 238307
AppSec [baseline] (34.046 ms) : 0, 34046
AppSec [candidate] (34.677 ms) : 0, 34677
Debugger [baseline] (59.902 ms) : 0, 59902
Debugger [candidate] (60.312 ms) : 0, 60312
Remote Config [baseline] (553.047 µs) : 0, 553
Remote Config [candidate] (545.913 µs) : 0, 546
Telemetry [baseline] (7.567 ms) : 0, 7567
Telemetry [candidate] (7.703 ms) : 0, 7703
Flare Poller [baseline] (3.461 ms) : 0, 3461
Flare Poller [candidate] (3.471 ms) : 0, 3471
IAST [baseline] (27.374 ms) : 0, 27374
IAST [candidate] (26.627 ms) : 0, 26627
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 19 metrics, 15 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section baseline
no_agent (1.189 ms) : 1177, 1200
. : milestone, 1189,
iast (3.286 ms) : 3238, 3335
. : milestone, 3286,
iast_FULL (5.759 ms) : 5682, 5836
. : milestone, 5759,
iast_GLOBAL (3.628 ms) : 3575, 3681
. : milestone, 3628,
profiling (2.004 ms) : 1987, 2020
. : milestone, 2004,
tracing (1.824 ms) : 1809, 1839
. : milestone, 1824,
section candidate
no_agent (1.185 ms) : 1173, 1196
. : milestone, 1185,
iast (3.253 ms) : 3204, 3301
. : milestone, 3253,
iast_FULL (5.839 ms) : 5781, 5896
. : milestone, 5839,
iast_GLOBAL (3.667 ms) : 3607, 3727
. : milestone, 3667,
profiling (1.974 ms) : 1957, 1990
. : milestone, 1974,
tracing (1.798 ms) : 1784, 1812
. : milestone, 1798,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section baseline
no_agent (19.274 ms) : 19077, 19472
. : milestone, 19274,
appsec (18.454 ms) : 18269, 18639
. : milestone, 18454,
code_origins (17.696 ms) : 17520, 17873
. : milestone, 17696,
iast (17.991 ms) : 17811, 18171
. : milestone, 17991,
profiling (18.778 ms) : 18588, 18967
. : milestone, 18778,
tracing (17.586 ms) : 17411, 17760
. : milestone, 17586,
section candidate
no_agent (19.416 ms) : 19219, 19614
. : milestone, 19416,
appsec (18.647 ms) : 18455, 18840
. : milestone, 18647,
code_origins (17.928 ms) : 17746, 18110
. : milestone, 17928,
iast (17.808 ms) : 17630, 17986
. : milestone, 17808,
profiling (20.074 ms) : 19871, 20277
. : milestone, 20074,
tracing (17.757 ms) : 17578, 17937
. : milestone, 17757,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section baseline
no_agent (15.636 s) : 15636000, 15636000
. : milestone, 15636000,
appsec (14.688 s) : 14688000, 14688000
. : milestone, 14688000,
iast (18.408 s) : 18408000, 18408000
. : milestone, 18408000,
iast_GLOBAL (18.111 s) : 18111000, 18111000
. : milestone, 18111000,
profiling (15.053 s) : 15053000, 15053000
. : milestone, 15053000,
tracing (14.653 s) : 14653000, 14653000
. : milestone, 14653000,
section candidate
no_agent (15.303 s) : 15303000, 15303000
. : milestone, 15303000,
appsec (14.858 s) : 14858000, 14858000
. : milestone, 14858000,
iast (18.423 s) : 18423000, 18423000
. : milestone, 18423000,
iast_GLOBAL (18.033 s) : 18033000, 18033000
. : milestone, 18033000,
profiling (14.878 s) : 14878000, 14878000
. : milestone, 14878000,
tracing (14.716 s) : 14716000, 14716000
. : milestone, 14716000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~f784c677ef, baseline=1.56.0-SNAPSHOT~b436de808f
dateFormat X
axisFormat %s
section baseline
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.711 ms) : 3494, 3928
. : milestone, 3711,
iast (2.204 ms) : 2140, 2268
. : milestone, 2204,
iast_GLOBAL (2.247 ms) : 2183, 2311
. : milestone, 2247,
profiling (2.081 ms) : 2028, 2134
. : milestone, 2081,
tracing (2.03 ms) : 1980, 2080
. : milestone, 2030,
section candidate
no_agent (1.475 ms) : 1463, 1487
. : milestone, 1475,
appsec (3.762 ms) : 3540, 3985
. : milestone, 3762,
iast (2.207 ms) : 2143, 2271
. : milestone, 2207,
iast_GLOBAL (2.251 ms) : 2188, 2315
. : milestone, 2251,
profiling (2.084 ms) : 2030, 2138
. : milestone, 2084,
tracing (2.029 ms) : 1979, 2078
. : milestone, 2029,
|
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
| String arch = System.getProperty("os.arch"); | ||
| int memfdSyscall = getMemfdSyscall(arch); | ||
| if (memfdSyscall <= 0) { | ||
| log.debug("service discovery not supported for arch={}", arch); |
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.
are you interested in sending those to the telemetry? Otherwise you won't know unless the customer activates the debug logging and send a flares. In this case you have a SEND_TELEMETRY marker
| private static int getMemfdSyscall(String arch) { | ||
| switch (arch.toLowerCase()) { | ||
| // https://elixir.bootlin.com/musl/v1.2.5/source/arch/x86_64/bits/syscall.h.in#L320 | ||
| case "x86_64": |
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.
You could consolidate this by allowing the case statements to fallthrough.
case "x86_64":
case "x64":
case "amd64":
return 319;
Just a suggestion, I don't feel strongly about it.
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.
nice
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.
looking at these "magic numbers" makes every bone in my body shake, but because I can't think of a better idea that doesnt require a C shim 😅 or preprocessing of the source code 🫣 I'll stay quiet and say this lgtm 😜
natitsechanski
left a comment
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 🤷 😅
...gent-tooling/src/main/java/datadog/trace/agent/tooling/servicediscovery/MemFDUnixWriter.java
Outdated
Show resolved
Hide resolved
| // https://elixir.bootlin.com/musl/v1.2.5/source/arch/x86_64/bits/syscall.h.in#L320 | ||
| return 319; | ||
| case "x386": | ||
| // https://elixir.bootlin.com/musl/v1.2.5/source/arch/i386/bits/syscall.h.in#L356 |
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.
suggestion: same as above.
Also, does makes sense to have a x86 case ?
What Does This Do
memfd_create was introduced in glibc 2.27, meaning that on distros before and including centos7, debian8, amazonlinux2 the JNA logic triggers an exception while searching for the symbol. The exception is caught on purpose by the try-catch but it is still collected in the crash tracking initiative.
Removing it by calling directly the syscall
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]