-
Notifications
You must be signed in to change notification settings - Fork 319
Add primitive setters to DDSpanContext to take advantage of TagMap #10018
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
Previous static extraction caused a test to fail because links logic relied on having a side effect on the builder instance's List<AgentSpanLink>
Adding primitive setters to DDSpanContext to take advantage of TagMap primitive storage Using precheck of tagInterceptor.needsIntercept to avoid boxing while calling tagInterceptor.interceptTag
|
🎯 Code Coverage 🔗 Commit SHA: 4ce3220 | 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 57 metrics, 8 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.105 s) : 0, 1105146
Total [baseline] (10.82 s) : 0, 10819788
Agent [candidate] (1.107 s) : 0, 1106893
Total [candidate] (10.843 s) : 0, 10842626
section appsec
Agent [baseline] (1.283 s) : 0, 1282889
Total [baseline] (11.048 s) : 0, 11047612
Agent [candidate] (1.289 s) : 0, 1288598
Total [candidate] (11.245 s) : 0, 11245019
section iast
Agent [baseline] (1.238 s) : 0, 1238320
Total [baseline] (10.044 s) : 0, 10044373
Agent [candidate] (1.247 s) : 0, 1247134
Total [candidate] (11.3 s) : 0, 11299860
section profiling
Agent [baseline] (1.231 s) : 0, 1231048
Total [baseline] (11.045 s) : 0, 11045098
Agent [candidate] (1.237 s) : 0, 1237461
Total [candidate] (11.192 s) : 0, 11192028
gantt
title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.457 ms) : 0, 1457
crashtracking [candidate] (1.468 ms) : 0, 1468
BytebuddyAgent [baseline] (710.018 ms) : 0, 710018
BytebuddyAgent [candidate] (711.002 ms) : 0, 711002
GlobalTracer [baseline] (249.251 ms) : 0, 249251
GlobalTracer [candidate] (250.095 ms) : 0, 250095
AppSec [baseline] (32.502 ms) : 0, 32502
AppSec [candidate] (32.436 ms) : 0, 32436
Debugger [baseline] (64.455 ms) : 0, 64455
Debugger [candidate] (64.347 ms) : 0, 64347
Remote Config [baseline] (650.102 µs) : 0, 650
Remote Config [candidate] (633.121 µs) : 0, 633
Telemetry [baseline] (8.179 ms) : 0, 8179
Telemetry [candidate] (8.208 ms) : 0, 8208
Flare Poller [baseline] (3.65 ms) : 0, 3650
Flare Poller [candidate] (3.685 ms) : 0, 3685
section appsec
crashtracking [baseline] (1.45 ms) : 0, 1450
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (732.18 ms) : 0, 732180
BytebuddyAgent [candidate] (733.302 ms) : 0, 733302
GlobalTracer [baseline] (241.355 ms) : 0, 241355
GlobalTracer [candidate] (243.296 ms) : 0, 243296
AppSec [baseline] (174.338 ms) : 0, 174338
AppSec [candidate] (175.426 ms) : 0, 175426
Debugger [baseline] (60.802 ms) : 0, 60802
Debugger [candidate] (61.706 ms) : 0, 61706
Remote Config [baseline] (660.442 µs) : 0, 660
Remote Config [candidate] (677.591 µs) : 0, 678
Telemetry [baseline] (8.283 ms) : 0, 8283
Telemetry [candidate] (8.41 ms) : 0, 8410
Flare Poller [baseline] (3.882 ms) : 0, 3882
Flare Poller [candidate] (3.878 ms) : 0, 3878
IAST [baseline] (24.913 ms) : 0, 24913
IAST [candidate] (25.227 ms) : 0, 25227
section iast
crashtracking [baseline] (1.451 ms) : 0, 1451
crashtracking [candidate] (1.468 ms) : 0, 1468
BytebuddyAgent [baseline] (829.724 ms) : 0, 829724
BytebuddyAgent [candidate] (834.638 ms) : 0, 834638
GlobalTracer [baseline] (238.214 ms) : 0, 238214
GlobalTracer [candidate] (239.972 ms) : 0, 239972
AppSec [baseline] (31.905 ms) : 0, 31905
AppSec [candidate] (30.791 ms) : 0, 30791
Debugger [baseline] (60.996 ms) : 0, 60996
Debugger [candidate] (61.755 ms) : 0, 61755
Remote Config [baseline] (546.163 µs) : 0, 546
Remote Config [candidate] (555.81 µs) : 0, 556
Telemetry [baseline] (7.655 ms) : 0, 7655
Telemetry [candidate] (7.803 ms) : 0, 7803
Flare Poller [baseline] (3.456 ms) : 0, 3456
Flare Poller [candidate] (3.606 ms) : 0, 3606
IAST [baseline] (29.525 ms) : 0, 29525
IAST [candidate] (31.452 ms) : 0, 31452
section profiling
crashtracking [baseline] (1.43 ms) : 0, 1430
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (732.006 ms) : 0, 732006
BytebuddyAgent [candidate] (735.332 ms) : 0, 735332
GlobalTracer [baseline] (222.237 ms) : 0, 222237
GlobalTracer [candidate] (223.899 ms) : 0, 223899
AppSec [baseline] (32.355 ms) : 0, 32355
AppSec [candidate] (32.446 ms) : 0, 32446
Debugger [baseline] (63.722 ms) : 0, 63722
Debugger [candidate] (63.345 ms) : 0, 63345
Remote Config [baseline] (672.957 µs) : 0, 673
Remote Config [candidate] (666.326 µs) : 0, 666
Telemetry [baseline] (7.862 ms) : 0, 7862
Telemetry [candidate] (8.109 ms) : 0, 8109
Flare Poller [baseline] (3.752 ms) : 0, 3752
Flare Poller [candidate] (3.779 ms) : 0, 3779
ProfilingAgent [baseline] (97.258 ms) : 0, 97258
ProfilingAgent [candidate] (98.297 ms) : 0, 98297
Profiling [baseline] (97.851 ms) : 0, 97851
Profiling [candidate] (98.903 ms) : 0, 98903
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.103 s) : 0, 1103208
Total [baseline] (8.849 s) : 0, 8848797
Agent [candidate] (1.107 s) : 0, 1106632
Total [candidate] (8.895 s) : 0, 8894812
section iast
Agent [baseline] (1.241 s) : 0, 1240551
Total [baseline] (9.555 s) : 0, 9555399
Agent [candidate] (1.252 s) : 0, 1251919
Total [candidate] (9.606 s) : 0, 9606401
gantt
title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.466 ms) : 0, 1466
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (708.983 ms) : 0, 708983
BytebuddyAgent [candidate] (710.779 ms) : 0, 710779
GlobalTracer [baseline] (249.113 ms) : 0, 249113
GlobalTracer [candidate] (250.443 ms) : 0, 250443
AppSec [baseline] (32.598 ms) : 0, 32598
AppSec [candidate] (32.6 ms) : 0, 32600
Debugger [baseline] (63.527 ms) : 0, 63527
Debugger [candidate] (63.776 ms) : 0, 63776
Remote Config [baseline] (637.136 µs) : 0, 637
Remote Config [candidate] (640.347 µs) : 0, 640
Telemetry [baseline] (8.258 ms) : 0, 8258
Telemetry [candidate] (8.196 ms) : 0, 8196
Flare Poller [baseline] (3.645 ms) : 0, 3645
Flare Poller [candidate] (3.684 ms) : 0, 3684
section iast
crashtracking [baseline] (1.455 ms) : 0, 1455
crashtracking [candidate] (1.482 ms) : 0, 1482
BytebuddyAgent [baseline] (832.149 ms) : 0, 832149
BytebuddyAgent [candidate] (839.329 ms) : 0, 839329
GlobalTracer [baseline] (238.521 ms) : 0, 238521
GlobalTracer [candidate] (240.458 ms) : 0, 240458
AppSec [baseline] (33.932 ms) : 0, 33932
AppSec [candidate] (34.325 ms) : 0, 34325
Debugger [baseline] (60.231 ms) : 0, 60231
Debugger [candidate] (61.029 ms) : 0, 61029
Remote Config [baseline] (547.594 µs) : 0, 548
Remote Config [candidate] (547.39 µs) : 0, 547
Telemetry [baseline] (7.664 ms) : 0, 7664
Telemetry [candidate] (7.762 ms) : 0, 7762
Flare Poller [baseline] (3.489 ms) : 0, 3489
Flare Poller [candidate] (3.538 ms) : 0, 3538
IAST [baseline] (27.683 ms) : 0, 27683
IAST [candidate] (28.13 ms) : 0, 28130
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 3 performance regressions! Performance is the same for 15 metrics, 18 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (18.03 ms) : 17842, 18218
. : milestone, 18030,
appsec (18.547 ms) : 18358, 18736
. : milestone, 18547,
code_origins (17.926 ms) : 17747, 18105
. : milestone, 17926,
iast (17.662 ms) : 17485, 17839
. : milestone, 17662,
profiling (18.518 ms) : 18332, 18703
. : milestone, 18518,
tracing (17.514 ms) : 17337, 17690
. : milestone, 17514,
section candidate
no_agent (18.239 ms) : 18054, 18424
. : milestone, 18239,
appsec (18.442 ms) : 18257, 18627
. : milestone, 18442,
code_origins (17.899 ms) : 17721, 18078
. : milestone, 17899,
iast (17.676 ms) : 17501, 17851
. : milestone, 17676,
profiling (19.669 ms) : 19474, 19864
. : milestone, 19669,
tracing (17.627 ms) : 17453, 17801
. : milestone, 17627,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (1.195 ms) : 1183, 1207
. : milestone, 1195,
iast (3.347 ms) : 3297, 3398
. : milestone, 3347,
iast_FULL (5.632 ms) : 5577, 5688
. : milestone, 5632,
iast_GLOBAL (3.868 ms) : 3745, 3990
. : milestone, 3868,
profiling (2.072 ms) : 2054, 2090
. : milestone, 2072,
tracing (1.799 ms) : 1785, 1814
. : milestone, 1799,
section candidate
no_agent (1.203 ms) : 1191, 1214
. : milestone, 1203,
iast (3.277 ms) : 3232, 3323
. : milestone, 3277,
iast_FULL (6.067 ms) : 6005, 6129
. : milestone, 6067,
iast_GLOBAL (3.749 ms) : 3695, 3804
. : milestone, 3749,
profiling (2.009 ms) : 1991, 2026
. : milestone, 2009,
tracing (1.824 ms) : 1809, 1839
. : milestone, 1824,
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~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (15.625 s) : 15625000, 15625000
. : milestone, 15625000,
appsec (14.777 s) : 14777000, 14777000
. : milestone, 14777000,
iast (18.961 s) : 18961000, 18961000
. : milestone, 18961000,
iast_GLOBAL (17.72 s) : 17720000, 17720000
. : milestone, 17720000,
profiling (14.824 s) : 14824000, 14824000
. : milestone, 14824000,
tracing (14.771 s) : 14771000, 14771000
. : milestone, 14771000,
section candidate
no_agent (14.776 s) : 14776000, 14776000
. : milestone, 14776000,
appsec (14.854 s) : 14854000, 14854000
. : milestone, 14854000,
iast (18.486 s) : 18486000, 18486000
. : milestone, 18486000,
iast_GLOBAL (18.145 s) : 18145000, 18145000
. : milestone, 18145000,
profiling (14.956 s) : 14956000, 14956000
. : milestone, 14956000,
tracing (14.557 s) : 14557000, 14557000
. : milestone, 14557000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~4ce3220d9c, baseline=1.56.0-SNAPSHOT~b6d4e4fc4a
dateFormat X
axisFormat %s
section baseline
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.676 ms) : 3458, 3894
. : milestone, 3676,
iast (2.199 ms) : 2135, 2262
. : milestone, 2199,
iast_GLOBAL (2.242 ms) : 2179, 2305
. : milestone, 2242,
profiling (2.062 ms) : 2010, 2114
. : milestone, 2062,
tracing (2.015 ms) : 1965, 2064
. : milestone, 2015,
section candidate
no_agent (1.476 ms) : 1464, 1487
. : milestone, 1476,
appsec (3.689 ms) : 3467, 3911
. : milestone, 3689,
iast (2.195 ms) : 2132, 2258
. : milestone, 2195,
iast_GLOBAL (2.235 ms) : 2172, 2298
. : milestone, 2235,
profiling (2.045 ms) : 1995, 2096
. : milestone, 2045,
tracing (2.02 ms) : 1970, 2069
. : milestone, 2020,
|
To simplify the code, I pulled CoreTracer.getTagInterceptor() into a member variable of DDSpanContext Unfortunately, that caused Mock call checks to fail, so needed to update the PendingTraceBufferTest
| } | ||
| } | ||
|
|
||
| public void setTag(final String tag, final float value) { |
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.
DDSpan doesn't seem to have a specialized setTag for float. We should either add one or remove it here and rely on Java's widening conversion from float to double.
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.
Agreed, I'll do that
ygree
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.
Looks good!
What Does This Do
Adds primitive setters to DDSpanContext
Motivation
TagMap can store primitive in its entries directly without boxing
But to take advantage of TagMap, we need to avoid auto-boxing in instrumentation, DDSpan, DDSpanContext
DDSpan already had primitive setters, but those call into DDSpanContext which didn't have primitive setters
Additional Notes
This code has been structured to behave optimally for both LegacyTagMap (e.g. HashMap) which boxes and OptimizedTagMap which avoids boxing
Right now, the tracer will still end up boxing in the serialization code, but this change at least moves the boxing out of the instrumentation / application critical path. Boxing during serialization will be addressed in a separate pull request.
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]