-
Notifications
You must be signed in to change notification settings - Fork 293
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
Allow use of span as a primordial context #8250
Conversation
d863876
to
332d71c
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 61 metrics, 2 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055336
Total [baseline] (8.658 s) : 0, 8657876
Agent [candidate] (1.056 s) : 0, 1055946
Total [candidate] (8.646 s) : 0, 8646047
section iast
Agent [baseline] (1.182 s) : 0, 1182355
Total [baseline] (9.193 s) : 0, 9192686
Agent [candidate] (1.191 s) : 0, 1191489
Total [candidate] (9.215 s) : 0, 9214651
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.183 s) : 0, 1182699
Total [baseline] (9.179 s) : 0, 9178866
Agent [candidate] (1.191 s) : 0, 1191370
Total [candidate] (9.248 s) : 0, 9247629
section iast_TELEMETRY_OFF
Agent [baseline] (1.175 s) : 0, 1174705
Total [baseline] (9.168 s) : 0, 9168434
Agent [candidate] (1.177 s) : 0, 1177001
Total [candidate] (9.23 s) : 0, 9229869
gantt
title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (712.836 ms) : 0, 712836
BytebuddyAgent [candidate] (713.923 ms) : 0, 713923
GlobalTracer [baseline] (255.539 ms) : 0, 255539
GlobalTracer [candidate] (255.789 ms) : 0, 255789
AppSec [baseline] (55.532 ms) : 0, 55532
AppSec [candidate] (55.516 ms) : 0, 55516
Remote Config [baseline] (735.749 µs) : 0, 736
Remote Config [candidate] (752.728 µs) : 0, 753
Telemetry [baseline] (15.786 ms) : 0, 15786
Telemetry [candidate] (14.933 ms) : 0, 14933
section iast
BytebuddyAgent [baseline] (831.706 ms) : 0, 831706
BytebuddyAgent [candidate] (837.854 ms) : 0, 837854
GlobalTracer [baseline] (246.364 ms) : 0, 246364
GlobalTracer [candidate] (247.979 ms) : 0, 247979
AppSec [baseline] (58.172 ms) : 0, 58172
AppSec [candidate] (58.935 ms) : 0, 58935
IAST [baseline] (21.585 ms) : 0, 21585
IAST [candidate] (21.832 ms) : 0, 21832
Remote Config [baseline] (679.167 µs) : 0, 679
Remote Config [candidate] (691.881 µs) : 0, 692
Telemetry [baseline] (8.827 ms) : 0, 8827
Telemetry [candidate] (8.939 ms) : 0, 8939
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (831.671 ms) : 0, 831671
BytebuddyAgent [candidate] (837.873 ms) : 0, 837873
GlobalTracer [baseline] (246.896 ms) : 0, 246896
GlobalTracer [candidate] (248.266 ms) : 0, 248266
AppSec [baseline] (58.111 ms) : 0, 58111
AppSec [candidate] (58.644 ms) : 0, 58644
IAST [baseline] (21.443 ms) : 0, 21443
IAST [candidate] (21.783 ms) : 0, 21783
Remote Config [baseline] (679.205 µs) : 0, 679
Remote Config [candidate] (678.714 µs) : 0, 679
Telemetry [baseline] (8.907 ms) : 0, 8907
Telemetry [candidate] (8.925 ms) : 0, 8925
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (825.958 ms) : 0, 825958
BytebuddyAgent [candidate] (827.41 ms) : 0, 827410
GlobalTracer [baseline] (245.621 ms) : 0, 245621
GlobalTracer [candidate] (246.434 ms) : 0, 246434
AppSec [baseline] (57.707 ms) : 0, 57707
AppSec [candidate] (57.817 ms) : 0, 57817
IAST [baseline] (21.12 ms) : 0, 21120
IAST [candidate] (21.058 ms) : 0, 21058
Remote Config [baseline] (662.577 µs) : 0, 663
Remote Config [candidate] (680.866 µs) : 0, 681
Telemetry [baseline] (8.655 ms) : 0, 8655
Telemetry [candidate] (8.598 ms) : 0, 8598
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.05 s) : 0, 1050287
Total [baseline] (10.455 s) : 0, 10455316
Agent [candidate] (1.054 s) : 0, 1053794
Total [candidate] (10.557 s) : 0, 10556727
section appsec
Agent [baseline] (1.192 s) : 0, 1191939
Total [baseline] (10.696 s) : 0, 10696114
Agent [candidate] (1.188 s) : 0, 1188449
Total [candidate] (10.762 s) : 0, 10762263
section iast
Agent [baseline] (1.184 s) : 0, 1184044
Total [baseline] (11.131 s) : 0, 11130633
Agent [candidate] (1.183 s) : 0, 1183139
Total [candidate] (10.969 s) : 0, 10969121
section profiling
Agent [baseline] (1.253 s) : 0, 1252595
Total [baseline] (10.807 s) : 0, 10807189
Agent [candidate] (1.255 s) : 0, 1255134
Total [candidate] (10.81 s) : 0, 10809787
gantt
title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (711.318 ms) : 0, 711318
BytebuddyAgent [candidate] (713.305 ms) : 0, 713305
GlobalTracer [baseline] (254.392 ms) : 0, 254392
GlobalTracer [candidate] (254.95 ms) : 0, 254950
AppSec [baseline] (56.172 ms) : 0, 56172
AppSec [candidate] (56.34 ms) : 0, 56340
Remote Config [baseline] (723.495 µs) : 0, 723
Remote Config [candidate] (739.282 µs) : 0, 739
Telemetry [baseline] (12.778 ms) : 0, 12778
Telemetry [candidate] (13.517 ms) : 0, 13517
section appsec
BytebuddyAgent [baseline] (732.737 ms) : 0, 732737
BytebuddyAgent [candidate] (730.736 ms) : 0, 730736
GlobalTracer [baseline] (254.355 ms) : 0, 254355
GlobalTracer [candidate] (252.856 ms) : 0, 252856
AppSec [baseline] (171.193 ms) : 0, 171193
AppSec [candidate] (171.352 ms) : 0, 171352
IAST [baseline] (19.338 ms) : 0, 19338
IAST [candidate] (19.327 ms) : 0, 19327
Remote Config [baseline] (663.327 µs) : 0, 663
Remote Config [candidate] (666.956 µs) : 0, 667
Telemetry [baseline] (8.235 ms) : 0, 8235
Telemetry [candidate] (8.176 ms) : 0, 8176
section iast
BytebuddyAgent [baseline] (831.478 ms) : 0, 831478
BytebuddyAgent [candidate] (831.734 ms) : 0, 831734
GlobalTracer [baseline] (247.799 ms) : 0, 247799
GlobalTracer [candidate] (246.928 ms) : 0, 246928
AppSec [baseline] (58.613 ms) : 0, 58613
AppSec [candidate] (58.325 ms) : 0, 58325
IAST [baseline] (21.58 ms) : 0, 21580
IAST [candidate] (21.519 ms) : 0, 21519
Remote Config [baseline] (698.995 µs) : 0, 699
Remote Config [candidate] (662.571 µs) : 0, 663
Telemetry [baseline] (8.912 ms) : 0, 8912
Telemetry [candidate] (8.89 ms) : 0, 8890
section profiling
BytebuddyAgent [baseline] (702.431 ms) : 0, 702431
BytebuddyAgent [candidate] (703.616 ms) : 0, 703616
GlobalTracer [baseline] (348.176 ms) : 0, 348176
GlobalTracer [candidate] (350.381 ms) : 0, 350381
AppSec [baseline] (54.889 ms) : 0, 54889
AppSec [candidate] (53.977 ms) : 0, 53977
Remote Config [baseline] (719.302 µs) : 0, 719
Remote Config [candidate] (716.888 µs) : 0, 717
Telemetry [baseline] (8.72 ms) : 0, 8720
Telemetry [candidate] (8.792 ms) : 0, 8792
ProfilingAgent [baseline] (95.764 ms) : 0, 95764
ProfilingAgent [candidate] (95.638 ms) : 0, 95638
Profiling [baseline] (95.788 ms) : 0, 95788
Profiling [candidate] (95.663 ms) : 0, 95663
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 13 metrics, 15 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section baseline
no_agent (1.359 ms) : 1339, 1378
. : milestone, 1359,
appsec (1.772 ms) : 1748, 1796
. : milestone, 1772,
appsec_no_iast (1.776 ms) : 1753, 1799
. : milestone, 1776,
iast (1.527 ms) : 1504, 1551
. : milestone, 1527,
profiling (1.56 ms) : 1536, 1585
. : milestone, 1560,
tracing (1.488 ms) : 1462, 1513
. : milestone, 1488,
section candidate
no_agent (1.355 ms) : 1336, 1374
. : milestone, 1355,
appsec (1.757 ms) : 1734, 1781
. : milestone, 1757,
appsec_no_iast (1.751 ms) : 1727, 1774
. : milestone, 1751,
iast (1.514 ms) : 1490, 1538
. : milestone, 1514,
profiling (1.518 ms) : 1495, 1541
. : milestone, 1518,
tracing (1.488 ms) : 1464, 1512
. : milestone, 1488,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section baseline
no_agent (374.806 µs) : 354, 395
. : milestone, 375,
iast (514.094 µs) : 492, 536
. : milestone, 514,
iast_FULL (736.859 µs) : 715, 759
. : milestone, 737,
iast_GLOBAL (565.271 µs) : 542, 589
. : milestone, 565,
iast_HARDCODED_SECRET_DISABLED (513.997 µs) : 492, 536
. : milestone, 514,
iast_INACTIVE (457.363 µs) : 436, 478
. : milestone, 457,
iast_TELEMETRY_OFF (495.005 µs) : 473, 517
. : milestone, 495,
tracing (453.101 µs) : 432, 474
. : milestone, 453,
section candidate
no_agent (379.415 µs) : 360, 399
. : milestone, 379,
iast (508.955 µs) : 487, 531
. : milestone, 509,
iast_FULL (745.054 µs) : 723, 767
. : milestone, 745,
iast_GLOBAL (560.85 µs) : 538, 583
. : milestone, 561,
iast_HARDCODED_SECRET_DISABLED (506.453 µs) : 485, 528
. : milestone, 506,
iast_INACTIVE (455.94 µs) : 435, 477
. : milestone, 456,
iast_TELEMETRY_OFF (498.347 µs) : 476, 520
. : milestone, 498,
tracing (450.964 µs) : 430, 472
. : milestone, 451,
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.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section baseline
no_agent (14.743 s) : 14743000, 14743000
. : milestone, 14743000,
appsec (14.968 s) : 14968000, 14968000
. : milestone, 14968000,
iast (18.516 s) : 18516000, 18516000
. : milestone, 18516000,
iast_GLOBAL (18.068 s) : 18068000, 18068000
. : milestone, 18068000,
profiling (15.157 s) : 15157000, 15157000
. : milestone, 15157000,
tracing (14.915 s) : 14915000, 14915000
. : milestone, 14915000,
section candidate
no_agent (15.275 s) : 15275000, 15275000
. : milestone, 15275000,
appsec (15.04 s) : 15040000, 15040000
. : milestone, 15040000,
iast (18.966 s) : 18966000, 18966000
. : milestone, 18966000,
iast_GLOBAL (18.375 s) : 18375000, 18375000
. : milestone, 18375000,
profiling (15.748 s) : 15748000, 15748000
. : milestone, 15748000,
tracing (15.147 s) : 15147000, 15147000
. : milestone, 15147000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~ab3688699d, baseline=1.46.0-SNAPSHOT~1f71dbd1b1
dateFormat X
axisFormat %s
section baseline
no_agent (1.469 ms) : 1458, 1481
. : milestone, 1469,
appsec (2.363 ms) : 2320, 2406
. : milestone, 2363,
iast (2.104 ms) : 2050, 2158
. : milestone, 2104,
iast_GLOBAL (2.139 ms) : 2085, 2193
. : milestone, 2139,
profiling (1.968 ms) : 1925, 2011
. : milestone, 1968,
tracing (1.936 ms) : 1895, 1978
. : milestone, 1936,
section candidate
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (2.359 ms) : 2316, 2402
. : milestone, 2359,
iast (2.103 ms) : 2049, 2157
. : milestone, 2103,
iast_GLOBAL (2.15 ms) : 2095, 2205
. : milestone, 2150,
profiling (1.984 ms) : 1940, 2028
. : milestone, 1984,
tracing (1.942 ms) : 1900, 1983
. : milestone, 1942,
|
732527a
to
08762f9
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.
About the Context.with(key1, value1, key2, value2)
, how is it supposed to be used?
The keys are not supposed to be exposed, and context objects are supposed to be big enough be independent / not related.
For example with span and baggage, I would expect:
- to have their keys hidden into the
ImplicitContextKeyed
implementations - baggage to move out of the span quite soon as part of context improvement / baggage support so there won't be a place with both span and baggage at the same time to create a context in one call.
In general, what would be the benefit of this dedicated method? Avoid the instantiation of a SingletonContext
instance from the root context to a two element context? And where should the specific optimized implementation would go?
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/InternalContextKeys.java
Show resolved
Hide resolved
It's used by It lets the tracer supply an optimized route for that code-path which is not possible using
Yes because that's going to be a heavily used code-path which deserves special attention. Here's the flow:
This functionality is already covered by When we write the tracing implementation of |
edc420a
to
2758d2c
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.
Looks good to me 👍 Thanks for the clarification.
It might seems like early optimisations while not all the pieces are present but we can still do benchmark and refine later!
2758d2c
to
4dae677
Compare
…ries at the same time (such as adding span plus baggage)
4dae677
to
ab36886
Compare
What Does This Do
Supports using implementations of
AgentSpan
asContext
.Motivation
Helps migration of tracing towards the context-based approach.
Additional Notes
A convenience method was added to
Context
that accepts a pair of key-value mappings. This lets custom root context implementations skip creation of the interim context when adding two entries at the same time, for example a span and a baggage holder. We do not expect to require further variants of this method, but this particular case is worth adding to reduce copying when inflating spans into full contexts.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: APMAPI-959