Skip to content

Stop recreating SpanEventsManager#7978

Merged
andrewlock merged 1 commit intomasterfrom
andrew/fix-recreating-span-events
Dec 23, 2025
Merged

Stop recreating SpanEventsManager#7978
andrewlock merged 1 commit intomasterfrom
andrew/fix-recreating-span-events

Conversation

@andrewlock
Copy link
Member

Summary of changes

Use the provided SpanEventsManager in TracerManager constructor

Reason for change

While working on something else, @daniel-romano-DD noticed that we were recreating the SpanEventsManager in the TracerManager constructor, instead of using the value provided (which will have just been created previously. Can't see a good reason for it, it looks like a bug.

Implementation details

Just use the provided value

Test coverage

Probably benign so not covered by anything else, but meh

@andrewlock andrewlock added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Dec 19, 2025
@andrewlock andrewlock requested a review from a team as a code owner December 19, 2025 12:16
Copy link
Contributor

@daniel-romano-DD daniel-romano-DD left a comment

Choose a reason for hiding this comment

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

Thanks a lot

@andrewlock andrewlock enabled auto-merge (squash) December 19, 2025 12:59
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7978) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.29 ± (68.28 - 68.48) ms68.39 ± (68.34 - 68.60) ms+0.1%✅⬆️
.NET Framework 4.8 - Bailout
duration71.94 ± (71.86 - 72.08) ms72.19 ± (72.11 - 72.34) ms+0.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1002.40 ± (1004.37 - 1009.54) ms1004.82 ± (1006.10 - 1011.50) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.78 ± (21.75 - 21.81) ms21.95 ± (21.92 - 21.99) ms+0.8%✅⬆️
process.time_to_main_ms78.59 ± (78.46 - 78.72) ms78.57 ± (78.45 - 78.69) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.90 - 10.91) MB10.91 ± (10.90 - 10.91) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.69 ± (21.67 - 21.71) ms21.95 ± (21.86 - 22.05) ms+1.2%✅⬆️
process.time_to_main_ms80.00 ± (79.90 - 80.10) ms80.40 ± (80.09 - 80.70) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.94 ± (10.94 - 10.95) MB-0.2%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms211.71 ± (210.18 - 213.23) ms211.10 ± (209.71 - 212.49) ms-0.3%
process.time_to_main_ms472.41 ± (471.76 - 473.05) ms474.24 ± (473.71 - 474.77) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.04 ± (48.02 - 48.06) MB48.14 ± (48.12 - 48.16) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms20.69 ± (20.66 - 20.72) ms20.61 ± (20.59 - 20.64) ms-0.4%
process.time_to_main_ms68.10 ± (67.99 - 68.21) ms68.15 ± (68.06 - 68.25) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.61 - 10.62) MB10.63 ± (10.63 - 10.63) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.71 ± (20.68 - 20.74) ms20.60 ± (20.58 - 20.62) ms-0.5%
process.time_to_main_ms69.05 ± (68.99 - 69.10) ms69.15 ± (69.08 - 69.21) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.66 ± (10.66 - 10.66) MB10.68 ± (10.68 - 10.69) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms200.42 ± (199.37 - 201.47) ms199.56 ± (198.51 - 200.62) ms-0.4%
process.time_to_main_ms439.49 ± (438.95 - 440.02) ms439.49 ± (439.03 - 439.94) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.39 ± (48.32 - 48.45) MB48.45 ± (48.38 - 48.51) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.5%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms18.76 ± (18.73 - 18.78) ms18.87 ± (18.84 - 18.91) ms+0.6%✅⬆️
process.time_to_main_ms66.99 ± (66.90 - 67.09) ms67.10 ± (67.00 - 67.20) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.68) MB7.69 ± (7.68 - 7.69) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.78 ± (18.76 - 18.80) ms18.88 ± (18.85 - 18.90) ms+0.5%✅⬆️
process.time_to_main_ms68.27 ± (68.20 - 68.34) ms68.44 ± (68.37 - 68.51) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.74) MB7.75 ± (7.74 - 7.76) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms178.67 ± (177.80 - 179.55) ms179.31 ± (178.45 - 180.17) ms+0.4%✅⬆️
process.time_to_main_ms424.18 ± (423.68 - 424.69) ms425.71 ± (425.16 - 426.26) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.23 ± (36.19 - 36.26) MB36.26 ± (36.23 - 36.29) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.0%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.39 ± (193.24 - 194.05) ms194.23 ± (194.00 - 194.97) ms+0.4%✅⬆️
.NET Framework 4.8 - Bailout
duration197.28 ± (197.28 - 197.89) ms197.04 ± (196.94 - 197.57) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1114.02 ± (1119.92 - 1130.10) ms1119.41 ± (1124.95 - 1135.26) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms187.98 ± (187.58 - 188.39) ms187.85 ± (187.42 - 188.27) ms-0.1%
process.time_to_main_ms80.79 ± (80.51 - 81.06) ms81.10 ± (80.86 - 81.34) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.06 - 16.11) MB16.07 ± (16.04 - 16.10) MB-0.1%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.5%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.23 ± (186.93 - 187.52) ms186.90 ± (186.57 - 187.24) ms-0.2%
process.time_to_main_ms82.06 ± (81.91 - 82.21) ms82.00 ± (81.86 - 82.14) ms-0.1%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.13 - 16.18) MB16.09 ± (16.06 - 16.11) MB-0.4%
runtime.dotnet.threads.count20 ± (20 - 21)21 ± (20 - 21)+0.6%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms400.77 ± (397.76 - 403.78) ms395.81 ± (393.38 - 398.24) ms-1.2%
process.time_to_main_ms476.45 ± (475.84 - 477.06) ms473.76 ± (473.12 - 474.40) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.48 ± (58.33 - 58.62) MB58.59 ± (58.45 - 58.74) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms191.56 ± (191.23 - 191.90) ms193.23 ± (192.80 - 193.66) ms+0.9%✅⬆️
process.time_to_main_ms69.73 ± (69.58 - 69.89) ms70.68 ± (70.44 - 70.92) ms+1.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.02 ± (15.87 - 16.18) MB16.08 ± (15.95 - 16.21) MB+0.4%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+3.6%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms192.22 ± (191.78 - 192.66) ms191.11 ± (190.82 - 191.40) ms-0.6%
process.time_to_main_ms70.99 ± (70.83 - 71.15) ms70.81 ± (70.73 - 70.89) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.19 ± (16.06 - 16.33) MB16.05 ± (15.89 - 16.20) MB-0.9%
runtime.dotnet.threads.count20 ± (20 - 20)19 ± (19 - 19)-3.2%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms406.92 ± (404.77 - 409.07) ms409.87 ± (407.69 - 412.05) ms+0.7%✅⬆️
process.time_to_main_ms444.79 ± (444.16 - 445.43) ms445.45 ± (444.80 - 446.09) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.89 ± (58.75 - 59.04) MB59.20 ± (59.08 - 59.33) MB+0.5%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (29 - 30)-0.1%
.NET 8 - Baseline
process.internal_duration_ms189.94 ± (189.59 - 190.30) ms190.27 ± (189.98 - 190.55) ms+0.2%✅⬆️
process.time_to_main_ms69.55 ± (69.34 - 69.75) ms69.71 ± (69.50 - 69.92) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.72 - 11.77) MB11.72 ± (11.68 - 11.75) MB-0.2%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.3%
.NET 8 - Bailout
process.internal_duration_ms188.80 ± (188.52 - 189.07) ms190.38 ± (190.04 - 190.72) ms+0.8%✅⬆️
process.time_to_main_ms70.23 ± (70.14 - 70.31) ms70.67 ± (70.54 - 70.80) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.78 - 11.84) MB11.77 ± (11.75 - 11.80) MB-0.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.3%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms365.76 ± (364.06 - 367.46) ms364.24 ± (362.66 - 365.83) ms-0.4%
process.time_to_main_ms427.69 ± (427.18 - 428.19) ms427.58 ± (426.96 - 428.20) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.94 ± (47.91 - 47.97) MB48.02 ± (47.99 - 48.05) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
Comparison explanation

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 highlighted 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).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (68ms)  : 67, 70
    master - mean (68ms)  : 67, 70

    section Bailout
    This PR (7978) - mean (72ms)  : 71, 73
    master - mean (72ms)  : 71, 73

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (1,009ms)  : 971, 1047
    master - mean (1,007ms)  : 970, 1044

Loading
FakeDbCommand (.NET Core 3.1)
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (106ms)  : 103, 108
    master - mean (106ms)  : 103, 109

    section Bailout
    This PR (7978) - mean (107ms)  : 101, 113
    master - mean (107ms)  : 106, 108

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (717ms)  : 679, 756
    master - mean (716ms)  : 676, 757

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (94ms)  : 92, 95
    master - mean (93ms)  : 92, 95

    section Bailout
    This PR (7978) - mean (94ms)  : 93, 95
    master - mean (94ms)  : 93, 95

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (667ms)  : 643, 690
    master - mean (667ms)  : 641, 692

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (92ms)  : 90, 94
    master - mean (92ms)  : 90, 94

    section Bailout
    This PR (7978) - mean (93ms)  : 92, 95
    master - mean (93ms)  : 92, 94

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (633ms)  : 617, 648
    master - mean (631ms)  : 615, 646

Loading
HttpMessageHandler (.NET Framework 4.8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (194ms)  : 190, 199
    master - mean (194ms)  : 190, 197

    section Bailout
    This PR (7978) - mean (197ms)  : 194, 200
    master - mean (198ms)  : 195, 200

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (1,130ms)  : 1050, 1211
    master - mean (1,125ms)  : 1048, 1202

Loading
HttpMessageHandler (.NET Core 3.1)
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (277ms)  : 270, 284
    master - mean (277ms)  : 271, 283

    section Bailout
    This PR (7978) - mean (277ms)  : 273, 282
    master - mean (277ms)  : 274, 281

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (907ms)  : 870, 944
    master - mean (914ms)  : 871, 957

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (272ms)  : 266, 278
    master - mean (269ms)  : 265, 274

    section Bailout
    This PR (7978) - mean (270ms)  : 267, 273
    master - mean (272ms)  : 265, 278

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (891ms)  : 853, 929
    master - mean (886ms)  : 847, 926

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7978) - mean (270ms)  : 266, 274
    master - mean (269ms)  : 264, 274

    section Bailout
    This PR (7978) - mean (270ms)  : 266, 275
    master - mean (269ms)  : 265, 272

    section CallTarget+Inlining+NGEN
    This PR (7978) - mean (824ms)  : 799, 849
    master - mean (826ms)  : 806, 845

Loading

@andrewlock andrewlock merged commit 4b2eba5 into master Dec 23, 2025
153 checks passed
@andrewlock andrewlock deleted the andrew/fix-recreating-span-events branch December 23, 2025 16:25
@github-actions github-actions bot added this to the vNext-v3 milestone Dec 23, 2025
@andrewlock andrewlock added the type:cleanup Minor code clean up label Jan 12, 2026
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:cleanup Minor code clean up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants