-
Notifications
You must be signed in to change notification settings - Fork 288
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
Use W3C Trace Context trace ID as parent ID regardless of propagation style order #7355
Conversation
dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java
Outdated
Show resolved
Hide resolved
dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java
Outdated
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 18 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.549 s) : 0, 1548882
Total [baseline] (14.186 s) : 0, 14186202
Agent [candidate] (1.548 s) : 0, 1548436
Total [candidate] (14.304 s) : 0, 14303926
section appsec
Agent [baseline] (1.732 s) : 0, 1731839
Total [baseline] (14.411 s) : 0, 14410863
Agent [candidate] (1.738 s) : 0, 1737788
Total [candidate] (14.537 s) : 0, 14536991
section iast
Agent [baseline] (1.725 s) : 0, 1725128
Total [baseline] (14.992 s) : 0, 14992473
Agent [candidate] (1.74 s) : 0, 1739808
Total [candidate] (14.856 s) : 0, 14856022
section profiling
Agent [baseline] (1.855 s) : 0, 1855055
Total [baseline] (14.634 s) : 0, 14633777
Agent [candidate] (1.868 s) : 0, 1868449
Total [candidate] (14.578 s) : 0, 14577749
gantt
title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (992.184 ms) : 0, 992184
BytebuddyAgent [candidate] (991.741 ms) : 0, 991741
GlobalTracer [baseline] (453.579 ms) : 0, 453579
GlobalTracer [candidate] (453.569 ms) : 0, 453569
AppSec [baseline] (72.46 ms) : 0, 72460
AppSec [candidate] (72.405 ms) : 0, 72405
Remote Config [baseline] (823.14 µs) : 0, 823
Remote Config [candidate] (828.92 µs) : 0, 829
Telemetry [baseline] (9.826 ms) : 0, 9826
Telemetry [candidate] (9.841 ms) : 0, 9841
section appsec
BytebuddyAgent [baseline] (1.008 s) : 0, 1007566
BytebuddyAgent [candidate] (1.011 s) : 0, 1010547
GlobalTracer [baseline] (446.308 ms) : 0, 446308
GlobalTracer [candidate] (447.294 ms) : 0, 447294
AppSec [baseline] (235.109 ms) : 0, 235109
AppSec [candidate] (235.477 ms) : 0, 235477
IAST [baseline] (25.289 ms) : 0, 25289
IAST [candidate] (26.777 ms) : 0, 26777
Remote Config [baseline] (749.68 µs) : 0, 750
Remote Config [candidate] (756.304 µs) : 0, 756
Telemetry [baseline] (9.5 ms) : 0, 9500
Telemetry [candidate] (10.234 ms) : 0, 10234
section iast
BytebuddyAgent [baseline] (1.154 s) : 0, 1153732
BytebuddyAgent [candidate] (1.163 s) : 0, 1163275
GlobalTracer [baseline] (437.137 ms) : 0, 437137
GlobalTracer [candidate] (440.356 ms) : 0, 440356
AppSec [baseline] (73.984 ms) : 0, 73984
AppSec [candidate] (73.919 ms) : 0, 73919
IAST [baseline] (29.327 ms) : 0, 29327
IAST [candidate] (30.034 ms) : 0, 30034
Remote Config [baseline] (751.896 µs) : 0, 752
Remote Config [candidate] (777.97 µs) : 0, 778
Telemetry [baseline] (10.095 ms) : 0, 10095
Telemetry [candidate] (11.144 ms) : 0, 11144
section profiling
BytebuddyAgent [baseline] (984.764 ms) : 0, 984764
BytebuddyAgent [candidate] (990.021 ms) : 0, 990021
GlobalTracer [baseline] (583.574 ms) : 0, 583574
GlobalTracer [candidate] (585.769 ms) : 0, 585769
AppSec [baseline] (73.344 ms) : 0, 73344
AppSec [candidate] (73.859 ms) : 0, 73859
Remote Config [baseline] (882.074 µs) : 0, 882
Remote Config [candidate] (898.922 µs) : 0, 899
Telemetry [baseline] (9.368 ms) : 0, 9368
Telemetry [candidate] (9.472 ms) : 0, 9472
ProfilingAgent [baseline] (147.431 ms) : 0, 147431
ProfilingAgent [candidate] (152.38 ms) : 0, 152380
Profiling [baseline] (147.504 ms) : 0, 147504
Profiling [candidate] (152.454 ms) : 0, 152454
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.55 s) : 0, 1550095
Total [baseline] (11.821 s) : 0, 11820981
Agent [candidate] (1.549 s) : 0, 1549297
Total [candidate] (11.845 s) : 0, 11845226
section iast
Agent [baseline] (1.719 s) : 0, 1718506
Total [baseline] (12.487 s) : 0, 12486755
Agent [candidate] (1.724 s) : 0, 1724183
Total [candidate] (12.532 s) : 0, 12532041
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.722 s) : 0, 1722481
Total [baseline] (12.462 s) : 0, 12462423
Agent [candidate] (1.719 s) : 0, 1718952
Total [candidate] (12.525 s) : 0, 12524854
section iast_TELEMETRY_OFF
Agent [baseline] (1.712 s) : 0, 1711803
Total [baseline] (12.502 s) : 0, 12501507
Agent [candidate] (1.711 s) : 0, 1711012
Total [candidate] (12.508 s) : 0, 12507578
gantt
title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (992.868 ms) : 0, 992868
BytebuddyAgent [candidate] (992.496 ms) : 0, 992496
GlobalTracer [baseline] (454.089 ms) : 0, 454089
GlobalTracer [candidate] (453.398 ms) : 0, 453398
AppSec [baseline] (72.416 ms) : 0, 72416
AppSec [candidate] (72.578 ms) : 0, 72578
Remote Config [baseline] (828.879 µs) : 0, 829
Remote Config [candidate] (833.184 µs) : 0, 833
Telemetry [baseline] (9.841 ms) : 0, 9841
Telemetry [candidate] (9.898 ms) : 0, 9898
section iast
BytebuddyAgent [baseline] (1.15 s) : 0, 1150247
BytebuddyAgent [candidate] (1.153 s) : 0, 1153169
GlobalTracer [baseline] (435.104 ms) : 0, 435104
GlobalTracer [candidate] (437.291 ms) : 0, 437291
AppSec [baseline] (72.582 ms) : 0, 72582
AppSec [candidate] (71.496 ms) : 0, 71496
IAST [baseline] (29.901 ms) : 0, 29901
IAST [candidate] (29.488 ms) : 0, 29488
Remote Config [baseline] (726.711 µs) : 0, 727
Remote Config [candidate] (768.742 µs) : 0, 769
Telemetry [baseline] (9.879 ms) : 0, 9879
Telemetry [candidate] (11.828 ms) : 0, 11828
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (1.151 s) : 0, 1151175
BytebuddyAgent [candidate] (1.149 s) : 0, 1148624
GlobalTracer [baseline] (437.094 ms) : 0, 437094
GlobalTracer [candidate] (436.095 ms) : 0, 436095
AppSec [baseline] (75.948 ms) : 0, 75948
AppSec [candidate] (73.16 ms) : 0, 73160
IAST [baseline] (28.239 ms) : 0, 28239
IAST [candidate] (30.114 ms) : 0, 30114
Remote Config [baseline] (732.619 µs) : 0, 733
Remote Config [candidate] (749.868 µs) : 0, 750
Telemetry [baseline] (9.195 ms) : 0, 9195
Telemetry [candidate] (10.042 ms) : 0, 10042
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (1.144 s) : 0, 1143788
BytebuddyAgent [candidate] (1.143 s) : 0, 1143477
GlobalTracer [baseline] (435.12 ms) : 0, 435120
GlobalTracer [candidate] (434.671 ms) : 0, 434671
AppSec [baseline] (70.861 ms) : 0, 70861
AppSec [candidate] (70.924 ms) : 0, 70924
IAST [baseline] (29.527 ms) : 0, 29527
IAST [candidate] (30.334 ms) : 0, 30334
Remote Config [baseline] (728.411 µs) : 0, 728
Remote Config [candidate] (762.194 µs) : 0, 762
Telemetry [baseline] (11.729 ms) : 0, 11729
Telemetry [candidate] (10.747 ms) : 0, 10747
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 6 metrics, 22 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section baseline
no_agent (1.721 ms) : 1696, 1746
. : milestone, 1721,
appsec (2.189 ms) : 2158, 2220
. : milestone, 2189,
appsec_no_iast (2.164 ms) : 2132, 2196
. : milestone, 2164,
iast (1.865 ms) : 1836, 1894
. : milestone, 1865,
profiling (1.922 ms) : 1887, 1958
. : milestone, 1922,
tracing (1.866 ms) : 1834, 1898
. : milestone, 1866,
section candidate
no_agent (1.705 ms) : 1679, 1731
. : milestone, 1705,
appsec (2.17 ms) : 2137, 2202
. : milestone, 2170,
appsec_no_iast (2.174 ms) : 2140, 2208
. : milestone, 2174,
iast (1.827 ms) : 1797, 1856
. : milestone, 1827,
profiling (1.978 ms) : 1941, 2015
. : milestone, 1978,
tracing (1.896 ms) : 1864, 1927
. : milestone, 1896,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section baseline
no_agent (450.886 µs) : 422, 480
. : milestone, 451,
iast (583.108 µs) : 550, 616
. : milestone, 583,
iast_FULL (683.876 µs) : 651, 717
. : milestone, 684,
iast_GLOBAL (605.442 µs) : 572, 639
. : milestone, 605,
iast_HARDCODED_SECRET_DISABLED (581.596 µs) : 549, 614
. : milestone, 582,
iast_INACTIVE (541.206 µs) : 510, 572
. : milestone, 541,
iast_TELEMETRY_OFF (567.591 µs) : 535, 600
. : milestone, 568,
tracing (531.462 µs) : 502, 561
. : milestone, 531,
section candidate
no_agent (447.055 µs) : 419, 476
. : milestone, 447,
iast (582.481 µs) : 550, 615
. : milestone, 582,
iast_FULL (676.751 µs) : 644, 710
. : milestone, 677,
iast_GLOBAL (606.888 µs) : 574, 640
. : milestone, 607,
iast_HARDCODED_SECRET_DISABLED (581.8 µs) : 549, 614
. : milestone, 582,
iast_INACTIVE (536.851 µs) : 507, 567
. : milestone, 537,
iast_TELEMETRY_OFF (571.747 µs) : 541, 603
. : milestone, 572,
tracing (531.206 µs) : 501, 561
. : milestone, 531,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section baseline
no_agent (1.537 ms) : 1524, 1549
. : milestone, 1537,
appsec (2.698 ms) : 2637, 2759
. : milestone, 2698,
iast (2.363 ms) : 2290, 2436
. : milestone, 2363,
iast_GLOBAL (2.448 ms) : 2372, 2524
. : milestone, 2448,
profiling (2.221 ms) : 2159, 2282
. : milestone, 2221,
tracing (2.194 ms) : 2135, 2254
. : milestone, 2194,
section candidate
no_agent (1.54 ms) : 1527, 1553
. : milestone, 1540,
appsec (2.707 ms) : 2645, 2769
. : milestone, 2707,
iast (2.383 ms) : 2309, 2458
. : milestone, 2383,
iast_GLOBAL (2.433 ms) : 2358, 2508
. : milestone, 2433,
profiling (2.232 ms) : 2170, 2295
. : milestone, 2232,
tracing (2.196 ms) : 2136, 2256
. : milestone, 2196,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~1d63caec9c, baseline=1.39.0-SNAPSHOT~1efda00b65
dateFormat X
axisFormat %s
section baseline
no_agent (20.698 s) : 20698000, 20698000
. : milestone, 20698000,
appsec (21.178 s) : 21178000, 21178000
. : milestone, 21178000,
iast (24.761 s) : 24761000, 24761000
. : milestone, 24761000,
iast_GLOBAL (24.502 s) : 24502000, 24502000
. : milestone, 24502000,
profiling (20.924 s) : 20924000, 20924000
. : milestone, 20924000,
tracing (21.06 s) : 21060000, 21060000
. : milestone, 21060000,
section candidate
no_agent (21.175 s) : 21175000, 21175000
. : milestone, 21175000,
appsec (21.489 s) : 21489000, 21489000
. : milestone, 21489000,
iast (25.507 s) : 25507000, 25507000
. : milestone, 25507000,
iast_GLOBAL (24.954 s) : 24954000, 24954000
. : milestone, 24954000,
profiling (20.937 s) : 20937000, 20937000
. : milestone, 20937000,
tracing (21.656 s) : 21656000, 21656000
. : milestone, 21656000,
|
dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java
Show resolved
Hide resolved
dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java
Outdated
Show resolved
Hide resolved
Store Datadog last parent ID Allow tags update from TagContext Add Datadog parent header validation
// assert context.propagationTags.traceIdHighOrderBits == | ||
|
||
|
||
// TODO Add more cases to cover every behavior |
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.
@PerfectSlayer , not sure if 151-155 is still relevant.
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.
You can replace them by:
// TODO Add some more W3C override checks
and I will get back at it later.
It should not block your PR 😉
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.
The changes look great! Glad to see you successfully went to the bottom of it 😅
Can you add a little comment in the PR too due to the behavior change of last parent ID? (from 0000...00
default to null
and what it means).
I won't approved right now due to the OTel event test file but it's good to me if you remove it 👍
assert context.traceId.toLong() == DDTraceId.from(expectedTraceId).toLong() | ||
assert context.spanId == DDSpanId.from(expectedSpanId) | ||
assert context.tags[PARENT_ID] == expectedParentId | ||
// TODO Add some more W3C override checks |
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.
That is fine. It's out of the scope for this PR
...t/instrumentation/opentelemetry/opentelemetry-1.4/src/test/groovy/OpenTelemetry14Test.groovy
Outdated
Show resolved
Hide resolved
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.
🙌
…der to consume updated W3C parametric tests
In the last commit, I updated the system-test to the current commit for master, but the parametric tests are failing for unrelated failures in |
@zacharycmontoya System tests are supposed to pass. |
…b6 in order to consume updated W3C parametric tests" This reverts commit f25f61b.
Understood, I've added a new PR here: #7481 Note: I'll be on PTO the rest of the week so I won't check back in on this until next week. |
Just merged system tests PR. Updating branch and start CI again |
What Does This Do
If multiple trace contexts are extracted from trace headers, and they share the same trace ID but different span IDs, then we use the span ID found in the traceparent header to overwrite the span ID found in the other context. Also, set
_dd.parent_id
metadata on the span context using the p key in tracestate. If not present, set_dd.parent_id
metadata using thex-datadog-parent-id
header.Also removes checks and references to
p=0000000000000000
in tracestate header, as we do not need to explicitly handle this case.Motivation
Improves support for w3c propagation.
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]