Skip to content
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

[Tracer] Extracting Last Parent Id If Conflicting SpanIds are Found with The W3C Headers #5721

Merged
merged 10 commits into from
Jul 1, 2024

Conversation

link04
Copy link
Contributor

@link04 link04 commented Jun 20, 2024

Summary of changes

Making sure that the Parent Id tag is set as expected based on the confirmation that the TraceIds match but the SpanIds don't when using the W3C headers, also setting the spanId based on that disconnected to keep try fixing the parent relation ship.

RFC: https://docs.google.com/document/d/1Zc7uAQTJ2G5vHEbmx8k4vMnYdQ-BnqZxewXk0ohgd3g/edit

Reason for change

To improve our interoperability with the tracecontext headers.

Implementation details

Added the following to the SpanContextProgator.cs:

if (localSpanContext.RawSpanId != spanContext.RawSpanId)
{
    if (!string.IsNullOrEmpty(spanContext.LastParentId) && spanContext.LastParentId != W3CTraceContextPropagator.ZeroLastParent)
    {
        localSpanContext.LastParentId = spanContext.LastParentId;
    }
    else
    {
        localSpanContext.LastParentId = $"{localSpanContext.SpanId:x16}";
    }

    localSpanContext.SpanId = spanContext.SpanId;
}

Test coverage

Added new test case based out of the system-tests cases for this feature: DataDog/system-tests#2385

@andrewlock
Copy link
Member

andrewlock commented Jun 20, 2024

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    master - mean (74ms)  : 62, 85
     .   : milestone, 74,

    section CallTarget+Inlining+NGEN
    master - mean (945ms)  : 815, 1075
     .   : milestone, 945,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    master - mean (120ms)  : 111, 130
     .   : milestone, 120,

    section CallTarget+Inlining+NGEN
    master - mean (741ms)  : 650, 832
     .   : milestone, 741,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    master - mean (122ms)  : 119, 125
     .   : milestone, 122,

    section CallTarget+Inlining+NGEN
    master - mean (671ms)  : 495, 848
     .   : milestone, 671,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    master - mean (191ms)  : 187, 196
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    master - mean (1,001ms)  : 974, 1028
     .   : milestone, 1001,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    master - mean (276ms)  : 273, 280
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    master - mean (823ms)  : 798, 849
     .   : milestone, 823,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    master - mean (265ms)  : 262, 269
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    master - mean (809ms)  : 780, 839
     .   : milestone, 809,

Loading

@andrewlock
Copy link
Member

andrewlock commented Jun 20, 2024

Throughput/Crank Report:zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5721) (11.955M)   : 0, 11955107
    master (11.842M)   : 0, 11842369
    benchmarks/2.9.0 (12.049M)   : 0, 12048905

    section Automatic
    This PR (5721) (7.897M)   : 0, 7896532
    master (7.999M)   : 0, 7998666
    benchmarks/2.9.0 (8.464M)   : 0, 8463997

    section Trace stats
    master (8.337M)   : 0, 8336641

    section Manual
    This PR (5721) (10.141M)   : 0, 10140964
    master (10.173M)   : 0, 10173108

    section Manual + Automatic
    This PR (5721) (7.475M)   : 0, 7474503
    master (7.350M)   : 0, 7349541

    section Version Conflict
    master (6.703M)   : 0, 6702940

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5721) (9.591M)   : 0, 9590887
    master (9.512M)   : 0, 9511621
    benchmarks/2.9.0 (9.590M)   : 0, 9590349

    section Automatic
    This PR (5721) (6.569M)   : 0, 6569301
    master (6.515M)   : 0, 6515399

    section Trace stats
    master (6.862M)   : 0, 6861752

    section Manual
    This PR (5721) (8.182M)   : 0, 8181694
    master (8.299M)   : 0, 8298527

    section Manual + Automatic
    This PR (5721) (6.269M)   : 0, 6269343
    master (6.262M)   : 0, 6262373

    section Version Conflict
    master (5.588M)   : 0, 5588112

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (5721) (10.263M)   : 0, 10263454
    master (10.162M)   : 0, 10161696
    benchmarks/2.9.0 (10.465M)   : 0, 10465033

    section Automatic
    This PR (5721) (7.290M)   : 0, 7290428
    master (7.293M)   : 0, 7293498
    benchmarks/2.9.0 (7.635M)   : 0, 7635248

    section Trace stats
    master (7.497M)   : 0, 7496532

    section Manual
    This PR (5721) (8.976M)   : 0, 8975771
    master (9.243M)   : 0, 9243291

    section Manual + Automatic
    This PR (5721) (7.050M)   : 0, 7049924
    master (6.976M)   : 0, 6975655

    section Version Conflict
    master (6.267M)   : 0, 6266553

Loading

@andrewlock
Copy link
Member

andrewlock commented Jun 20, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #5721 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.127
  • 1 benchmarks are slower, with geometric mean 1.185
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 7.84μs 43.5ns 292ns 0.019 0.00762 0 5.42 KB
master StartStopWithChild netcoreapp3.1 10μs 51.7ns 243ns 0.0203 0.0102 0 5.62 KB
master StartStopWithChild net472 16.1μs 53.4ns 207ns 1.02 0.314 0.0943 6.08 KB
#5721 StartStopWithChild net6.0 7.79μs 37.9ns 189ns 0.0146 0.00731 0 5.42 KB
#5721 StartStopWithChild netcoreapp3.1 9.72μs 53.1ns 296ns 0.0154 0.00512 0 5.62 KB
#5721 StartStopWithChild net472 16μs 48.9ns 190ns 1.04 0.332 0.0947 6.07 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 487μs 415ns 1.61μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 633μs 314ns 1.22μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 817μs 197ns 764ns 0.408 0 0 3.3 KB
#5721 WriteAndFlushEnrichedTraces net6.0 497μs 177ns 640ns 0 0 0 2.7 KB
#5721 WriteAndFlushEnrichedTraces netcoreapp3.1 638μs 173ns 625ns 0 0 0 2.7 KB
#5721 WriteAndFlushEnrichedTraces net472 818μs 192ns 745ns 0.408 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 174μs 341ns 1.32μs 0.173 0 0 18.45 KB
master SendRequest netcoreapp3.1 191μs 324ns 1.26μs 0.191 0 0 20.61 KB
master SendRequest net472 0.000406ns 0.000256ns 0.000992ns 0 0 0 0 b
#5721 SendRequest net6.0 172μs 191ns 715ns 0.257 0 0 18.45 KB
#5721 SendRequest netcoreapp3.1 194μs 288ns 1.11μs 0.195 0 0 20.61 KB
#5721 SendRequest net472 0.000136ns 6.93E‑05ns 0.000268ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 544μs 341ns 1.28μs 0.543 0 0 41.62 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 650μs 1.71μs 6.63μs 0.327 0 0 41.7 KB
master WriteAndFlushEnrichedTraces net472 854μs 4.15μs 17.1μs 8.33 2.5 0.417 53.25 KB
#5721 WriteAndFlushEnrichedTraces net6.0 545μs 229ns 824ns 0.541 0 0 41.51 KB
#5721 WriteAndFlushEnrichedTraces netcoreapp3.1 666μs 454ns 1.76μs 0.329 0 0 41.86 KB
#5721 WriteAndFlushEnrichedTraces net472 872μs 2.92μs 10.9μs 8.54 2.25 0.45 53.22 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.32μs 0.623ns 2.41ns 0.0138 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.62μs 1.04ns 4.02ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery net472 1.94μs 3.21ns 12.4ns 0.157 0 0 987 B
#5721 ExecuteNonQuery net6.0 1.31μs 1.02ns 3.96ns 0.0144 0 0 1.02 KB
#5721 ExecuteNonQuery netcoreapp3.1 1.64μs 0.585ns 2.19ns 0.0132 0 0 1.02 KB
#5721 ExecuteNonQuery net472 1.99μs 0.524ns 1.96ns 0.157 0 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.24μs 0.458ns 1.78ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.51μs 0.45ns 1.62ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.64μs 1.83ns 6.84ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.28μs 0.653ns 2.44ns 0.0134 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.73μs 3.48ns 13.5ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.5μs 1.43ns 5.34ns 0.166 0 0 1.05 KB
#5721 CallElasticsearch net6.0 1.19μs 0.676ns 2.53ns 0.0138 0 0 976 B
#5721 CallElasticsearch netcoreapp3.1 1.59μs 6.93ns 25.9ns 0.0131 0 0 976 B
#5721 CallElasticsearch net472 2.72μs 5.35ns 20.7ns 0.157 0 0 995 B
#5721 CallElasticsearchAsync net6.0 1.32μs 1.15ns 4.47ns 0.0133 0 0 952 B
#5721 CallElasticsearchAsync netcoreapp3.1 1.65μs 0.953ns 3.3ns 0.0134 0 0 1.02 KB
#5721 CallElasticsearchAsync net472 2.58μs 0.891ns 3.09ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.26μs 0.528ns 2.05ns 0.0132 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.73μs 5.54ns 21.5ns 0.013 0 0 952 B
master ExecuteAsync net472 1.84μs 0.645ns 2.5ns 0.145 0 0 915 B
#5721 ExecuteAsync net6.0 1.2μs 0.91ns 3.52ns 0.0133 0 0 952 B
#5721 ExecuteAsync netcoreapp3.1 1.67μs 0.477ns 1.72ns 0.0125 0 0 952 B
#5721 ExecuteAsync net472 1.8μs 1.25ns 4.85ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.18μs 1.82ns 6.81ns 0.0314 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.01μs 2.42ns 9.36ns 0.0379 0 0 2.76 KB
master SendAsync net472 7.71μs 8.49ns 32.9ns 0.498 0 0 3.15 KB
#5721 SendAsync net6.0 4.11μs 1.33ns 4.99ns 0.031 0 0 2.22 KB
#5721 SendAsync netcoreapp3.1 5.07μs 3.61ns 14ns 0.0383 0 0 2.76 KB
#5721 SendAsync net472 7.7μs 2.89ns 11.2ns 0.498 0 0 3.15 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.45μs 0.588ns 2.2ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.23μs 1.75ns 6.79ns 0.0223 0 0 1.64 KB
master EnrichedLog net472 2.53μs 1.43ns 5.37ns 0.249 0 0 1.57 KB
#5721 EnrichedLog net6.0 1.56μs 2.44ns 9.47ns 0.0227 0 0 1.64 KB
#5721 EnrichedLog netcoreapp3.1 2.25μs 1.12ns 4.2ns 0.0224 0 0 1.64 KB
#5721 EnrichedLog net472 2.51μs 1.9ns 7.35ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 112μs 63.9ns 239ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 118μs 134ns 502ns 0 0 0 4.28 KB
master EnrichedLog net472 146μs 95.7ns 358ns 0.658 0.219 0 4.46 KB
#5721 EnrichedLog net6.0 115μs 155ns 602ns 0 0 0 4.28 KB
#5721 EnrichedLog netcoreapp3.1 120μs 252ns 975ns 0 0 0 4.28 KB
#5721 EnrichedLog net472 146μs 60.1ns 225ns 0.658 0.219 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.98μs 2.08ns 8.05ns 0.0313 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.28μs 2.74ns 10.3ns 0.0278 0 0 2.2 KB
master EnrichedLog net472 4.82μs 2.66ns 10.3ns 0.319 0 0 2.02 KB
#5721 EnrichedLog net6.0 3.1μs 0.971ns 3.76ns 0.0308 0 0 2.2 KB
#5721 EnrichedLog netcoreapp3.1 4.28μs 2.19ns 8.49ns 0.0299 0 0 2.2 KB
#5721 EnrichedLog net472 4.75μs 1.04ns 3.75ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.3μs 0.483ns 1.87ns 0.0162 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.72μs 1.1ns 4.25ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.09μs 1.32ns 5.13ns 0.183 0 0 1.16 KB
#5721 SendReceive net6.0 1.3μs 0.897ns 3.36ns 0.0163 0 0 1.14 KB
#5721 SendReceive netcoreapp3.1 1.68μs 2.58ns 9.99ns 0.0152 0 0 1.14 KB
#5721 SendReceive net472 1.99μs 1.56ns 6.05ns 0.183 0 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.82μs 0.832ns 3.22ns 0.0227 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.99μs 3.08ns 11.9ns 0.022 0 0 1.65 KB
master EnrichedLog net472 4.46μs 2.9ns 11.2ns 0.322 0 0 2.04 KB
#5721 EnrichedLog net6.0 2.74μs 2.08ns 8.05ns 0.022 0 0 1.6 KB
#5721 EnrichedLog netcoreapp3.1 3.93μs 1.6ns 6.21ns 0.0215 0 0 1.65 KB
#5721 EnrichedLog net472 4.47μs 1.76ns 6.82ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5721

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.127 707.50 627.96

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 391ns 0.306ns 1.19ns 0.00814 0 0 576 B
master StartFinishSpan netcoreapp3.1 585ns 0.328ns 1.18ns 0.00798 0 0 576 B
master StartFinishSpan net472 707ns 0.37ns 1.39ns 0.0916 0 0 578 B
master StartFinishScope net6.0 550ns 0.307ns 1.19ns 0.00963 0 0 696 B
master StartFinishScope netcoreapp3.1 742ns 0.806ns 2.91ns 0.00932 0 0 696 B
master StartFinishScope net472 868ns 0.845ns 3.27ns 0.104 0 0 658 B
#5721 StartFinishSpan net6.0 406ns 0.127ns 0.491ns 0.00817 0 0 576 B
#5721 StartFinishSpan netcoreapp3.1 558ns 0.613ns 2.37ns 0.00787 0 0 576 B
#5721 StartFinishSpan net472 629ns 0.542ns 2.1ns 0.0916 0 0 578 B
#5721 StartFinishScope net6.0 545ns 0.29ns 1.12ns 0.0098 0 0 696 B
#5721 StartFinishScope netcoreapp3.1 704ns 0.24ns 0.929ns 0.00949 0 0 696 B
#5721 StartFinishScope net472 894ns 0.535ns 1.85ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #5721

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.185 633.60 750.61

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 634ns 0.122ns 0.455ns 0.00984 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 912ns 2.94ns 11.4ns 0.0092 0 0 696 B
master RunOnMethodBegin net472 1.06μs 0.971ns 3.76ns 0.104 0 0 658 B
#5721 RunOnMethodBegin net6.0 751ns 0.62ns 2.4ns 0.00963 0 0 696 B
#5721 RunOnMethodBegin netcoreapp3.1 916ns 0.439ns 1.7ns 0.00953 0 0 696 B
#5721 RunOnMethodBegin net472 1.07μs 0.497ns 1.92ns 0.104 0 0 658 B

@DataDog DataDog deleted a comment from datadog-ddstaging bot Jun 21, 2024
@link04 link04 marked this pull request as ready for review June 21, 2024 14:34
@link04 link04 requested review from a team as code owners June 21, 2024 14:34
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Jun 21, 2024

Datadog Report

Branch report: maximo/w3c-phase-3
Commit report: 459ca70
Test service: dd-trace-dotnet

✅ 0 Failed, 339424 Passed, 1624 Skipped, 14h 17m 29.29s Total Time

@@ -199,7 +199,7 @@ private SpanContext(TraceId traceId, string serviceName)
/// <summary>
/// Gets the span id.
/// </summary>
public ulong SpanId { get; }
public ulong SpanId { get; internal set; }
Copy link
Member

@lucaspimentel lucaspimentel Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels iffy. Why are we adding a property setter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So part of the W3C Phase 3 is the future deprecation of Datadog headers, so when we find conflicting headers we prioritize W3C span id and need to update them, in the latest commit I do so like:
fdd4fd5#diff-3f905f6ce54156702b562c581f1ff7866c41fbafb6b29b79c6c2411c79c19e55R187-R188

localSpanContext.SpanId = spanContext.SpanId;
localSpanContext.RawSpanId = spanContext.RawSpanId;

Do you have any other prefer methods, I Googled the internal set and found no complaints so far.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is SpanContext. I thought this was Span. 😅

Still, it would've been nice to mutate things as little as possible. Maybe determine the final span id first before creating the SpanContext, but that's a larger refactor.

Thanks for clarifying.

@lucaspimentel lucaspimentel requested a review from a team June 25, 2024 18:00
@link04 link04 changed the title [Tracer] Extracting P Tag if Conflicting SpanIds are Found [Tracer] Extracting Last Parent Id If Conflicting SpanIds are Found with The W3C Headers Jun 27, 2024
@@ -64,7 +64,7 @@ internal class SpanMessagePackFormatter : IMessagePackFormatter<TraceChunkModel>
private readonly byte[] _versionNameBytes = StringEncoding.UTF8.GetBytes(Trace.Tags.Version);

private readonly byte[] _originNameBytes = StringEncoding.UTF8.GetBytes(Trace.Tags.Origin);
private readonly byte[] _lastParentIdBytes = StringEncoding.UTF8.GetBytes("_dd.parent_id");
private readonly byte[] _lastParentIdBytes = StringEncoding.UTF8.GetBytes(Trace.Tags.LastParentId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lucaspimentel lucaspimentel requested a review from a team June 28, 2024 18:00
Copy link
Collaborator

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good work!

@link04 link04 merged commit 2516310 into master Jul 1, 2024
56 of 57 checks passed
@link04 link04 deleted the maximo/w3c-phase-3 branch July 1, 2024 20:03
@github-actions github-actions bot added this to the vNext-v2 milestone Jul 1, 2024
@e-n-0 e-n-0 added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants