[Logs] Fix OTLP Logs timestamp during serialization#7814
[Logs] Fix OTLP Logs timestamp during serialization#7814zacharycmontoya merged 3 commits intomasterfrom
Conversation
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
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7814) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.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
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
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
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
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
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
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
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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7814 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Fewer allocations 🎉
|
| 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
| 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%
| 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%
| 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%
| 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 |
This comment has been minimized.
This comment has been minimized.
…means we can revert some of the changes introduced in the intermediate commits
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
Timestampproperty ofDatadog.Trace.OpenTelemetry.Logs.LogPointto have typeDateTimeOffsetinstead ofDateTimeso we're always dealing with a UTC time, and initialize the value toDateTimeOffset.UtcNowTimeExtensions.ToUnixTimeNanoseconds, which is already used for serializing timestamps for Metrics and TracesTest coverage
Add a regression test in
OpenTelemetrySdkTests.SubmitsOtlpLogsby 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