-
Notifications
You must be signed in to change notification settings - Fork 312
Lazily obtain feature discovery when starting client metrics #9548
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
Conversation
🎯 Code Coverage 🔗 Commit SHA: 36b62dd | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 10 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061962
Total [baseline] (10.656 s) : 0, 10655604
Agent [candidate] (1.076 s) : 0, 1075769
Total [candidate] (10.731 s) : 0, 10730515
section appsec
Agent [baseline] (1.244 s) : 0, 1244088
Total [baseline] (11.008 s) : 0, 11008005
Agent [candidate] (1.242 s) : 0, 1242446
Total [candidate] (11.108 s) : 0, 11108135
section iast
Agent [baseline] (1.191 s) : 0, 1191285
Total [baseline] (11.055 s) : 0, 11055322
Agent [candidate] (1.197 s) : 0, 1196532
Total [candidate] (11.045 s) : 0, 11045288
section profiling
Agent [baseline] (1.211 s) : 0, 1211027
Total [baseline] (10.854 s) : 0, 10853787
Agent [candidate] (1.219 s) : 0, 1219156
Total [candidate] (11.006 s) : 0, 11005542
gantt
title petclinic - break down per module: candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.474 ms) : 0, 1474
crashtracking [candidate] (1.486 ms) : 0, 1486
BytebuddyAgent [baseline] (732.734 ms) : 0, 732734
BytebuddyAgent [candidate] (742.502 ms) : 0, 742502
GlobalTracer [baseline] (252.65 ms) : 0, 252650
GlobalTracer [candidate] (255.965 ms) : 0, 255965
AppSec [baseline] (30.705 ms) : 0, 30705
AppSec [candidate] (31.044 ms) : 0, 31044
Debugger [baseline] (6.391 ms) : 0, 6391
Debugger [candidate] (6.452 ms) : 0, 6452
Remote Config [baseline] (699.097 µs) : 0, 699
Remote Config [candidate] (699.107 µs) : 0, 699
Telemetry [baseline] (16.296 ms) : 0, 16296
Telemetry [candidate] (16.407 ms) : 0, 16407
section appsec
crashtracking [baseline] (1.466 ms) : 0, 1466
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (762.646 ms) : 0, 762646
BytebuddyAgent [candidate] (759.056 ms) : 0, 759056
GlobalTracer [baseline] (247.556 ms) : 0, 247556
GlobalTracer [candidate] (248.892 ms) : 0, 248892
AppSec [baseline] (171.805 ms) : 0, 171805
AppSec [candidate] (171.723 ms) : 0, 171723
Debugger [baseline] (5.981 ms) : 0, 5981
Debugger [candidate] (6.029 ms) : 0, 6029
Remote Config [baseline] (621.869 µs) : 0, 622
Remote Config [candidate] (644.153 µs) : 0, 644
Telemetry [baseline] (8.503 ms) : 0, 8503
Telemetry [candidate] (9.372 ms) : 0, 9372
IAST [baseline] (24.142 ms) : 0, 24142
IAST [candidate] (24.006 ms) : 0, 24006
section iast
crashtracking [baseline] (1.455 ms) : 0, 1455
crashtracking [candidate] (1.441 ms) : 0, 1441
BytebuddyAgent [baseline] (851.708 ms) : 0, 851708
BytebuddyAgent [candidate] (855.266 ms) : 0, 855266
GlobalTracer [baseline] (246.052 ms) : 0, 246052
GlobalTracer [candidate] (246.065 ms) : 0, 246065
AppSec [baseline] (25.815 ms) : 0, 25815
AppSec [candidate] (29.25 ms) : 0, 29250
Debugger [baseline] (6.163 ms) : 0, 6163
Debugger [candidate] (6.13 ms) : 0, 6130
Remote Config [baseline] (609.377 µs) : 0, 609
Remote Config [candidate] (597.983 µs) : 0, 598
Telemetry [baseline] (8.317 ms) : 0, 8317
Telemetry [candidate] (8.409 ms) : 0, 8409
IAST [baseline] (30.2 ms) : 0, 30200
IAST [candidate] (28.246 ms) : 0, 28246
section profiling
ProfilingAgent [baseline] (108.627 ms) : 0, 108627
ProfilingAgent [candidate] (109.883 ms) : 0, 109883
crashtracking [baseline] (1.443 ms) : 0, 1443
crashtracking [candidate] (1.446 ms) : 0, 1446
BytebuddyAgent [baseline] (761.846 ms) : 0, 761846
BytebuddyAgent [candidate] (767.105 ms) : 0, 767105
GlobalTracer [baseline] (233.241 ms) : 0, 233241
GlobalTracer [candidate] (235.08 ms) : 0, 235080
AppSec [baseline] (31.306 ms) : 0, 31306
AppSec [candidate] (30.388 ms) : 0, 30388
Debugger [baseline] (12.23 ms) : 0, 12230
Debugger [candidate] (14.528 ms) : 0, 14528
Remote Config [baseline] (733.615 µs) : 0, 734
Remote Config [candidate] (755.952 µs) : 0, 756
Telemetry [baseline] (10.291 ms) : 0, 10291
Telemetry [candidate] (8.638 ms) : 0, 8638
Profiling [baseline] (109.264 ms) : 0, 109264
Profiling [candidate] (110.525 ms) : 0, 110525
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.068 s) : 0, 1068250
Total [baseline] (8.685 s) : 0, 8685048
Agent [candidate] (1.064 s) : 0, 1063697
Total [candidate] (8.605 s) : 0, 8605388
section iast
Agent [baseline] (1.19 s) : 0, 1189864
Total [baseline] (9.25 s) : 0, 9249875
Agent [candidate] (1.19 s) : 0, 1190285
Total [candidate] (9.275 s) : 0, 9275188
gantt
title insecure-bank - break down per module: candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.469 ms) : 0, 1469
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (737.884 ms) : 0, 737884
BytebuddyAgent [candidate] (733.465 ms) : 0, 733465
GlobalTracer [baseline] (253.524 ms) : 0, 253524
GlobalTracer [candidate] (253.547 ms) : 0, 253547
AppSec [baseline] (30.808 ms) : 0, 30808
AppSec [candidate] (30.763 ms) : 0, 30763
Debugger [baseline] (6.489 ms) : 0, 6489
Debugger [candidate] (6.395 ms) : 0, 6395
Remote Config [baseline] (705.398 µs) : 0, 705
Remote Config [candidate] (700.248 µs) : 0, 700
Telemetry [baseline] (16.31 ms) : 0, 16310
Telemetry [candidate] (16.407 ms) : 0, 16407
section iast
crashtracking [baseline] (1.457 ms) : 0, 1457
crashtracking [candidate] (1.465 ms) : 0, 1465
BytebuddyAgent [baseline] (852.031 ms) : 0, 852031
BytebuddyAgent [candidate] (852.363 ms) : 0, 852363
GlobalTracer [baseline] (244.766 ms) : 0, 244766
GlobalTracer [candidate] (248.488 ms) : 0, 248488
AppSec [baseline] (27.037 ms) : 0, 27037
AppSec [candidate] (25.382 ms) : 0, 25382
Debugger [baseline] (6.019 ms) : 0, 6019
Debugger [candidate] (6.009 ms) : 0, 6009
Remote Config [baseline] (598.521 µs) : 0, 599
Remote Config [candidate] (603.729 µs) : 0, 604
Telemetry [baseline] (8.19 ms) : 0, 8190
Telemetry [candidate] (8.205 ms) : 0, 8205
IAST [baseline] (28.874 ms) : 0, 28874
IAST [candidate] (26.886 ms) : 0, 26886
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 1 performance regressions! Performance is the same for 9 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (4.384 ms) : 4332, 4436
. : milestone, 4384,
iast (9.741 ms) : 9580, 9903
. : milestone, 9741,
iast_FULL (14.336 ms) : 14046, 14626
. : milestone, 14336,
iast_GLOBAL (10.629 ms) : 10441, 10816
. : milestone, 10629,
profiling (8.815 ms) : 8681, 8948
. : milestone, 8815,
tracing (7.718 ms) : 7600, 7836
. : milestone, 7718,
section candidate
no_agent (4.326 ms) : 4276, 4376
. : milestone, 4326,
iast (9.381 ms) : 9226, 9536
. : milestone, 9381,
iast_FULL (14.558 ms) : 14270, 14846
. : milestone, 14558,
iast_GLOBAL (10.391 ms) : 10208, 10574
. : milestone, 10391,
profiling (9.071 ms) : 8928, 9214
. : milestone, 9071,
tracing (7.856 ms) : 7736, 7977
. : milestone, 7856,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (38.119 ms) : 37815, 38424
. : milestone, 38119,
appsec (49.181 ms) : 48754, 49608
. : milestone, 49181,
code_origins (46.294 ms) : 45881, 46707
. : milestone, 46294,
iast (44.282 ms) : 43891, 44674
. : milestone, 44282,
profiling (49.305 ms) : 48825, 49786
. : milestone, 49305,
tracing (43.874 ms) : 43487, 44262
. : milestone, 43874,
section candidate
no_agent (35.548 ms) : 35265, 35832
. : milestone, 35548,
appsec (47.395 ms) : 46973, 47817
. : milestone, 47395,
code_origins (46.696 ms) : 46292, 47100
. : milestone, 46696,
iast (45.966 ms) : 45585, 46347
. : milestone, 45966,
profiling (49.657 ms) : 49223, 50092
. : milestone, 49657,
tracing (44.915 ms) : 44527, 45303
. : milestone, 44915,
DacapoParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 0 unstable metrics.
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (1.486 ms) : 1474, 1497
. : milestone, 1486,
appsec (3.758 ms) : 3540, 3977
. : milestone, 3758,
iast (2.211 ms) : 2148, 2273
. : milestone, 2211,
iast_GLOBAL (2.25 ms) : 2187, 2313
. : milestone, 2250,
profiling (2.082 ms) : 2030, 2135
. : milestone, 2082,
tracing (2.043 ms) : 1994, 2093
. : milestone, 2043,
section candidate
no_agent (1.484 ms) : 1472, 1495
. : milestone, 1484,
appsec (2.523 ms) : 2469, 2576
. : milestone, 2523,
iast (2.207 ms) : 2145, 2270
. : milestone, 2207,
iast_GLOBAL (2.254 ms) : 2191, 2317
. : milestone, 2254,
profiling (2.053 ms) : 2002, 2103
. : milestone, 2053,
tracing (2.028 ms) : 1978, 2077
. : milestone, 2028,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.54.0-SNAPSHOT~36b62dd6a7, baseline=1.54.0-SNAPSHOT~1052f4935d
dateFormat X
axisFormat %s
section baseline
no_agent (14.76 s) : 14760000, 14760000
. : milestone, 14760000,
appsec (15.082 s) : 15082000, 15082000
. : milestone, 15082000,
iast (18.466 s) : 18466000, 18466000
. : milestone, 18466000,
iast_GLOBAL (17.807 s) : 17807000, 17807000
. : milestone, 17807000,
profiling (16.024 s) : 16024000, 16024000
. : milestone, 16024000,
tracing (14.832 s) : 14832000, 14832000
. : milestone, 14832000,
section candidate
no_agent (14.972 s) : 14972000, 14972000
. : milestone, 14972000,
appsec (14.883 s) : 14883000, 14883000
. : milestone, 14883000,
iast (18.542 s) : 18542000, 18542000
. : milestone, 18542000,
iast_GLOBAL (18.432 s) : 18432000, 18432000
. : milestone, 18432000,
profiling (15.263 s) : 15263000, 15263000
. : milestone, 15263000,
tracing (15.04 s) : 15040000, 15040000
. : milestone, 15040000,
|
83c6846
to
eff49c7
Compare
ae02fdb
to
09fd601
Compare
dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
private boolean publish(CoreSpan<?> span, boolean isTopLevel) { | ||
private boolean publish(CoreSpan<?> span, boolean isTopLevel, DDAgentFeaturesDiscovery features) { |
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 changed signatures to avoid accessing that volatile things multiple time when a single trace is published
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.
Pre-approving, some suggestions though
dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java
Show resolved
Hide resolved
dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java
Outdated
Show resolved
Hide resolved
dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java
Outdated
Show resolved
Hide resolved
dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java
Outdated
Show resolved
Hide resolved
09fd601
to
8eb7096
Compare
8eb7096
to
36b62dd
Compare
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.
Thanks for this improvement
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 good. Thanks for the fix
What Does This Do
Calling
SharedCommunicationObjects.featureDiscovery
forces a immediate call to the agent that causes I/O and premature initialisation of okhttp. This is hence causing I/O.The agent is usually waiting for custom log manager / jmx initialisation before doing that but the client metrics aggregator escaped somehow to this logic
Also because of that, we notice an increased startup time in benchmarks that looks related to that I/O
Additionally the benchmark runs the application and the agent at same time and this can cause a downgrade to be detected and another forced info to be called.
This PR fixes that behaviour obtaining the feature discovery lazily. Also the discovery upon stats 404 is done asynchronously since there is no need to block for it.
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: [PROJ-IDENT]