-
Notifications
You must be signed in to change notification settings - Fork 322
add W3C baggage propagator
#8203
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
fb3cd5f to
731403e
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 3 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.07 s) : 0, 1069557
Total [baseline] (8.658 s) : 0, 8657731
Agent [candidate] (1.055 s) : 0, 1055095
Total [candidate] (8.627 s) : 0, 8627048
section iast
Agent [baseline] (1.18 s) : 0, 1180269
Total [baseline] (9.187 s) : 0, 9187003
Agent [candidate] (1.184 s) : 0, 1184309
Total [candidate] (9.281 s) : 0, 9280514
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.18 s) : 0, 1179951
Total [baseline] (9.154 s) : 0, 9154476
Agent [candidate] (1.193 s) : 0, 1192532
Total [candidate] (9.187 s) : 0, 9187154
section iast_TELEMETRY_OFF
Agent [baseline] (1.177 s) : 0, 1176529
Total [baseline] (9.181 s) : 0, 9180575
Agent [candidate] (1.176 s) : 0, 1176246
Total [candidate] (9.182 s) : 0, 9182271
gantt
title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (723.327 ms) : 0, 723327
BytebuddyAgent [candidate] (713.33 ms) : 0, 713330
GlobalTracer [baseline] (257.937 ms) : 0, 257937
GlobalTracer [candidate] (255.806 ms) : 0, 255806
AppSec [baseline] (57.011 ms) : 0, 57011
AppSec [candidate] (55.316 ms) : 0, 55316
Remote Config [baseline] (721.356 µs) : 0, 721
Remote Config [candidate] (723.184 µs) : 0, 723
Telemetry [baseline] (15.383 ms) : 0, 15383
Telemetry [candidate] (14.931 ms) : 0, 14931
section iast
BytebuddyAgent [baseline] (830.658 ms) : 0, 830658
BytebuddyAgent [candidate] (832.125 ms) : 0, 832125
GlobalTracer [baseline] (246.084 ms) : 0, 246084
GlobalTracer [candidate] (247.739 ms) : 0, 247739
AppSec [baseline] (57.612 ms) : 0, 57612
AppSec [candidate] (58.197 ms) : 0, 58197
IAST [baseline] (21.551 ms) : 0, 21551
IAST [candidate] (21.68 ms) : 0, 21680
Remote Config [baseline] (656.578 µs) : 0, 657
Remote Config [candidate] (675.531 µs) : 0, 676
Telemetry [baseline] (8.771 ms) : 0, 8771
Telemetry [candidate] (8.858 ms) : 0, 8858
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (829.48 ms) : 0, 829480
BytebuddyAgent [candidate] (837.38 ms) : 0, 837380
GlobalTracer [baseline] (246.407 ms) : 0, 246407
GlobalTracer [candidate] (249.669 ms) : 0, 249669
AppSec [baseline] (58.344 ms) : 0, 58344
AppSec [candidate] (58.722 ms) : 0, 58722
IAST [baseline] (21.398 ms) : 0, 21398
IAST [candidate] (21.882 ms) : 0, 21882
Remote Config [baseline] (672.218 µs) : 0, 672
Remote Config [candidate] (684.406 µs) : 0, 684
Telemetry [baseline] (8.739 ms) : 0, 8739
Telemetry [candidate] (8.968 ms) : 0, 8968
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (827.26 ms) : 0, 827260
BytebuddyAgent [candidate] (827.098 ms) : 0, 827098
GlobalTracer [baseline] (246.044 ms) : 0, 246044
GlobalTracer [candidate] (246.654 ms) : 0, 246654
AppSec [baseline] (57.944 ms) : 0, 57944
AppSec [candidate] (57.547 ms) : 0, 57547
IAST [baseline] (21.046 ms) : 0, 21046
IAST [candidate] (20.715 ms) : 0, 20715
Remote Config [baseline] (651.076 µs) : 0, 651
Remote Config [candidate] (661.644 µs) : 0, 662
Telemetry [baseline] (8.671 ms) : 0, 8671
Telemetry [candidate] (8.625 ms) : 0, 8625
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055087
Total [baseline] (10.421 s) : 0, 10421312
Agent [candidate] (1.056 s) : 0, 1055778
Total [candidate] (10.461 s) : 0, 10461274
section appsec
Agent [baseline] (1.195 s) : 0, 1194926
Total [baseline] (10.75 s) : 0, 10749978
Agent [candidate] (1.194 s) : 0, 1194124
Total [candidate] (10.738 s) : 0, 10737882
section iast
Agent [baseline] (1.18 s) : 0, 1180339
Total [baseline] (10.965 s) : 0, 10964538
Agent [candidate] (1.184 s) : 0, 1184092
Total [candidate] (10.924 s) : 0, 10924424
section profiling
Agent [baseline] (1.256 s) : 0, 1256412
Total [baseline] (10.84 s) : 0, 10840042
Agent [candidate] (1.255 s) : 0, 1254541
Total [candidate] (10.784 s) : 0, 10783878
gantt
title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.298 ms) : 0, 714298
BytebuddyAgent [candidate] (713.517 ms) : 0, 713517
GlobalTracer [baseline] (255.455 ms) : 0, 255455
GlobalTracer [candidate] (255.477 ms) : 0, 255477
AppSec [baseline] (56.039 ms) : 0, 56039
AppSec [candidate] (56.032 ms) : 0, 56032
Remote Config [baseline] (718.319 µs) : 0, 718
Remote Config [candidate] (714.806 µs) : 0, 715
Telemetry [baseline] (13.64 ms) : 0, 13640
Telemetry [candidate] (15.112 ms) : 0, 15112
section appsec
BytebuddyAgent [baseline] (736.009 ms) : 0, 736009
BytebuddyAgent [candidate] (734.758 ms) : 0, 734758
GlobalTracer [baseline] (253.941 ms) : 0, 253941
GlobalTracer [candidate] (254.547 ms) : 0, 254547
AppSec [baseline] (170.826 ms) : 0, 170826
AppSec [candidate] (171.208 ms) : 0, 171208
IAST [baseline] (19.615 ms) : 0, 19615
IAST [candidate] (19.345 ms) : 0, 19345
Remote Config [baseline] (679.545 µs) : 0, 680
Remote Config [candidate] (671.294 µs) : 0, 671
Telemetry [baseline] (8.661 ms) : 0, 8661
Telemetry [candidate] (8.193 ms) : 0, 8193
section iast
BytebuddyAgent [baseline] (830.647 ms) : 0, 830647
BytebuddyAgent [candidate] (831.91 ms) : 0, 831910
GlobalTracer [baseline] (246.118 ms) : 0, 246118
GlobalTracer [candidate] (248.434 ms) : 0, 248434
AppSec [baseline] (57.79 ms) : 0, 57790
AppSec [candidate] (57.949 ms) : 0, 57949
IAST [baseline] (21.36 ms) : 0, 21360
IAST [candidate] (21.326 ms) : 0, 21326
Remote Config [baseline] (665.651 µs) : 0, 666
Remote Config [candidate] (675.594 µs) : 0, 676
Telemetry [baseline] (8.746 ms) : 0, 8746
Telemetry [candidate] (8.75 ms) : 0, 8750
section profiling
BytebuddyAgent [baseline] (704.118 ms) : 0, 704118
BytebuddyAgent [candidate] (703.657 ms) : 0, 703657
GlobalTracer [baseline] (349.569 ms) : 0, 349569
GlobalTracer [candidate] (350.308 ms) : 0, 350308
AppSec [baseline] (55.328 ms) : 0, 55328
AppSec [candidate] (53.68 ms) : 0, 53680
Remote Config [baseline] (664.48 µs) : 0, 664
Remote Config [candidate] (650.595 µs) : 0, 651
Telemetry [baseline] (8.739 ms) : 0, 8739
Telemetry [candidate] (8.79 ms) : 0, 8790
ProfilingAgent [baseline] (96.091 ms) : 0, 96091
ProfilingAgent [candidate] (95.501 ms) : 0, 95501
Profiling [baseline] (96.115 ms) : 0, 96115
Profiling [candidate] (95.525 ms) : 0, 95525
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section baseline
no_agent (1.366 ms) : 1346, 1385
. : milestone, 1366,
appsec (1.747 ms) : 1723, 1771
. : milestone, 1747,
appsec_no_iast (1.777 ms) : 1753, 1801
. : milestone, 1777,
iast (1.506 ms) : 1483, 1529
. : milestone, 1506,
profiling (1.511 ms) : 1487, 1535
. : milestone, 1511,
tracing (1.51 ms) : 1486, 1534
. : milestone, 1510,
section candidate
no_agent (1.368 ms) : 1348, 1387
. : milestone, 1368,
appsec (1.749 ms) : 1725, 1773
. : milestone, 1749,
appsec_no_iast (1.77 ms) : 1746, 1794
. : milestone, 1770,
iast (1.498 ms) : 1475, 1522
. : milestone, 1498,
profiling (1.511 ms) : 1488, 1534
. : milestone, 1511,
tracing (1.487 ms) : 1462, 1512
. : milestone, 1487,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section baseline
no_agent (385.631 µs) : 364, 408
. : milestone, 386,
iast (507.33 µs) : 486, 529
. : milestone, 507,
iast_FULL (667.741 µs) : 646, 690
. : milestone, 668,
iast_GLOBAL (531.197 µs) : 510, 553
. : milestone, 531,
iast_HARDCODED_SECRET_DISABLED (495.405 µs) : 474, 517
. : milestone, 495,
iast_INACTIVE (454.135 µs) : 433, 475
. : milestone, 454,
iast_TELEMETRY_OFF (486.85 µs) : 465, 508
. : milestone, 487,
tracing (459.063 µs) : 437, 481
. : milestone, 459,
section candidate
no_agent (388.51 µs) : 368, 409
. : milestone, 389,
iast (502.811 µs) : 481, 525
. : milestone, 503,
iast_FULL (654.782 µs) : 632, 677
. : milestone, 655,
iast_GLOBAL (523.053 µs) : 502, 544
. : milestone, 523,
iast_HARDCODED_SECRET_DISABLED (497.883 µs) : 476, 520
. : milestone, 498,
iast_INACTIVE (461.861 µs) : 440, 483
. : milestone, 462,
iast_TELEMETRY_OFF (485.193 µs) : 464, 507
. : milestone, 485,
tracing (458.859 µs) : 438, 480
. : milestone, 459,
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.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section baseline
no_agent (1.472 ms) : 1461, 1484
. : milestone, 1472,
appsec (2.369 ms) : 2325, 2412
. : milestone, 2369,
iast (2.105 ms) : 2050, 2159
. : milestone, 2105,
iast_GLOBAL (2.154 ms) : 2099, 2210
. : milestone, 2154,
profiling (1.964 ms) : 1920, 2008
. : milestone, 1964,
tracing (1.935 ms) : 1893, 1976
. : milestone, 1935,
section candidate
no_agent (1.466 ms) : 1454, 1477
. : milestone, 1466,
appsec (2.361 ms) : 2318, 2404
. : milestone, 2361,
iast (2.101 ms) : 2047, 2156
. : milestone, 2101,
iast_GLOBAL (2.148 ms) : 2094, 2203
. : milestone, 2148,
profiling (2.419 ms) : 2244, 2594
. : milestone, 2419,
tracing (1.952 ms) : 1910, 1995
. : milestone, 1952,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~731403efa9, baseline=1.46.0-SNAPSHOT~8b63e5a85b
dateFormat X
axisFormat %s
section baseline
no_agent (15.419 s) : 15419000, 15419000
. : milestone, 15419000,
appsec (15.023 s) : 15023000, 15023000
. : milestone, 15023000,
iast (18.596 s) : 18596000, 18596000
. : milestone, 18596000,
iast_GLOBAL (18.223 s) : 18223000, 18223000
. : milestone, 18223000,
profiling (14.965 s) : 14965000, 14965000
. : milestone, 14965000,
tracing (15.101 s) : 15101000, 15101000
. : milestone, 15101000,
section candidate
no_agent (15.244 s) : 15244000, 15244000
. : milestone, 15244000,
appsec (15.142 s) : 15142000, 15142000
. : milestone, 15142000,
iast (18.617 s) : 18617000, 18617000
. : milestone, 18617000,
iast_GLOBAL (18.096 s) : 18096000, 18096000
. : milestone, 18096000,
profiling (15.042 s) : 15042000, 15042000
. : milestone, 15042000,
tracing (14.943 s) : 14943000, 14943000
. : milestone, 14943000,
|
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.
Few comment about design while still in draft :)
| TRACECONTEXT, | ||
| // W3C baggage propagation style | ||
| // https://www.w3.org/TR/baggage/ | ||
| BAGGAGE, |
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.
Like DSM, Baggage is not a trace propagation style.
I'm introducing a new API for non tracing propagator.
| } | ||
| } | ||
|
|
||
| private static String trim(String input) { |
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.
Is there a benefit compared to String.trim() ?
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.
Happy to change it. I just copied this from W3CHttpCodec.java 😅
dd-trace-java/dd-trace-core/src/main/java/datadog/trace/core/propagation/W3CHttpCodec.java
Line 356 in 0b1e6ff
| private static String trim(String input) { |
| context = extractedContext; | ||
| // Stop extraction if only extracting first valid context and drop everything else | ||
| if (this.extractFirst) { | ||
| // TODO: change this logic to always extract baggage |
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 a due to the fact it is not a tracing propagator.
I would rather see it integrated differently (maybe a as a decorator like I did for DSM).
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** A codec designed for HTTP transport via headers using W3C "baggage" header */ | ||
| class W3CBaggageHttpCodec { |
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.
Overall, how do we expect to handle properties? Should they be considered as part of the 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.
Do you mean these properties from the W3C spec?
baggage: key1=value1;property1;property2
OpenTelemetry doesn't support them (they simplified a few things from the W3C spec). A user can set "value;property" as a baggage value, but the semicolon will be encoded to %3B in the header (and later decoded) since ; is not allowed in the value itself.
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.
OpenTelemetry doesn't support them
Not yet 😇 But according to the doc:
Left opaque to allow for future functionality.
No, I was thinking:
- We want to introduce W3C baggage propagator (according the PR title :p)
- W3C baggage header will not always come from an OTel upstream service, so you might have headers with values having properties (and not URL encoded).
- So, how is it supposed to be handled on our side? Are properties part of the value or not?
|
@PerfectSlayer recommended a different solution. Closing this PR to work on #8233 instead. |
What Does This Do
Add support for propagating baggage using the W3C
baggageheader (compatible with OpenTelemetry).https://www.w3.org/TR/baggage/
BAGGAGEtoTracePropagationStyleW3CBaggageHttpCodecas a sibling toDatadogHttpCodec,W3CHttpCodec, etc.Motivation
This is a user-requested feature that we are adding to all tracing libraries for OpenTelemetry compatibility.
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: APMAPI-214