dd-trace-go
dd-trace-go copied to clipboard
w3c: ensure _dd.parent_id is set using x-datadog-parent-id
What does this PR do?
Improves support for w3c tracecontext propagation. If the last datadog parent id can not be set using the p key in tracestate set _dd.parent_id using the x-datadog-parent-id header.
Motivation
The _dd.parent_id tag is used as a back up parent_id. If Span.parent_id can not be found then _dd.parent_id will be used to generate trace flamegraphs. This will reduce the frequency of broken traces in the Datadog UI
Passing the following system tests: https://github.com/DataDog/system-tests/blob/main/tests/parametric/test_headers_tracecontext.py#L717-%23L809
Reviewer's Checklist
- [ ] Changed code has unit tests for its functionality at or near 100% coverage.
- [ ] System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
- [ ] There is a benchmark for any new code, or changes to existing code.
- [ ] If this interacts with the agent in a new way, a system test has been added.
- [ ] Add an appropriate team label so this PR gets put in the right place for the release notes.
- [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
Unsure? Have a question? Request a review!
Benchmarks
Benchmark execution time: 2024-05-24 19:09:47
Comparing candidate commit 5596e589158d58a8347c511afdbbd6e9a8fb61cf in PR branch munir/w3c-phase-3 with baseline commit b0aa1b8aa856084eed0abb1957719284319130d6 in branch main.
Found 0 performance improvements and 1 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.
scenario:BenchmarkStartSpanConcurrent-24
- 🟥
execution_time[+191.228ns; +399.572ns] or [+2.892%; +6.042%]