-
Notifications
You must be signed in to change notification settings - Fork 322
Refactor multiple implementations of W3C trace context building into a dedicated helper #10261
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
…a dedicated helper
287ce40 to
0dc5a8c
Compare
mhlidd
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.
❓ IMO this class makes more sense to belong in dd-trace-core/src/main/java/datadog/trace/core/util since it's a helper only meant to be used internally and not by customers.
Thanks for the refactor! Looks great!
dd-trace-api/src/main/java/datadog/trace/api/W3CTraceParent.java
Outdated
Show resolved
Hide resolved
PerfectSlayer
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.
💭 thought: I will have a proper review later but I don’t think the public API is the right package.
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 7 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.101 s) : 0, 1100749
Total [baseline] (10.829 s) : 0, 10828632
Agent [candidate] (1.093 s) : 0, 1093493
Total [candidate] (10.977 s) : 0, 10977443
section appsec
Agent [baseline] (1.275 s) : 0, 1274792
Total [baseline] (10.884 s) : 0, 10884246
Agent [candidate] (1.266 s) : 0, 1266244
Total [candidate] (11.016 s) : 0, 11015595
section iast
Agent [baseline] (1.223 s) : 0, 1222799
Total [baseline] (11.124 s) : 0, 11123974
Agent [candidate] (1.234 s) : 0, 1234002
Total [candidate] (11.188 s) : 0, 11188106
section profiling
Agent [baseline] (1.206 s) : 0, 1206172
Total [baseline] (10.88 s) : 0, 10880094
Agent [candidate] (1.205 s) : 0, 1205309
Total [candidate] (10.865 s) : 0, 10864698
gantt
title petclinic - break down per module: candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.213 ms) : 0, 1213
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (661.493 ms) : 0, 661493
BytebuddyAgent [candidate] (656.751 ms) : 0, 656751
GlobalTracer [baseline] (286.554 ms) : 0, 286554
GlobalTracer [candidate] (284.613 ms) : 0, 284613
AppSec [baseline] (33.091 ms) : 0, 33091
AppSec [candidate] (33.204 ms) : 0, 33204
Debugger [baseline] (69.185 ms) : 0, 69185
Debugger [candidate] (68.555 ms) : 0, 68555
Remote Config [baseline] (617.924 µs) : 0, 618
Remote Config [candidate] (623.201 µs) : 0, 623
Telemetry [baseline] (9.033 ms) : 0, 9033
Telemetry [candidate] (9.149 ms) : 0, 9149
Flare Poller [baseline] (3.798 ms) : 0, 3798
Flare Poller [candidate] (3.829 ms) : 0, 3829
section appsec
crashtracking [baseline] (1.225 ms) : 0, 1225
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (697.44 ms) : 0, 697440
BytebuddyAgent [candidate] (691.378 ms) : 0, 691378
GlobalTracer [baseline] (259.455 ms) : 0, 259455
GlobalTracer [candidate] (257.853 ms) : 0, 257853
AppSec [baseline] (174.848 ms) : 0, 174848
AppSec [candidate] (174.746 ms) : 0, 174746
Debugger [baseline] (67.543 ms) : 0, 67543
Debugger [candidate] (67.318 ms) : 0, 67318
Remote Config [baseline] (782.815 µs) : 0, 783
Remote Config [candidate] (773.51 µs) : 0, 774
Telemetry [baseline] (9.425 ms) : 0, 9425
Telemetry [candidate] (9.395 ms) : 0, 9395
Flare Poller [baseline] (3.681 ms) : 0, 3681
Flare Poller [candidate] (3.697 ms) : 0, 3697
IAST [baseline] (24.908 ms) : 0, 24908
IAST [candidate] (24.643 ms) : 0, 24643
section iast
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (791.828 ms) : 0, 791828
BytebuddyAgent [candidate] (798.995 ms) : 0, 798995
GlobalTracer [baseline] (254.914 ms) : 0, 254914
GlobalTracer [candidate] (257.646 ms) : 0, 257646
AppSec [baseline] (35.016 ms) : 0, 35016
AppSec [candidate] (32.749 ms) : 0, 32749
Debugger [baseline] (64.659 ms) : 0, 64659
Debugger [candidate] (67.727 ms) : 0, 67727
Remote Config [baseline] (589.952 µs) : 0, 590
Remote Config [candidate] (599.53 µs) : 0, 600
Telemetry [baseline] (8.493 ms) : 0, 8493
Telemetry [candidate] (8.551 ms) : 0, 8551
Flare Poller [baseline] (3.461 ms) : 0, 3461
Flare Poller [candidate] (3.512 ms) : 0, 3512
IAST [baseline] (27.252 ms) : 0, 27252
IAST [candidate] (27.449 ms) : 0, 27449
section profiling
crashtracking [baseline] (1.217 ms) : 0, 1217
crashtracking [candidate] (1.21 ms) : 0, 1210
BytebuddyAgent [baseline] (704.916 ms) : 0, 704916
BytebuddyAgent [candidate] (704.43 ms) : 0, 704430
GlobalTracer [baseline] (220.186 ms) : 0, 220186
GlobalTracer [candidate] (220.181 ms) : 0, 220181
AppSec [baseline] (32.125 ms) : 0, 32125
AppSec [candidate] (32.102 ms) : 0, 32102
Debugger [baseline] (67.763 ms) : 0, 67763
Debugger [candidate] (67.952 ms) : 0, 67952
Remote Config [baseline] (655.298 µs) : 0, 655
Remote Config [candidate] (623.666 µs) : 0, 624
Telemetry [baseline] (8.693 ms) : 0, 8693
Telemetry [candidate] (8.663 ms) : 0, 8663
Flare Poller [baseline] (3.679 ms) : 0, 3679
Flare Poller [candidate] (3.671 ms) : 0, 3671
ProfilingAgent [baseline] (97.18 ms) : 0, 97180
ProfilingAgent [candidate] (96.645 ms) : 0, 96645
Profiling [baseline] (97.756 ms) : 0, 97756
Profiling [candidate] (97.217 ms) : 0, 97217
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.091 s) : 0, 1091306
Total [baseline] (8.807 s) : 0, 8806507
Agent [candidate] (1.086 s) : 0, 1086473
Total [candidate] (8.779 s) : 0, 8779096
section iast
Agent [baseline] (1.222 s) : 0, 1221874
Total [baseline] (9.313 s) : 0, 9312789
Agent [candidate] (1.223 s) : 0, 1223080
Total [candidate] (9.376 s) : 0, 9376424
gantt
title insecure-bank - break down per module: candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.202 ms) : 0, 1202
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (656.521 ms) : 0, 656521
BytebuddyAgent [candidate] (654.007 ms) : 0, 654007
GlobalTracer [baseline] (283.77 ms) : 0, 283770
GlobalTracer [candidate] (282.85 ms) : 0, 282850
AppSec [baseline] (32.997 ms) : 0, 32997
AppSec [candidate] (32.661 ms) : 0, 32661
Debugger [baseline] (67.656 ms) : 0, 67656
Debugger [candidate] (67.02 ms) : 0, 67020
Remote Config [baseline] (614.916 µs) : 0, 615
Remote Config [candidate] (639.321 µs) : 0, 639
Telemetry [baseline] (9.157 ms) : 0, 9157
Telemetry [candidate] (8.92 ms) : 0, 8920
Flare Poller [baseline] (3.764 ms) : 0, 3764
Flare Poller [candidate] (3.708 ms) : 0, 3708
section iast
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.186 ms) : 0, 1186
BytebuddyAgent [baseline] (790.996 ms) : 0, 790996
BytebuddyAgent [candidate] (791.584 ms) : 0, 791584
GlobalTracer [baseline] (254.673 ms) : 0, 254673
GlobalTracer [candidate] (255.478 ms) : 0, 255478
AppSec [baseline] (34.51 ms) : 0, 34510
AppSec [candidate] (33.697 ms) : 0, 33697
Debugger [baseline] (65.276 ms) : 0, 65276
Debugger [candidate] (65.797 ms) : 0, 65797
Remote Config [baseline] (605.462 µs) : 0, 605
Remote Config [candidate] (624.594 µs) : 0, 625
Telemetry [baseline] (8.557 ms) : 0, 8557
Telemetry [candidate] (8.632 ms) : 0, 8632
Flare Poller [baseline] (3.533 ms) : 0, 3533
Flare Poller [candidate] (3.635 ms) : 0, 3635
IAST [baseline] (27.155 ms) : 0, 27155
IAST [candidate] (27.065 ms) : 0, 27065
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 18 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section baseline
no_agent (1.194 ms) : 1182, 1205
. : milestone, 1194,
iast (3.182 ms) : 3140, 3224
. : milestone, 3182,
iast_FULL (5.799 ms) : 5741, 5856
. : milestone, 5799,
iast_GLOBAL (3.457 ms) : 3407, 3506
. : milestone, 3457,
profiling (1.948 ms) : 1932, 1964
. : milestone, 1948,
tracing (1.82 ms) : 1803, 1837
. : milestone, 1820,
section candidate
no_agent (1.189 ms) : 1178, 1201
. : milestone, 1189,
iast (3.301 ms) : 3259, 3344
. : milestone, 3301,
iast_FULL (5.858 ms) : 5800, 5916
. : milestone, 5858,
iast_GLOBAL (3.534 ms) : 3475, 3593
. : milestone, 3534,
profiling (2.08 ms) : 2062, 2099
. : milestone, 2080,
tracing (1.794 ms) : 1779, 1809
. : milestone, 1794,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section baseline
no_agent (18.253 ms) : 18062, 18444
. : milestone, 18253,
appsec (18.698 ms) : 18505, 18890
. : milestone, 18698,
code_origins (17.85 ms) : 17670, 18031
. : milestone, 17850,
iast (17.672 ms) : 17497, 17847
. : milestone, 17672,
profiling (18.983 ms) : 18794, 19173
. : milestone, 18983,
tracing (18.042 ms) : 17864, 18220
. : milestone, 18042,
section candidate
no_agent (19.351 ms) : 19148, 19553
. : milestone, 19351,
appsec (18.703 ms) : 18511, 18894
. : milestone, 18703,
code_origins (17.875 ms) : 17696, 18053
. : milestone, 17875,
iast (17.895 ms) : 17713, 18076
. : milestone, 17895,
profiling (18.699 ms) : 18513, 18885
. : milestone, 18699,
tracing (17.739 ms) : 17564, 17914
. : milestone, 17739,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1462, 1485
. : milestone, 1473,
appsec (3.649 ms) : 3433, 3864
. : milestone, 3649,
iast (2.203 ms) : 2138, 2267
. : milestone, 2203,
iast_GLOBAL (2.251 ms) : 2186, 2316
. : milestone, 2251,
profiling (2.452 ms) : 2289, 2614
. : milestone, 2452,
tracing (2.041 ms) : 1990, 2092
. : milestone, 2041,
section candidate
no_agent (1.471 ms) : 1459, 1482
. : milestone, 1471,
appsec (3.726 ms) : 3507, 3945
. : milestone, 3726,
iast (2.204 ms) : 2140, 2268
. : milestone, 2204,
iast_GLOBAL (2.245 ms) : 2180, 2310
. : milestone, 2245,
profiling (2.083 ms) : 2029, 2137
. : milestone, 2083,
tracing (2.038 ms) : 1987, 2089
. : milestone, 2038,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.58.0-SNAPSHOT~625a4988c6, baseline=1.58.0-SNAPSHOT~13c16342ac
dateFormat X
axisFormat %s
section baseline
no_agent (15.566 s) : 15566000, 15566000
. : milestone, 15566000,
appsec (14.842 s) : 14842000, 14842000
. : milestone, 14842000,
iast (18.073 s) : 18073000, 18073000
. : milestone, 18073000,
iast_GLOBAL (17.704 s) : 17704000, 17704000
. : milestone, 17704000,
profiling (14.663 s) : 14663000, 14663000
. : milestone, 14663000,
tracing (14.829 s) : 14829000, 14829000
. : milestone, 14829000,
section candidate
no_agent (15.045 s) : 15045000, 15045000
. : milestone, 15045000,
appsec (14.515 s) : 14515000, 14515000
. : milestone, 14515000,
iast (18.447 s) : 18447000, 18447000
. : milestone, 18447000,
iast_GLOBAL (17.882 s) : 17882000, 17882000
. : milestone, 17882000,
profiling (14.954 s) : 14954000, 14954000
. : milestone, 14954000,
tracing (14.694 s) : 14694000, 14694000
. : milestone, 14694000,
|
dd-trace-core/src/main/java/datadog/trace/core/propagation/W3CTraceParent.java
Outdated
Show resolved
Hide resolved
dd-trace-api/src/main/java/datadog/trace/api/W3CTraceParent.java
Outdated
Show resolved
Hide resolved
dd-trace-api/src/main/java/datadog/trace/api/W3CTraceParent.java
Outdated
Show resolved
Hide resolved
dd-trace-api/src/main/java/datadog/trace/api/W3CTraceParent.java
Outdated
Show resolved
Hide resolved
3aa1a03 to
4a4b35f
Compare
14d9bcc to
625a498
Compare
PerfectSlayer
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.
👏 praise: Thanks for the follow up changes!
Motivation
In #9589, a comment was made that we already implemented three times a way to build a W3C compliant trace parent. To make things simple, we decided to refactor those implementations into a single helper.
What Does This Do
datadog.trace.api.W3CTraceParentto build this trace parent. I'm not 100% sure it's the right package to put it, I hesitated withdatadog.trace.core.propagationAdditional 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]