Skip to content

[Logs] Fix OTLP Logs timestamp during serialization#7814

Merged
zacharycmontoya merged 3 commits intomasterfrom
zach.montoya/fix-logs-timestamp
Nov 14, 2025
Merged

[Logs] Fix OTLP Logs timestamp during serialization#7814
zacharycmontoya merged 3 commits intomasterfrom
zach.montoya/fix-logs-timestamp

Conversation

@zacharycmontoya
Copy link
Contributor

@zacharycmontoya zacharycmontoya commented Nov 13, 2025

Summary of changes

Fixes the serialization of the OTLP Logs timestamps fields.

Reason for change

Before this change, we would start with a UTC DateTime for the LogRecord object and then when we would encode it as a Unix epoch time we applied a "local->UTC time" conversion by using DateTime.ToUniversalTime(), which shifted the time. This resulted in OTLP logs from the PST timezone being reported as having a local time 7 hours in the future.

Implementation details

  • Change the Timestamp property of Datadog.Trace.OpenTelemetry.Logs.LogPoint to have type DateTimeOffset instead of DateTime so we're always dealing with a UTC time, and initialize the value to DateTimeOffset.UtcNow
  • Remove the previous encoding of DateTime->Unix nanoseconds and replace it with a call to the existing extension method TimeExtensions.ToUnixTimeNanoseconds, which is already used for serializing timestamps for Metrics and Traces

Test coverage

Add a regression test in OpenTelemetrySdkTests.SubmitsOtlpLogs by asserting that the timestamp in the OTLP log payload is in the expected range (application lifetime) before scrubbing the data and running the snapshot test.

Other details

N/A

Previously, we had started with a UTC DateTime for the LogRecord object and when encoding it as a Unix epoch time we applied a second "local->UTC time" via using DateTime.ToUniversalTime(). This resulted in OTLP logs from the PST being reported as having a local time 7 hours in the future.
…P logs are in the expected range of the application lifetime
@zacharycmontoya zacharycmontoya requested review from a team as code owners November 13, 2025 21:31
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Nov 13, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7814) 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
duration75.48 ± (75.37 - 76.03) ms75.19 ± (75.18 - 75.79) ms-0.4%
.NET Framework 4.8 - Bailout
duration78.31 ± (78.28 - 78.89) ms79.66 ± (79.35 - 79.97) ms+1.7%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1111.73 ± (1116.18 - 1126.32) ms1114.30 ± (1118.24 - 1129.85) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.82 ± (22.74 - 22.90) ms22.72 ± (22.65 - 22.79) ms-0.4%
process.time_to_main_ms87.41 ± (87.09 - 87.74) ms87.10 ± (86.70 - 87.50) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.93) MB10.91 ± (10.90 - 10.91) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.91 ± (22.85 - 22.98) ms22.58 ± (22.53 - 22.64) ms-1.4%
process.time_to_main_ms90.15 ± (89.79 - 90.50) ms87.39 ± (87.03 - 87.76) ms-3.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (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_ms220.70 ± (219.27 - 222.13) ms217.37 ± (216.04 - 218.69) ms-1.5%
process.time_to_main_ms551.38 ± (550.08 - 552.69) ms545.32 ± (544.18 - 546.47) ms-1.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.65 ± (52.63 - 52.67) MB52.50 ± (52.48 - 52.52) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.78 ± (21.71 - 21.84) ms21.76 ± (21.70 - 21.83) ms-0.1%
process.time_to_main_ms76.34 ± (76.01 - 76.68) ms76.29 ± (75.99 - 76.58) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.59 ± (10.59 - 10.60) MB10.62 ± (10.62 - 10.63) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.87 ± (21.80 - 21.94) ms21.62 ± (21.55 - 21.68) ms-1.2%
process.time_to_main_ms78.35 ± (78.00 - 78.69) ms77.00 ± (76.68 - 77.31) ms-1.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.68 ± (10.67 - 10.68) MB10.72 ± (10.72 - 10.73) MB+0.4%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms209.04 ± (207.69 - 210.39) ms207.05 ± (205.83 - 208.28) ms-0.9%
process.time_to_main_ms522.47 ± (521.19 - 523.74) ms509.73 ± (508.56 - 510.90) ms-2.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.72 ± (51.70 - 51.74) MB51.56 ± (51.53 - 51.59) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 8 - Baseline
process.internal_duration_ms20.09 ± (20.02 - 20.17) ms19.61 ± (19.55 - 19.68) ms-2.4%
process.time_to_main_ms76.52 ± (76.13 - 76.91) ms73.78 ± (73.49 - 74.08) ms-3.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.64 ± (7.63 - 7.64) MB7.65 ± (7.65 - 7.66) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms20.09 ± (20.02 - 20.16) ms19.83 ± (19.76 - 19.90) ms-1.3%
process.time_to_main_ms77.24 ± (76.94 - 77.54) ms75.81 ± (75.50 - 76.11) ms-1.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.70 - 7.71) MB7.72 ± (7.71 - 7.72) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms192.68 ± (191.81 - 193.55) ms189.99 ± (189.15 - 190.83) ms-1.4%
process.time_to_main_ms498.51 ± (497.40 - 499.62) ms484.00 ± (483.05 - 484.94) ms-2.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed39.06 ± (39.02 - 39.10) MB38.86 ± (38.82 - 38.90) MB-0.5%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.1%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.74 ± (193.49 - 194.18) ms191.85 ± (191.76 - 192.56) ms-1.0%
.NET Framework 4.8 - Bailout
duration198.70 ± (198.19 - 199.13) ms195.72 ± (195.47 - 196.13) ms-1.5%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1166.93 ± (1171.97 - 1181.55) ms1161.26 ± (1161.94 - 1169.73) ms-0.5%
.NET Core 3.1 - Baseline
process.internal_duration_ms188.31 ± (187.96 - 188.66) ms187.58 ± (187.28 - 187.87) ms-0.4%
process.time_to_main_ms80.68 ± (80.44 - 80.93) ms80.20 ± (80.02 - 80.38) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.09 - 16.15) MB16.05 ± (16.02 - 16.08) MB-0.5%
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.2%
.NET Core 3.1 - Bailout
process.internal_duration_ms189.16 ± (188.70 - 189.63) ms186.40 ± (186.12 - 186.67) ms-1.5%
process.time_to_main_ms82.44 ± (82.25 - 82.64) ms81.70 ± (81.56 - 81.84) ms-0.9%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.07 - 16.13) MB16.16 ± (16.13 - 16.18) MB+0.4%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.6%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms394.79 ± (392.60 - 396.98) ms394.37 ± (391.69 - 397.04) ms-0.1%
process.time_to_main_ms522.01 ± (520.88 - 523.15) ms515.39 ± (514.68 - 516.11) ms-1.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.97 ± (62.81 - 63.12) MB62.70 ± (62.55 - 62.85) MB-0.4%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms194.40 ± (193.96 - 194.85) ms191.85 ± (191.40 - 192.29) ms-1.3%
process.time_to_main_ms70.40 ± (70.18 - 70.62) ms69.71 ± (69.55 - 69.87) ms-1.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.05 - 16.29) MB15.95 ± (15.81 - 16.10) MB-1.3%
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 18)-4.4%
.NET 6 - Bailout
process.internal_duration_ms193.61 ± (193.14 - 194.08) ms190.45 ± (190.19 - 190.71) ms-1.6%
process.time_to_main_ms71.18 ± (71.01 - 71.34) ms70.39 ± (70.30 - 70.49) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.33 ± (16.27 - 16.39) MB15.93 ± (15.76 - 16.09) MB-2.5%
runtime.dotnet.threads.count20 ± (20 - 20)19 ± (19 - 19)-4.1%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms414.43 ± (411.63 - 417.24) ms412.44 ± (409.08 - 415.80) ms-0.5%
process.time_to_main_ms489.31 ± (488.61 - 490.01) ms480.25 ± (479.73 - 480.78) ms-1.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.47 ± (62.35 - 62.60) MB61.79 ± (61.64 - 61.94) MB-1.1%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 30)-0.0%
.NET 8 - Baseline
process.internal_duration_ms192.42 ± (191.98 - 192.86) ms189.47 ± (189.12 - 189.83) ms-1.5%
process.time_to_main_ms69.45 ± (69.26 - 69.64) ms68.97 ± (68.77 - 69.17) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.71 ± (11.69 - 11.73) MB11.76 ± (11.73 - 11.79) MB+0.4%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.4%
.NET 8 - Bailout
process.internal_duration_ms192.45 ± (192.00 - 192.90) ms188.67 ± (188.36 - 188.97) ms-2.0%
process.time_to_main_ms71.06 ± (70.87 - 71.24) ms69.85 ± (69.75 - 69.95) ms-1.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.76 - 11.81) MB11.82 ± (11.78 - 11.86) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-1.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms365.10 ± (363.77 - 366.43) ms361.53 ± (360.08 - 362.98) ms-1.0%
process.time_to_main_ms467.44 ± (466.79 - 468.10) ms456.86 ± (456.24 - 457.48) ms-2.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.50 ± (50.46 - 50.54) MB50.30 ± (50.27 - 50.33) MB-0.4%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
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 (7814) - mean (75ms)  : 71, 80
    master - mean (76ms)  : 71, 80

    section Bailout
    This PR (7814) - mean (80ms)  : 75, 84
    master - mean (79ms)  : 74, 83

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (1,124ms)  : 1040, 1208
    master - mean (1,121ms)  : 1049, 1193

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 (7814) - mean (117ms)  : 110, 124
    master - mean (117ms)  : 110, 125

    section Bailout
    This PR (7814) - mean (117ms)  : 110, 125
    master - mean (121ms)  : 114, 127

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (796ms)  : 758, 834
    master - mean (806ms)  : 762, 849

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7814) - mean (105ms)  : 99, 111
    master - mean (105ms)  : 98, 113

    section Bailout
    This PR (7814) - mean (106ms)  : 100, 111
    master - mean (107ms)  : 100, 114

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (749ms)  : 703, 795
    master - mean (765ms)  : 727, 803

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7814) - mean (102ms)  : 95, 109
    master - mean (105ms)  : 97, 113

    section Bailout
    This PR (7814) - mean (104ms)  : 98, 110
    master - mean (106ms)  : 100, 112

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (705ms)  : 676, 733
    master - mean (723ms)  : 696, 750

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 (7814) - mean (192ms)  : 188, 196
    master - mean (194ms)  : 189, 198

    section Bailout
    This PR (7814) - mean (196ms)  : 193, 199
    master - mean (199ms)  : 193, 204

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (1,166ms)  : 1110, 1222
    master - mean (1,177ms)  : 1106, 1247

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 (7814) - mean (276ms)  : 271, 281
    master - mean (277ms)  : 272, 283

    section Bailout
    This PR (7814) - mean (276ms)  : 273, 279
    master - mean (280ms)  : 272, 287

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (941ms)  : 887, 995
    master - mean (952ms)  : 896, 1008

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7814) - mean (270ms)  : 262, 278
    master - mean (273ms)  : 265, 281

    section Bailout
    This PR (7814) - mean (269ms)  : 265, 272
    master - mean (273ms)  : 264, 282

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (922ms)  : 865, 979
    master - mean (934ms)  : 890, 977

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7814) - mean (268ms)  : 263, 273
    master - mean (272ms)  : 262, 282

    section Bailout
    This PR (7814) - mean (268ms)  : 265, 271
    master - mean (273ms)  : 265, 281

    section CallTarget+Inlining+NGEN
    This PR (7814) - mean (850ms)  : 825, 874
    master - mean (865ms)  : 842, 888

Loading

@pr-commenter
Copy link

pr-commenter bot commented Nov 13, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7814 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.882
  • 8 benchmarks have fewer allocations
  • 1 benchmarks have more 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 ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7814

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.74 KB 5.71 KB -37 B -0.64%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.07 KB 6 KB -71 B -1.17%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.4μs 58.3ns 378ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 13.5μs 70ns 364ns 0 0 0 5.74 KB
master StartStopWithChild net472 22.4μs 122ns 829ns 0.928 0.348 0 6.07 KB
#7814 StartStopWithChild net6.0 10.4μs 58.2ns 403ns 0 0 0 5.51 KB
#7814 StartStopWithChild netcoreapp3.1 13.5μs 70.4ns 338ns 0 0 0 5.71 KB
#7814 StartStopWithChild net472 22.2μs 122ns 741ns 0.99 0.33 0.11 6 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 933μs 87.4ns 303ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 2.48μs 9.6μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.23ms 1.12μs 4.35μs 0 0 0 3.31 KB
#7814 WriteAndFlushEnrichedTraces net6.0 921μs 198ns 768ns 0 0 0 2.7 KB
#7814 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 117ns 454ns 0 0 0 2.7 KB
#7814 WriteAndFlushEnrichedTraces net472 1.21ms 711ns 2.75μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.08μs 5.87ns 33.2ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.42μs 7.74ns 42.4ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.05μs 0.9ns 3.49ns 0.194 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 7μs 34.6ns 147ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.03μs 42.5ns 164ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.66μs 7.12ns 27.6ns 0.719 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 314ns 1.71ns 10ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 397ns 2.2ns 13.7ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 297ns 0.0396ns 0.148ns 0.0433 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.26μs 31.1ns 136ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.71μs 39.9ns 183ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.69μs 3.78ns 14.6ns 0.601 0 0 3.8 KB
#7814 AllCycleSimpleBody net6.0 1.09μs 0.567ns 2.2ns 0 0 0 1.22 KB
#7814 AllCycleSimpleBody netcoreapp3.1 1.41μs 7.43ns 37.9ns 0 0 0 1.2 KB
#7814 AllCycleSimpleBody net472 1.02μs 0.234ns 0.905ns 0.192 0 0 1.23 KB
#7814 AllCycleMoreComplexBody net6.0 6.98μs 35ns 164ns 0 0 0 4.72 KB
#7814 AllCycleMoreComplexBody netcoreapp3.1 9.02μs 4.33ns 16.8ns 0 0 0 4.62 KB
#7814 AllCycleMoreComplexBody net472 7.63μs 3.78ns 14.7ns 0.728 0 0 4.74 KB
#7814 ObjectExtractorSimpleBody net6.0 316ns 1.8ns 11.6ns 0 0 0 280 B
#7814 ObjectExtractorSimpleBody netcoreapp3.1 403ns 0.316ns 1.22ns 0 0 0 272 B
#7814 ObjectExtractorSimpleBody net472 300ns 0.023ns 0.0861ns 0.0439 0 0 281 B
#7814 ObjectExtractorMoreComplexBody net6.0 6.39μs 28.5ns 111ns 0 0 0 3.78 KB
#7814 ObjectExtractorMoreComplexBody netcoreapp3.1 7.74μs 38.5ns 176ns 0 0 0 3.69 KB
#7814 ObjectExtractorMoreComplexBody net472 6.71μs 1.5ns 5.41ns 0.57 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 77.3μs 124ns 479ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 97μs 279ns 1.08μs 0 0 0 32.4 KB
master EncodeArgs net472 109μs 26ns 101ns 4.92 0 0 32.5 KB
master EncodeLegacyArgs net6.0 147μs 91.8ns 355ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 219ns 821ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 18.6ns 67.2ns 0 0 0 2.17 KB
#7814 EncodeArgs net6.0 76.5μs 212ns 794ns 0 0 0 32.4 KB
#7814 EncodeArgs netcoreapp3.1 97.2μs 232ns 898ns 0 0 0 32.4 KB
#7814 EncodeArgs net472 109μs 13.1ns 50.9ns 4.92 0 0 32.51 KB
#7814 EncodeLegacyArgs net6.0 146μs 7.7ns 28.8ns 0 0 0 2.15 KB
#7814 EncodeLegacyArgs netcoreapp3.1 197μs 314ns 1.22μs 0 0 0 2.14 KB
#7814 EncodeLegacyArgs net472 262μs 132ns 513ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #7814

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.078 855,933.02 411,918.85
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 1.705 514,601.37 301,796.58 bimodal

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 389μs 48.7ns 189ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 806μs 10.6μs 106μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 427μs 73.1ns 283ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 289μs 36ns 140ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 600μs 12.9μs 129μs 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 308μs 31.3ns 121ns 0 0 0 2.29 KB
#7814 RunWafRealisticBenchmark net6.0 395μs 73.5ns 275ns 0 0 0 4.55 KB
#7814 RunWafRealisticBenchmark netcoreapp3.1 412μs 409ns 1.58μs 0 0 0 4.48 KB
#7814 RunWafRealisticBenchmark net472 429μs 32.6ns 122ns 0 0 0 4.66 KB
#7814 RunWafRealisticBenchmarkWithAttack net6.0 283μs 43.2ns 162ns 0 0 0 2.24 KB
#7814 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 303μs 971ns 3.76μs 0 0 0 2.22 KB
#7814 RunWafRealisticBenchmarkWithAttack net472 315μs 29.1ns 109ns 0 0 0 2.29 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 60.6μs 107ns 384ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.5μs 223ns 865ns 0 0 0 17.42 KB
master SendRequest net472 0.000335ns 0.000235ns 0.00091ns 0 0 0 0 b
#7814 SendRequest net6.0 61.2μs 42.9ns 166ns 0 0 0 14.52 KB
#7814 SendRequest netcoreapp3.1 71.8μs 92.4ns 358ns 0 0 0 17.42 KB
#7814 SendRequest net472 0.00338ns 0.00147ns 0.0057ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7814

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 4 B 2 B -2 B -50.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 73 B 0 b -73 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 47 B 0 b -47 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.92ms 249ns 896ns 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.1ms 1.88μs 6.77μs 0 0 0 640 KB
master OriginalCharSlice net472 2.64ms 230ns 891ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.35ms 644ns 2.49μs 0 0 0 6 B
master OptimizedCharSlice netcoreapp3.1 1.66ms 390ns 1.46μs 0 0 0 1 B
master OptimizedCharSlice net472 1.98ms 1.01μs 3.92μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 846μs 33ns 123ns 0 0 0 4 B
master OptimizedCharSliceWithPool netcoreapp3.1 836μs 76.4ns 275ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.15ms 81.9ns 306ns 0 0 0 47 B
#7814 OriginalCharSlice net6.0 1.89ms 1.21μs 4.68μs 0 0 0 640.04 KB
#7814 OriginalCharSlice netcoreapp3.1 2.19ms 11μs 50.3μs 0 0 0 640 KB
#7814 OriginalCharSlice net472 2.65ms 464ns 1.74μs 100 0 0 641.95 KB
#7814 OptimizedCharSlice net6.0 1.41ms 367ns 1.42μs 0 0 0 6 B
#7814 OptimizedCharSlice netcoreapp3.1 1.7ms 249ns 964ns 0 0 0 1 B
#7814 OptimizedCharSlice net472 1.97ms 272ns 1.05μs 0 0 0 0 b
#7814 OptimizedCharSliceWithPool net6.0 871μs 17ns 65.7ns 0 0 0 2 B
#7814 OptimizedCharSliceWithPool netcoreapp3.1 929μs 353ns 1.27μs 0 0 0 0 b
#7814 OptimizedCharSliceWithPool net472 1.15ms 131ns 507ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7814

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.51 KB 41.78 KB 275 B 0.66%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 671μs 761ns 2.95μs 0 0 0 41.51 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 679μs 3.64μs 20.6μs 0 0 0 41.95 KB
master WriteAndFlushEnrichedTraces net472 868μs 3.64μs 14.1μs 8.33 0 0 55.95 KB
#7814 WriteAndFlushEnrichedTraces net6.0 677μs 274ns 948ns 0 0 0 41.78 KB
#7814 WriteAndFlushEnrichedTraces netcoreapp3.1 763μs 4.21μs 27μs 0 0 0 41.77 KB
#7814 WriteAndFlushEnrichedTraces net472 894μs 3.08μs 11.9μs 8.33 0 0 55.98 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.89μs 5.95ns 22.3ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.76μs 8.16ns 31.6ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.82μs 4.44ns 17.2ns 0.156 0.0142 0 987 B
#7814 ExecuteNonQuery net6.0 1.94μs 2.88ns 11.2ns 0 0 0 1.02 KB
#7814 ExecuteNonQuery netcoreapp3.1 2.81μs 1.83ns 6.85ns 0 0 0 1.02 KB
#7814 ExecuteNonQuery net472 2.8μs 2.83ns 11ns 0.155 0.0141 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.76μs 9.38ns 46.9ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.2μs 10.4ns 41.4ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.51μs 3.45ns 13.3ns 0.159 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.82μs 7.33ns 27.4ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.41μs 12.5ns 61ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.78μs 5.13ns 19.2ns 0.17 0 0 1.1 KB
#7814 CallElasticsearch net6.0 1.69μs 7.87ns 32.5ns 0 0 0 1.03 KB
#7814 CallElasticsearch netcoreapp3.1 2.22μs 10.4ns 40.4ns 0 0 0 1.03 KB
#7814 CallElasticsearch net472 3.52μs 4.35ns 16.8ns 0.161 0 0 1.04 KB
#7814 CallElasticsearchAsync net6.0 1.83μs 5.02ns 19.5ns 0 0 0 1.01 KB
#7814 CallElasticsearchAsync netcoreapp3.1 2.43μs 11.5ns 44.7ns 0 0 0 1.08 KB
#7814 CallElasticsearchAsync net472 3.57μs 3.5ns 13.5ns 0.16 0 0 1.1 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.82μs 8.48ns 33.9ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.47μs 9.97ns 38.6ns 0 0 0 952 B
master ExecuteAsync net472 2.63μs 5.25ns 20.3ns 0.145 0 0 915 B
#7814 ExecuteAsync net6.0 1.83μs 6.69ns 25ns 0 0 0 952 B
#7814 ExecuteAsync netcoreapp3.1 2.46μs 7.79ns 30.2ns 0 0 0 952 B
#7814 ExecuteAsync net472 2.64μs 6.88ns 26.6ns 0.144 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 7.02μs 11.9ns 46.1ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.93μs 27.3ns 106ns 0 0 0 2.9 KB
master SendAsync net472 12.1μs 11.9ns 44.5ns 0.484 0 0 3.18 KB
#7814 SendAsync net6.0 6.98μs 16.1ns 62.5ns 0 0 0 2.36 KB
#7814 SendAsync netcoreapp3.1 8.55μs 7.21ns 27ns 0 0 0 2.9 KB
#7814 SendAsync net472 12.2μs 8.83ns 34.2ns 0.486 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7814

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 278.53 KB 275.65 KB -2.88 KB -1.03%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 273.62 KB 257.63 KB -15.99 KB -5.84%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 274.88 KB 258.44 KB -16.44 KB -5.98%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 41.3μs 218ns 1.07μs 0 0 0 43.84 KB
master StringConcatBenchmark netcoreapp3.1 48.5μs 238ns 1.01μs 0 0 0 42.71 KB
master StringConcatBenchmark net472 56.7μs 298ns 1.43μs 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 459μs 1.84μs 6.65μs 0 0 0 273.62 KB
master StringConcatAspectBenchmark netcoreapp3.1 512μs 2.26μs 8.14μs 0 0 0 274.88 KB
master StringConcatAspectBenchmark net472 406μs 1.96μs 7.58μs 0 0 0 278.53 KB
#7814 StringConcatBenchmark net6.0 42μs 218ns 1.62μs 0 0 0 43.81 KB
#7814 StringConcatBenchmark netcoreapp3.1 50μs 327ns 3.11μs 0 0 0 42.9 KB
#7814 StringConcatBenchmark net472 56.6μs 81ns 292ns 0 0 0 57.34 KB
#7814 StringConcatAspectBenchmark net6.0 474μs 2.49μs 12.7μs 0 0 0 257.63 KB
#7814 StringConcatAspectBenchmark netcoreapp3.1 502μs 1.76μs 6.09μs 0 0 0 258.44 KB
#7814 StringConcatAspectBenchmark net472 405μs 2.16μs 11.6μs 0 0 0 275.65 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 2.66μs 1.15ns 4.31ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.64μs 3.42ns 12.8ns 0 0 0 1.7 KB
master EnrichedLog net472 3.89μs 4.54ns 17.6ns 0.252 0 0 1.64 KB
#7814 EnrichedLog net6.0 2.65μs 12.6ns 48.9ns 0 0 0 1.7 KB
#7814 EnrichedLog netcoreapp3.1 3.54μs 13.1ns 50.6ns 0 0 0 1.7 KB
#7814 EnrichedLog net472 3.86μs 6.79ns 26.3ns 0.251 0 0 1.64 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 123μs 202ns 757ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 126μs 121ns 454ns 0 0 0 4.31 KB
master EnrichedLog net472 166μs 79.8ns 299ns 0 0 0 4.51 KB
#7814 EnrichedLog net6.0 123μs 177ns 638ns 0 0 0 4.31 KB
#7814 EnrichedLog netcoreapp3.1 129μs 175ns 654ns 0 0 0 4.31 KB
#7814 EnrichedLog net472 168μs 124ns 478ns 0 0 0 4.52 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 4.88μs 17.6ns 68.1ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.79μs 19.4ns 72.5ns 0 0 0 2.26 KB
master EnrichedLog net472 7.47μs 3.67ns 13.7ns 0.299 0 0 2.08 KB
#7814 EnrichedLog net6.0 4.94μs 18.2ns 70.4ns 0 0 0 2.26 KB
#7814 EnrichedLog netcoreapp3.1 6.87μs 19.2ns 74.5ns 0 0 0 2.26 KB
#7814 EnrichedLog net472 7.49μs 5.46ns 21.2ns 0.298 0 0 2.08 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.97μs 9.51ns 46.6ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.64μs 12.9ns 56.4ns 0 0 0 1.2 KB
master SendReceive net472 3.1μs 3.65ns 14.1ns 0.187 0 0 1.2 KB
#7814 SendReceive net6.0 1.96μs 10.5ns 54.3ns 0 0 0 1.2 KB
#7814 SendReceive netcoreapp3.1 2.55μs 12.7ns 53.9ns 0 0 0 1.2 KB
#7814 SendReceive net472 3.03μs 4.94ns 19.1ns 0.182 0 0 1.2 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 4.18μs 7.18ns 26.9ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.62μs 20.3ns 78.5ns 0 0 0 1.63 KB
master EnrichedLog net472 6.83μs 4.88ns 17.6ns 0.309 0 0 2.03 KB
#7814 EnrichedLog net6.0 4.31μs 19.5ns 72.8ns 0 0 0 1.58 KB
#7814 EnrichedLog netcoreapp3.1 5.55μs 13.1ns 50.7ns 0 0 0 1.63 KB
#7814 EnrichedLog net472 6.64μs 9.15ns 35.4ns 0.297 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 787ns 0.21ns 0.785ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 987ns 4.68ns 18.1ns 0 0 0 576 B
master StartFinishSpan net472 961ns 0.438ns 1.64ns 0.0909 0 0 578 B
master StartFinishScope net6.0 905ns 3.68ns 13.3ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.2μs 0.91ns 3.53ns 0 0 0 696 B
master StartFinishScope net472 1.14μs 0.245ns 0.918ns 0.103 0 0 658 B
#7814 StartFinishSpan net6.0 773ns 0.221ns 0.798ns 0 0 0 576 B
#7814 StartFinishSpan netcoreapp3.1 968ns 5.01ns 24ns 0 0 0 576 B
#7814 StartFinishSpan net472 947ns 0.164ns 0.591ns 0.0903 0 0 578 B
#7814 StartFinishScope net6.0 913ns 4.98ns 28.6ns 0 0 0 696 B
#7814 StartFinishScope netcoreapp3.1 1.21μs 5.47ns 21.2ns 0 0 0 696 B
#7814 StartFinishScope net472 1.13μs 0.606ns 2.35ns 0.102 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 1.05μs 0.819ns 3.17ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.44μs 6.76ns 27ns 0 0 0 696 B
master RunOnMethodBegin net472 1.47μs 0.894ns 3.46ns 0.102 0 0 658 B
#7814 RunOnMethodBegin net6.0 1.09μs 0.808ns 3.13ns 0 0 0 696 B
#7814 RunOnMethodBegin netcoreapp3.1 1.43μs 0.914ns 3.54ns 0 0 0 696 B
#7814 RunOnMethodBegin net472 1.46μs 2.1ns 8.11ns 0.101 0 0 658 B

@datadog-datadog-prod-us1

This comment has been minimized.

…means we can revert some of the changes introduced in the intermediate commits
@zacharycmontoya zacharycmontoya merged commit 2884c97 into master Nov 14, 2025
153 checks passed
@zacharycmontoya zacharycmontoya deleted the zach.montoya/fix-logs-timestamp branch November 14, 2025 01:34
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 14, 2025
@NachoEchevarria NachoEchevarria added the area:opentelemetry OpenTelemetry support label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:opentelemetry OpenTelemetry support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants