-
Notifications
You must be signed in to change notification settings - Fork 312
support service discovery with JNA #9705
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: 94cab5d | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 18 performance improvements and 14 performance regressions! Performance is the same for 30 metrics, 3 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.017 s) : 0, 1017450
Total [baseline] (8.672 s) : 0, 8671792
Agent [candidate] (1.113 s) : 0, 1113465
Total [candidate] (8.773 s) : 0, 8772535
section iast
Agent [baseline] (1.151 s) : 0, 1150902
Total [baseline] (9.331 s) : 0, 9330691
Agent [candidate] (1.252 s) : 0, 1252375
Total [candidate] (9.446 s) : 0, 9445547
gantt
title insecure-bank - break down per module: candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.471 ms) : 0, 1471
crashtracking [candidate] (1.467 ms) : 0, 1467
BytebuddyAgent [baseline] (692.828 ms) : 0, 692828
BytebuddyAgent [candidate] (698.178 ms) : 0, 698178
GlobalTracer [baseline] (241.515 ms) : 0, 241515
GlobalTracer [candidate] (342.406 ms) : 0, 342406
AppSec [baseline] (32.398 ms) : 0, 32398
AppSec [candidate] (31.089 ms) : 0, 31089
Debugger [baseline] (6.402 ms) : 0, 6402
Debugger [candidate] (6.312 ms) : 0, 6312
Remote Config [baseline] (710.022 µs) : 0, 710
Remote Config [candidate] (674.254 µs) : 0, 674
Telemetry [baseline] (9.293 ms) : 0, 9293
Telemetry [candidate] (8.207 ms) : 0, 8207
Flare Poller [baseline] (11.76 ms) : 0, 11760
Flare Poller [candidate] (3.938 ms) : 0, 3938
section iast
crashtracking [baseline] (1.475 ms) : 0, 1475
crashtracking [candidate] (1.469 ms) : 0, 1469
BytebuddyAgent [baseline] (815.176 ms) : 0, 815176
BytebuddyAgent [candidate] (822.356 ms) : 0, 822356
GlobalTracer [baseline] (231.628 ms) : 0, 231628
GlobalTracer [candidate] (329.773 ms) : 0, 329773
AppSec [baseline] (35.081 ms) : 0, 35081
AppSec [candidate] (32.184 ms) : 0, 32184
Debugger [baseline] (6.137 ms) : 0, 6137
Debugger [candidate] (7.556 ms) : 0, 7556
Remote Config [baseline] (609.342 µs) : 0, 609
Remote Config [candidate] (603.977 µs) : 0, 604
Telemetry [baseline] (8.654 ms) : 0, 8654
Telemetry [candidate] (7.841 ms) : 0, 7841
Flare Poller [baseline] (4.263 ms) : 0, 4263
Flare Poller [candidate] (3.961 ms) : 0, 3961
IAST [baseline] (26.593 ms) : 0, 26593
IAST [candidate] (25.243 ms) : 0, 25243
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.023 s) : 0, 1023486
Total [baseline] (10.757 s) : 0, 10757463
Agent [candidate] (1.104 s) : 0, 1103944
Total [candidate] (10.635 s) : 0, 10635379
section appsec
Agent [baseline] (1.195 s) : 0, 1194833
Total [baseline] (10.961 s) : 0, 10961476
Agent [candidate] (1.27 s) : 0, 1270485
Total [candidate] (10.954 s) : 0, 10953860
section iast
Agent [baseline] (1.152 s) : 0, 1152235
Total [baseline] (10.971 s) : 0, 10970569
Agent [candidate] (1.248 s) : 0, 1248155
Total [candidate] (11.069 s) : 0, 11068908
section profiling
Agent [baseline] (1.162 s) : 0, 1162258
Total [baseline] (11.106 s) : 0, 11105668
Agent [candidate] (1.254 s) : 0, 1254180
Total [candidate] (11.117 s) : 0, 11116689
gantt
title petclinic - break down per module: candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.488 ms) : 0, 1488
crashtracking [candidate] (1.453 ms) : 0, 1453
BytebuddyAgent [baseline] (699.185 ms) : 0, 699185
BytebuddyAgent [candidate] (691.908 ms) : 0, 691908
GlobalTracer [baseline] (242.311 ms) : 0, 242311
GlobalTracer [candidate] (339.347 ms) : 0, 339347
AppSec [baseline] (32.453 ms) : 0, 32453
AppSec [candidate] (31.013 ms) : 0, 31013
Debugger [baseline] (6.421 ms) : 0, 6421
Debugger [candidate] (6.348 ms) : 0, 6348
Remote Config [baseline] (703.01 µs) : 0, 703
Remote Config [candidate] (669.889 µs) : 0, 670
Telemetry [baseline] (9.315 ms) : 0, 9315
Telemetry [candidate] (8.145 ms) : 0, 8145
Flare Poller [baseline] (10.254 ms) : 0, 10254
Flare Poller [candidate] (3.981 ms) : 0, 3981
section appsec
crashtracking [baseline] (1.479 ms) : 0, 1479
crashtracking [candidate] (1.466 ms) : 0, 1466
BytebuddyAgent [baseline] (718.179 ms) : 0, 718179
BytebuddyAgent [candidate] (715.511 ms) : 0, 715511
GlobalTracer [baseline] (234.316 ms) : 0, 234316
GlobalTracer [candidate] (332.645 ms) : 0, 332645
IAST [baseline] (24.753 ms) : 0, 24753
IAST [candidate] (23.675 ms) : 0, 23675
AppSec [baseline] (174.625 ms) : 0, 174625
AppSec [candidate] (155.319 ms) : 0, 155319
Debugger [baseline] (6.193 ms) : 0, 6193
Debugger [candidate] (6.068 ms) : 0, 6068
Remote Config [baseline] (645.482 µs) : 0, 645
Remote Config [candidate] (649.792 µs) : 0, 650
Telemetry [baseline] (9.479 ms) : 0, 9479
Telemetry [candidate] (8.154 ms) : 0, 8154
Flare Poller [baseline] (3.988 ms) : 0, 3988
Flare Poller [candidate] (5.955 ms) : 0, 5955
section iast
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.46 ms) : 0, 1460
BytebuddyAgent [baseline] (816.059 ms) : 0, 816059
BytebuddyAgent [candidate] (820.042 ms) : 0, 820042
GlobalTracer [baseline] (231.879 ms) : 0, 231879
GlobalTracer [candidate] (329.18 ms) : 0, 329180
IAST [baseline] (26.673 ms) : 0, 26673
IAST [candidate] (24.874 ms) : 0, 24874
AppSec [baseline] (35.063 ms) : 0, 35063
AppSec [candidate] (31.601 ms) : 0, 31601
Debugger [baseline] (6.165 ms) : 0, 6165
Debugger [candidate] (7.483 ms) : 0, 7483
Remote Config [baseline] (617.195 µs) : 0, 617
Remote Config [candidate] (589.06 µs) : 0, 589
Telemetry [baseline] (8.637 ms) : 0, 8637
Telemetry [candidate] (7.702 ms) : 0, 7702
Flare Poller [baseline] (4.308 ms) : 0, 4308
Flare Poller [candidate] (3.881 ms) : 0, 3881
section profiling
crashtracking [baseline] (1.42 ms) : 0, 1420
crashtracking [candidate] (1.452 ms) : 0, 1452
BytebuddyAgent [baseline] (722.131 ms) : 0, 722131
BytebuddyAgent [candidate] (731.435 ms) : 0, 731435
GlobalTracer [baseline] (218.066 ms) : 0, 218066
GlobalTracer [candidate] (308.151 ms) : 0, 308151
AppSec [baseline] (32.787 ms) : 0, 32787
AppSec [candidate] (31.386 ms) : 0, 31386
Debugger [baseline] (6.491 ms) : 0, 6491
Debugger [candidate] (6.345 ms) : 0, 6345
Remote Config [baseline] (706.74 µs) : 0, 707
Remote Config [candidate] (689.086 µs) : 0, 689
Telemetry [baseline] (16.74 ms) : 0, 16740
Telemetry [candidate] (7.844 ms) : 0, 7844
Flare Poller [baseline] (4.209 ms) : 0, 4209
Flare Poller [candidate] (4.086 ms) : 0, 4086
ProfilingAgent [baseline] (107.158 ms) : 0, 107158
ProfilingAgent [candidate] (109.651 ms) : 0, 109651
Profiling [baseline] (107.732 ms) : 0, 107732
Profiling [candidate] (110.291 ms) : 0, 110291
LoadParameters
See matching parameters
SummaryFound 4 performance improvements and 1 performance regressions! Performance is the same for 7 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section baseline
no_agent (36.038 ms) : 35753, 36324
. : milestone, 36038,
appsec (51.505 ms) : 51051, 51958
. : milestone, 51505,
code_origins (42.152 ms) : 41801, 42503
. : milestone, 42152,
iast (45.751 ms) : 45372, 46129
. : milestone, 45751,
profiling (48.387 ms) : 47905, 48869
. : milestone, 48387,
tracing (46.13 ms) : 45725, 46535
. : milestone, 46130,
section candidate
no_agent (35.944 ms) : 35653, 36235
. : milestone, 35944,
appsec (48.68 ms) : 48236, 49124
. : milestone, 48680,
code_origins (44.043 ms) : 43657, 44429
. : milestone, 44043,
iast (43.86 ms) : 43494, 44227
. : milestone, 43860,
profiling (49.209 ms) : 48720, 49698
. : milestone, 49209,
tracing (44.91 ms) : 44523, 45296
. : milestone, 44910,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section baseline
no_agent (4.361 ms) : 4307, 4415
. : milestone, 4361,
iast (9.961 ms) : 9791, 10130
. : milestone, 9961,
iast_FULL (14.438 ms) : 14149, 14726
. : milestone, 14438,
iast_GLOBAL (10.327 ms) : 10145, 10510
. : milestone, 10327,
profiling (8.991 ms) : 8851, 9131
. : milestone, 8991,
tracing (8.316 ms) : 8193, 8439
. : milestone, 8316,
section candidate
no_agent (4.195 ms) : 4146, 4245
. : milestone, 4195,
iast (10.001 ms) : 9832, 10169
. : milestone, 10001,
iast_FULL (14.046 ms) : 13758, 14335
. : milestone, 14046,
iast_GLOBAL (10.598 ms) : 10406, 10790
. : milestone, 10598,
profiling (9.22 ms) : 9064, 9377
. : milestone, 9220,
tracing (7.712 ms) : 7594, 7830
. : milestone, 7712,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (3.687 ms) : 3468, 3905
. : milestone, 3687,
iast (2.223 ms) : 2159, 2287
. : milestone, 2223,
iast_GLOBAL (2.247 ms) : 2182, 2311
. : milestone, 2247,
profiling (2.079 ms) : 2026, 2133
. : milestone, 2079,
tracing (2.034 ms) : 1984, 2084
. : milestone, 2034,
section candidate
no_agent (1.475 ms) : 1464, 1487
. : milestone, 1475,
appsec (3.73 ms) : 3511, 3949
. : milestone, 3730,
iast (2.209 ms) : 2146, 2273
. : milestone, 2209,
iast_GLOBAL (2.246 ms) : 2182, 2310
. : milestone, 2246,
profiling (2.044 ms) : 1993, 2095
. : milestone, 2044,
tracing (2.034 ms) : 1984, 2084
. : milestone, 2034,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.55.0-SNAPSHOT~94cab5d641, baseline=1.55.0-SNAPSHOT~24adc9a61e
dateFormat X
axisFormat %s
section baseline
no_agent (15.484 s) : 15484000, 15484000
. : milestone, 15484000,
appsec (15.064 s) : 15064000, 15064000
. : milestone, 15064000,
iast (18.444 s) : 18444000, 18444000
. : milestone, 18444000,
iast_GLOBAL (17.71 s) : 17710000, 17710000
. : milestone, 17710000,
profiling (15.279 s) : 15279000, 15279000
. : milestone, 15279000,
tracing (15.077 s) : 15077000, 15077000
. : milestone, 15077000,
section candidate
no_agent (15.033 s) : 15033000, 15033000
. : milestone, 15033000,
appsec (14.978 s) : 14978000, 14978000
. : milestone, 14978000,
iast (18.238 s) : 18238000, 18238000
. : milestone, 18238000,
iast_GLOBAL (17.965 s) : 17965000, 17965000
. : milestone, 17965000,
profiling (15.251 s) : 15251000, 15251000
. : milestone, 15251000,
tracing (15.206 s) : 15206000, 15206000
. : milestone, 15206000,
|
f852d0d
to
a46f9e5
Compare
this.localRootSpanTagsNeedIntercept = | ||
this.tagInterceptor.needsIntercept(this.localRootSpanTags); | ||
try { | ||
Class<?> cls = Class.forName("datadog.trace.agent.tooling.ServiceDiscoveryWriter"); |
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.
little hack to try out, I need to figure out the package dependency
a4c39f7
to
1bb3e54
Compare
d8eb447
to
65ffa65
Compare
dd-trace-core/src/main/java/datadog/trace/core/ServiceDiscovery.java
Outdated
Show resolved
Hide resolved
dd-trace-core/src/main/java/datadog/trace/core/ServiceDiscovery.java
Outdated
Show resolved
Hide resolved
@raphaelgavache iiuc GraalVM and Spring Native are not expected to work because of the way native libraries work with native image. So long as it won't crash or cause other adverse behavior in those scenarios, I think we're good |
Yes, Graal native image support is awhile off for any native library usage. |
public class ServiceDiscovery { | ||
private static final Logger log = LoggerFactory.getLogger(ServiceDiscovery.class); | ||
|
||
private static final byte[] SCHEMA_VERSION = "schema_version".getBytes(ISO_8859_1); |
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 this particular case, I'd rather not have the constants.
The problem is that they end up permanently consuming memory when we really only intend to use them once.
Admittedly, this is a weird case and it has got me thinking about whether we want to just unload the class, but that's on platform to figure out.
TracerVersion.TRACER_VERSION, | ||
config.getHostName(), | ||
config.getRuntimeId(), | ||
config.getServiceName(), |
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.
This is using the statically configured service name which isn't necessarily the service name that the tracer will use in the end. Are we okay with that?
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 might also want to consider moving this to a background task, so it doesn't impact start-up.
mapElements += (processTags != null && processTags.length() > 0) ? 1 : 0; | ||
mapElements += (containerID != null && !containerID.isEmpty()) ? 1 : 0; | ||
|
||
SimpleUtf8Cache encodingCache = new SimpleUtf8Cache(256); |
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.
I would skip the cache in this case.
Since the code is creating a new cache each time, the cache isn't providing a benefit here. And the cache is actually slower than just doing the encoding directly, the cache is only helpful if we're repeatedly allocating again and again.
And since this code is only called a handful of times, there's not much chance to save on allocation.
TODO
Test instructions
On system-tests
On a linux VM
Check file descriptors
Sleep is a sleep 50s java class for test purpose
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any useful labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]