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

[Tracing] Refactor internal Span Links API #6341

Merged
merged 9 commits into from
Jan 2, 2025

Conversation

zacharycmontoya
Copy link
Collaborator

@zacharycmontoya zacharycmontoya commented Nov 22, 2024

Summary of changes

Updates the internal Datadog API for adding links to span in the following ways:

Datadog.Trace.SpanLink

  • Constructor: Modified constructors so there is only one with the signature public SpanLink(SpanContext spanLinkContext, List<KeyValuePair<string, string>>? attributes = null)
  • Span DecoratedSpan property: This property and any associated logic has been removed

Datadog.Trace.Span

  • AddSpanLink: This method now returns the target Span instance for method chaining

Reason for change

This aligns the API more closely with the OpenTelemetry Tracing API spec, as well as the Activity AddLink API and ActivityLink constructor

Implementation details

Test coverage

The existing unit tests have been updated and any integration tests that add span links are still passing.

Other details

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Nov 22, 2024

Datadog Report

Branch report: zach.montoya/refactor-span-links
Commit report: fde0164
Test service: dd-trace-dotnet

✅ 0 Failed, 230136 Passed, 2112 Skipped, 18h 9m 42.27s Total Time
⌛ 1 Performance Regression

⌛ Performance Regressions vs Default Branch (1)

  • Profiler_liveheap - scenarios 3.49s (+209.36ms, +6%) - Details

@andrewlock
Copy link
Member

andrewlock commented Nov 22, 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
    This PR (6341) - mean (69ms)  : 65, 73
     .   : milestone, 69,
    master - mean (68ms)  : 66, 71
     .   : milestone, 68,

    section CallTarget+Inlining+NGEN
    This PR (6341) - mean (981ms)  : 949, 1012
     .   : milestone, 981,
    master - mean (975ms)  : 958, 992
     .   : milestone, 975,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6341) - mean (107ms)  : 105, 109
     .   : milestone, 107,
    master - mean (107ms)  : 104, 110
     .   : milestone, 107,

    section CallTarget+Inlining+NGEN
    This PR (6341) - mean (677ms)  : 663, 691
     .   : milestone, 677,
    master - mean (678ms)  : 663, 693
     .   : milestone, 678,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6341) - mean (91ms)  : 90, 93
     .   : milestone, 91,
    master - mean (92ms)  : 90, 93
     .   : milestone, 92,

    section CallTarget+Inlining+NGEN
    This PR (6341) - mean (633ms)  : 617, 649
     .   : milestone, 633,
    master - mean (636ms)  : 621, 650
     .   : milestone, 636,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6341) - mean (194ms)  : 190, 197
     .   : milestone, 194,
    master - mean (194ms)  : 191, 197
     .   : milestone, 194,

    section CallTarget+Inlining+NGEN
    This PR (6341) - mean (1,101ms)  : 1066, 1136
     .   : milestone, 1101,
    master - mean (1,101ms)  : 1069, 1133
     .   : milestone, 1101,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6341) - mean (279ms)  : 273, 285
     .   : milestone, 279,
    master - mean (279ms)  : 274, 285
     .   : milestone, 279,

    section CallTarget+Inlining+NGEN
    This PR (6341) - mean (869ms)  : 838, 901
     .   : milestone, 869,
    master - mean (875ms)  : 843, 907
     .   : milestone, 875,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6341) - mean (267ms)  : 262, 273
     .   : milestone, 267,
    master - mean (268ms)  : 264, 272
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (6341) - mean (853ms)  : 817, 889
     .   : milestone, 853,
    master - mean (852ms)  : 826, 879
     .   : milestone, 852,

Loading

@andrewlock
Copy link
Member

andrewlock commented Nov 23, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6341 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.234
  • 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.89μs 42.1ns 231ns 0.0191 0.00762 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.3μs 56.9ns 346ns 0.02 0.00998 0 5.8 KB
master StartStopWithChild net472 16.4μs 46.6ns 174ns 1.04 0.326 0.0979 6.21 KB
#6341 StartStopWithChild net6.0 8.01μs 44.9ns 314ns 0.0152 0.0076 0 5.61 KB
#6341 StartStopWithChild netcoreapp3.1 10.1μs 55.9ns 395ns 0.0261 0.0104 0 5.8 KB
#6341 StartStopWithChild net472 16.2μs 56.5ns 219ns 1.03 0.294 0.0979 6.21 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 505μs 187ns 674ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 665μs 191ns 713ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 851μs 601ns 2.25μs 0.425 0 0 3.3 KB
#6341 WriteAndFlushEnrichedTraces net6.0 484μs 420ns 1.57μs 0 0 0 2.7 KB
#6341 WriteAndFlushEnrichedTraces netcoreapp3.1 669μs 330ns 1.23μs 0 0 0 2.7 KB
#6341 WriteAndFlushEnrichedTraces net472 851μs 310ns 1.16μs 0.425 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 159μs 1.17μs 11.7μs 0.155 0 0 14.47 KB
master SendRequest netcoreapp3.1 171μs 989ns 8.85μs 0.16 0 0 17.27 KB
master SendRequest net472 0.00147ns 0.000331ns 0.00119ns 0 0 0 0 b
#6341 SendRequest net6.0 158μs 1.05μs 10.4μs 0.144 0 0 14.47 KB
#6341 SendRequest netcoreapp3.1 176μs 1.22μs 12μs 0.156 0 0 17.27 KB
#6341 SendRequest net472 0.0014ns 0.00081ns 0.00292ns 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 574μs 3.16μs 19.7μs 0.571 0 0 41.6 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 667μs 3.5μs 18.2μs 0.319 0 0 41.66 KB
master WriteAndFlushEnrichedTraces net472 874μs 3.72μs 14.4μs 8.19 2.59 0.431 53.28 KB
#6341 WriteAndFlushEnrichedTraces net6.0 568μs 3.05μs 17μs 0.566 0 0 41.52 KB
#6341 WriteAndFlushEnrichedTraces netcoreapp3.1 675μs 3.66μs 21.7μs 0.347 0 0 41.83 KB
#6341 WriteAndFlushEnrichedTraces net472 830μs 3.91μs 16.1μs 8.17 2.45 0.408 53.24 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.28μs 1.12ns 4.19ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.86μs 1.63ns 6.3ns 0.0138 0 0 1.02 KB
master ExecuteNonQuery net472 2.11μs 1.82ns 7.04ns 0.156 0.00105 0 987 B
#6341 ExecuteNonQuery net6.0 1.34μs 1.29ns 5ns 0.0141 0 0 1.02 KB
#6341 ExecuteNonQuery netcoreapp3.1 1.73μs 1.39ns 5.37ns 0.013 0 0 1.02 KB
#6341 ExecuteNonQuery net472 2.04μs 2.17ns 8.42ns 0.156 0.00103 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.25μs 0.547ns 2.05ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.61μs 1.32ns 5.13ns 0.0128 0 0 976 B
master CallElasticsearch net472 2.49μs 2.37ns 9.17ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.35μs 0.4ns 1.44ns 0.013 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.76μs 1.28ns 4.95ns 0.014 0 0 1.02 KB
master CallElasticsearchAsync net472 2.68μs 0.672ns 2.42ns 0.166 0 0 1.05 KB
#6341 CallElasticsearch net6.0 1.16μs 0.921ns 3.57ns 0.0134 0 0 976 B
#6341 CallElasticsearch netcoreapp3.1 1.54μs 0.71ns 2.75ns 0.0132 0 0 976 B
#6341 CallElasticsearch net472 2.58μs 1.8ns 6.97ns 0.157 0 0 995 B
#6341 CallElasticsearchAsync net6.0 1.29μs 0.482ns 1.8ns 0.013 0 0 952 B
#6341 CallElasticsearchAsync netcoreapp3.1 1.67μs 0.737ns 2.86ns 0.0135 0 0 1.02 KB
#6341 CallElasticsearchAsync net472 2.65μs 0.912ns 3.29ns 0.167 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.34μs 0.61ns 2.28ns 0.0139 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.59μs 0.735ns 2.75ns 0.0129 0 0 952 B
master ExecuteAsync net472 1.84μs 0.58ns 2.17ns 0.145 0 0 915 B
#6341 ExecuteAsync net6.0 1.27μs 0.385ns 1.44ns 0.0134 0 0 952 B
#6341 ExecuteAsync netcoreapp3.1 1.66μs 0.806ns 3.01ns 0.0126 0 0 952 B
#6341 ExecuteAsync net472 1.82μs 0.615ns 2.38ns 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.46μs 0.961ns 3.72ns 0.0313 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.12μs 1.94ns 6.98ns 0.0361 0 0 2.85 KB
master SendAsync net472 7.37μs 1.27ns 4.57ns 0.494 0 0 3.12 KB
#6341 SendAsync net6.0 4.44μs 1.97ns 7.38ns 0.0311 0 0 2.31 KB
#6341 SendAsync netcoreapp3.1 5.32μs 2.21ns 8.55ns 0.0373 0 0 2.85 KB
#6341 SendAsync net472 7.33μs 3.38ns 13.1ns 0.495 0 0 3.12 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.46μs 0.521ns 1.88ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.25μs 9.33ns 36.1ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.67μs 1.31ns 4.9ns 0.25 0 0 1.57 KB
#6341 EnrichedLog net6.0 1.57μs 0.78ns 3.02ns 0.023 0 0 1.64 KB
#6341 EnrichedLog netcoreapp3.1 2.23μs 0.866ns 3.35ns 0.0223 0 0 1.64 KB
#6341 EnrichedLog net472 2.71μs 1.15ns 4.44ns 0.25 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 119μs 165ns 616ns 0.0598 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 122μs 179ns 691ns 0 0 0 4.28 KB
master EnrichedLog net472 153μs 130ns 503ns 0.687 0.229 0 4.46 KB
#6341 EnrichedLog net6.0 116μs 116ns 449ns 0 0 0 4.28 KB
#6341 EnrichedLog netcoreapp3.1 124μs 57.9ns 209ns 0 0 0 4.28 KB
#6341 EnrichedLog net472 152μs 221ns 829ns 0.69 0.23 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.96μs 0.942ns 3.65ns 0.0312 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.11μs 1.58ns 6.11ns 0.0289 0 0 2.2 KB
master EnrichedLog net472 4.86μs 1.22ns 4.74ns 0.32 0 0 2.02 KB
#6341 EnrichedLog net6.0 2.88μs 1.22ns 4.74ns 0.0304 0 0 2.2 KB
#6341 EnrichedLog netcoreapp3.1 4.23μs 1.69ns 6.09ns 0.0295 0 0 2.2 KB
#6341 EnrichedLog net472 4.79μs 0.718ns 2.49ns 0.319 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.4μs 0.47ns 1.76ns 0.0162 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.82μs 8.41ns 32.6ns 0.0155 0 0 1.14 KB
master SendReceive net472 2.13μs 0.448ns 1.74ns 0.184 0 0 1.16 KB
#6341 SendReceive net6.0 1.41μs 0.905ns 3.51ns 0.0162 0 0 1.14 KB
#6341 SendReceive netcoreapp3.1 1.82μs 1.28ns 4.95ns 0.0154 0 0 1.14 KB
#6341 SendReceive net472 2.06μs 1.27ns 4.93ns 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.78μs 0.78ns 2.92ns 0.0224 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.87μs 2.61ns 10.1ns 0.0213 0 0 1.65 KB
master EnrichedLog net472 4.36μs 5.45ns 21.1ns 0.324 0 0 2.04 KB
#6341 EnrichedLog net6.0 2.65μs 1.45ns 5.62ns 0.0226 0 0 1.6 KB
#6341 EnrichedLog netcoreapp3.1 3.96μs 2.31ns 8.95ns 0.0217 0 0 1.65 KB
#6341 EnrichedLog net472 4.62μs 2.26ns 8.74ns 0.324 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6341

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.234 593.56 480.81

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 413ns 0.199ns 0.769ns 0.00802 0 0 576 B
master StartFinishSpan netcoreapp3.1 639ns 3.5ns 20.1ns 0.00752 0 0 576 B
master StartFinishSpan net472 660ns 0.547ns 2.12ns 0.0917 0 0 578 B
master StartFinishScope net6.0 594ns 0.422ns 1.63ns 0.00982 0 0 696 B
master StartFinishScope netcoreapp3.1 745ns 0.867ns 3.36ns 0.00932 0 0 696 B
master StartFinishScope net472 833ns 1.4ns 5.41ns 0.105 0 0 658 B
#6341 StartFinishSpan net6.0 395ns 0.248ns 0.96ns 0.00812 0 0 576 B
#6341 StartFinishSpan netcoreapp3.1 611ns 0.467ns 1.81ns 0.00788 0 0 576 B
#6341 StartFinishSpan net472 626ns 0.456ns 1.77ns 0.0917 0 0 578 B
#6341 StartFinishScope net6.0 480ns 0.381ns 1.43ns 0.00967 0 0 696 B
#6341 StartFinishScope netcoreapp3.1 675ns 2.47ns 9.57ns 0.00936 0 0 696 B
#6341 StartFinishScope net472 883ns 0.933ns 3.61ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 638ns 0.866ns 3.35ns 0.00963 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 894ns 0.805ns 3.12ns 0.00927 0 0 696 B
master RunOnMethodBegin net472 1.1μs 1.08ns 4.18ns 0.104 0 0 658 B
#6341 RunOnMethodBegin net6.0 649ns 0.588ns 2.28ns 0.00971 0 0 696 B
#6341 RunOnMethodBegin netcoreapp3.1 993ns 1.18ns 4.4ns 0.00941 0 0 696 B
#6341 RunOnMethodBegin net472 1.08μs 1.11ns 4.3ns 0.104 0 0 658 B

@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/refactor-span-links branch from 9f2ff65 to 0717792 Compare December 4, 2024 21:34
@andrewlock
Copy link
Member

andrewlock commented Dec 4, 2024

Throughput/Crank Report ⚡

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 (6341) (11.085M)   : 0, 11085165
    master (10.945M)   : 0, 10944634
    benchmarks/2.9.0 (11.033M)   : 0, 11032866

    section Automatic
    This PR (6341) (7.107M)   : 0, 7107378
    master (7.121M)   : 0, 7120888
    benchmarks/2.9.0 (7.786M)   : 0, 7785853

    section Trace stats
    master (7.505M)   : 0, 7504617

    section Manual
    master (11.061M)   : 0, 11061067

    section Manual + Automatic
    This PR (6341) (6.594M)   : 0, 6594347
    master (6.575M)   : 0, 6574704

    section DD_TRACE_ENABLED=0
    master (10.092M)   : 0, 10092366

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6341) (9.520M)   : 0, 9520408
    master (9.576M)   : 0, 9576183
    benchmarks/2.9.0 (9.495M)   : 0, 9494821

    section Automatic
    This PR (6341) (6.383M)   : 0, 6382997
    master (6.465M)   : 0, 6465361

    section Trace stats
    master (6.685M)   : 0, 6684640

    section Manual
    master (9.712M)   : 0, 9712411

    section Manual + Automatic
    This PR (6341) (6.025M)   : 0, 6024545
    master (5.964M)   : 0, 5963821

    section DD_TRACE_ENABLED=0
    master (8.985M)   : 0, 8985007

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6341) (10.344M)   : 0, 10344216
    master (10.148M)   : 0, 10147789
    benchmarks/2.9.0 (10.020M)   : 0, 10019592

    section Automatic
    This PR (6341) (6.713M)   : 0, 6713488
    master (6.790M)   : 0, 6790112
    benchmarks/2.9.0 (7.255M)   : 0, 7255257

    section Trace stats
    master (7.378M)   : 0, 7378293

    section Manual
    master (10.462M)   : 0, 10461699

    section Manual + Automatic
    This PR (6341) (6.003M)   : 0, 6002844
    master (6.169M)   : 0, 6169080

    section DD_TRACE_ENABLED=0
    master (9.595M)   : 0, 9594713

Loading

@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/refactor-span-links branch from 0717792 to c550991 Compare December 5, 2024 16:34
@zacharycmontoya zacharycmontoya marked this pull request as ready for review December 6, 2024 20:12
@zacharycmontoya zacharycmontoya requested a review from a team as a code owner December 6, 2024 20:12
@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/refactor-span-links branch from c550991 to f6a9a08 Compare December 18, 2024 23:07
…his updated interface is eaiser to use from instrumentations when there are no Spans for incoming headers, only span contexts.
- Rename the method from AddSpanLink to AddLink (this also mirrors the suggestion from OpenTelemetry Tracing API spec)
- Return the Span object instead of returning nothing
@zacharycmontoya zacharycmontoya force-pushed the zach.montoya/refactor-span-links branch from f6a9a08 to 57db143 Compare December 19, 2024 18:35
Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Thanks! Just wanted to make sure that the potential behavior change of removing the IsFinished check is fine

It seems fine to me, but just wanted to call it out as our SpanLink is mutable where other implementations don't appear to be so

tracer/src/Datadog.Trace/SpanLink.cs Show resolved Hide resolved
{
if (IsFinished)
{
Log.Warning("AddSpanLink should not be called after the span was closed");
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@zacharycmontoya zacharycmontoya merged commit 26b057d into master Jan 2, 2025
99 of 102 checks passed
@zacharycmontoya zacharycmontoya deleted the zach.montoya/refactor-span-links branch January 2, 2025 19:52
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 2, 2025
@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:refactor labels Jan 6, 2025
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) type:refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants