Skip to content

Updates to libdatadog logging integration #7084

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

Open
wants to merge 4 commits into
base: ganeshnj/feat/libdd-logger
Choose a base branch
from

Conversation

andrewlock
Copy link
Member

Summary of changes

Address my comments in #7075

Reason for change

Implementation details

Test coverage

Other details

@andrewlock andrewlock requested a review from a team as a code owner June 10, 2025 12:33
@andrewlock andrewlock added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) libdatadog Updates to the libdatadog library and Rust integration labels Jun 10, 2025
@@ -17,10 +18,16 @@ internal readonly struct FFIVec
internal readonly nuint Length;
internal readonly nuint Capacity;

public byte[] ToByteArray()
public string ToUtf8String()
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this method is ok, and removes the additional copy, but would be glad if someone could confirm 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@ganeshnj ganeshnj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for taking care of this.

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jun 10, 2025

Datadog Report

All test runs 90385db 🔗

2 Total Test Services: 0 Failed, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Test Service View
dd-trace-dotnet 0 0 0 255509 2491 18h 8m 50.94s Link
exploration_tests 0 0 0 22085 3 2m 23.75s Link

@andrewlock
Copy link
Member Author

andrewlock commented Jun 10, 2025

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.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7084) - mean (68ms)  : 66, 70
     .   : milestone, 68,
    master - mean (69ms)  : 65, 73
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (7084) - mean (1,003ms)  : 983, 1022
     .   : milestone, 1003,
    master - mean (1,011ms)  : 983, 1038
     .   : milestone, 1011,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7084) - mean (102ms)  : 99, 104
     .   : milestone, 102,
    master - mean (103ms)  : 101, 105
     .   : milestone, 103,

    section CallTarget+Inlining+NGEN
    This PR (7084) - mean (690ms)  : 673, 708
     .   : milestone, 690,
    master - mean (740ms)  : 625, 854
     .   : milestone, 740,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7084) - mean (89ms)  : 86, 92
     .   : milestone, 89,
    master - mean (99ms)  : 69, 129
     .   : milestone, 99,

    section CallTarget+Inlining+NGEN
    This PR (7084) - mean (653ms)  : 632, 673
     .   : milestone, 653,
    master - mean (676ms)  : 640, 713
     .   : milestone, 676,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7084) - mean (188ms)  : 185, 191
     .   : milestone, 188,
    master - mean (189ms)  : 185, 193
     .   : milestone, 189,

    section CallTarget+Inlining+NGEN
    This PR (7084) - mean (1,104ms)  : 1077, 1131
     .   : milestone, 1104,
    master - mean (1,108ms)  : 1078, 1138
     .   : milestone, 1108,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7084) - mean (267ms)  : 263, 272
     .   : milestone, 267,
    master - mean (267ms)  : 264, 270
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (7084) - mean (876ms)  : 853, 899
     .   : milestone, 876,
    master - mean (888ms)  : 844, 931
     .   : milestone, 888,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (7084) - mean (260ms)  : 256, 265
     .   : milestone, 260,
    master - mean (260ms)  : 257, 264
     .   : milestone, 260,

    section CallTarget+Inlining+NGEN
    This PR (7084) - mean (865ms)  : 828, 902
     .   : milestone, 865,
    master - mean (873ms)  : 843, 902
     .   : milestone, 873,

Loading

@andrewlock andrewlock force-pushed the andrew/libdd-logger-updates branch from 2b0e3d2 to 2b5e2d6 Compare June 10, 2025 16:10
@pr-commenter
Copy link

pr-commenter bot commented Jun 10, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7084 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.212
  • 39 benchmarks have fewer allocations
  • 7 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 #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.09 KB 6.05 KB -33 B -0.54%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net6.0 5.58 KB 5.47 KB -104 B -1.86%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 11.2μs 59.7ns 322ns 0 0 0 5.58 KB
master StartStopWithChild netcoreapp3.1 14.1μs 67.5ns 286ns 0 0 0 5.75 KB
master StartStopWithChild net472 22.1μs 119ns 651ns 1.03 0.411 0.103 6.09 KB
#7084 StartStopWithChild net6.0 10.7μs 59.8ns 388ns 0 0 0 5.47 KB
#7084 StartStopWithChild netcoreapp3.1 13.8μs 70.1ns 321ns 0 0 0 5.73 KB
#7084 StartStopWithChild net472 22.2μs 119ns 621ns 0.931 0.233 0 6.05 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.33 KB 3.35 KB 23 B 0.69%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 927μs 26.6ns 103ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 404ns 1.56μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.25ms 357ns 1.38μs 0 0 0 3.33 KB
#7084 WriteAndFlushEnrichedTraces net6.0 926μs 117ns 452ns 0 0 0 2.71 KB
#7084 WriteAndFlushEnrichedTraces netcoreapp3.1 1.04ms 79.5ns 298ns 0 0 0 2.7 KB
#7084 WriteAndFlushEnrichedTraces net472 1.23ms 783ns 3.03μs 0 0 0 3.35 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net472 236.35 KB 239.64 KB 3.28 KB 1.39%
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 239.87 KB 243.15 KB 3.28 KB 1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 331μs 1.76μs 8.42μs 0 0 0 197.06 KB
master AllCycleSimpleBody netcoreapp3.1 510μs 1.45μs 5.61μs 0 0 0 204.77 KB
master AllCycleSimpleBody net472 436μs 119ns 460ns 36.6 2.16 0 236.35 KB
master AllCycleMoreComplexBody net6.0 338μs 1.76μs 8.8μs 0 0 0 200.56 KB
master AllCycleMoreComplexBody netcoreapp3.1 495μs 987ns 3.56μs 0 0 0 208.18 KB
master AllCycleMoreComplexBody net472 446μs 106ns 412ns 36.6 2.16 0 239.87 KB
master ObjectExtractorSimpleBody net6.0 311ns 1.77ns 12.3ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 409ns 1.93ns 8.2ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 303ns 0.175ns 0.676ns 0.0442 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.52μs 29.5ns 110ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.76μs 36.2ns 140ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.66μs 0.89ns 3.33ns 0.599 0 0 3.8 KB
#7084 AllCycleSimpleBody net6.0 328μs 1.36μs 5.26μs 0 0 0 197.59 KB
#7084 AllCycleSimpleBody netcoreapp3.1 475μs 1.91μs 7.4μs 0 0 0 205.35 KB
#7084 AllCycleSimpleBody net472 442μs 122ns 472ns 36.6 2.16 0 239.64 KB
#7084 AllCycleMoreComplexBody net6.0 337μs 103ns 397ns 0 0 0 201.1 KB
#7084 AllCycleMoreComplexBody netcoreapp3.1 494μs 310ns 1.16μs 0 0 0 208.77 KB
#7084 AllCycleMoreComplexBody net472 455μs 308ns 1.19μs 37.9 2.23 0 243.15 KB
#7084 ObjectExtractorSimpleBody net6.0 318ns 0.119ns 0.462ns 0 0 0 280 B
#7084 ObjectExtractorSimpleBody netcoreapp3.1 406ns 2.14ns 10.7ns 0 0 0 272 B
#7084 ObjectExtractorSimpleBody net472 310ns 0.0501ns 0.194ns 0.0446 0 0 281 B
#7084 ObjectExtractorMoreComplexBody net6.0 6.4μs 2.61ns 10.1ns 0 0 0 3.78 KB
#7084 ObjectExtractorMoreComplexBody netcoreapp3.1 7.8μs 24.6ns 91.9ns 0 0 0 3.69 KB
#7084 ObjectExtractorMoreComplexBody net472 6.82μs 2.65ns 10.3ns 0.578 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs‑net6.0 2.16 KB 2.14 KB -12 B -0.56%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 73.3μs 263ns 984ns 0 0 0 32.41 KB
master EncodeArgs netcoreapp3.1 95.7μs 36.2ns 130ns 0 0 0 32.4 KB
master EncodeArgs net472 107μs 17.6ns 65.8ns 4.82 0 0 32.51 KB
master EncodeLegacyArgs net6.0 143μs 122ns 472ns 0 0 0 2.16 KB
master EncodeLegacyArgs netcoreapp3.1 197μs 42.5ns 147ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 261μs 66.8ns 250ns 0 0 0 2.16 KB
#7084 EncodeArgs net6.0 73μs 40.1ns 150ns 0 0 0 32.4 KB
#7084 EncodeArgs netcoreapp3.1 93.1μs 142ns 549ns 0 0 0 32.4 KB
#7084 EncodeArgs net472 105μs 109ns 409ns 4.73 0 0 32.51 KB
#7084 EncodeLegacyArgs net6.0 148μs 60.5ns 234ns 0 0 0 2.14 KB
#7084 EncodeLegacyArgs netcoreapp3.1 196μs 148ns 553ns 0 0 0 2.14 KB
#7084 EncodeLegacyArgs net472 263μs 32.2ns 120ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 271μs 133ns 499ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 294μs 264ns 989ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 307μs 38.1ns 147ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 181μs 80.1ns 300ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 198μs 104ns 404ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 207μs 45.3ns 169ns 0 0 0 2.28 KB
#7084 RunWafRealisticBenchmark net6.0 271μs 57.8ns 216ns 0 0 0 4.55 KB
#7084 RunWafRealisticBenchmark netcoreapp3.1 291μs 171ns 661ns 0 0 0 4.48 KB
#7084 RunWafRealisticBenchmark net472 307μs 69.6ns 270ns 0 0 0 4.66 KB
#7084 RunWafRealisticBenchmarkWithAttack net6.0 181μs 43.2ns 167ns 0 0 0 2.24 KB
#7084 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 195μs 85.8ns 332ns 0 0 0 2.22 KB
#7084 RunWafRealisticBenchmarkWithAttack net472 207μs 27.8ns 104ns 0 0 0 2.28 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 61.1μs 29ns 104ns 0 0 0 14.53 KB
master SendRequest netcoreapp3.1 69.9μs 118ns 440ns 0 0 0 17.42 KB
master SendRequest net472 0.0171ns 0.00147ns 0.00551ns 0 0 0 0 b
#7084 SendRequest net6.0 61.5μs 51.6ns 186ns 0 0 0 14.52 KB
#7084 SendRequest netcoreapp3.1 71.3μs 107ns 386ns 0 0 0 17.43 KB
#7084 SendRequest net472 0.0188ns 0.00238ns 0.00922ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 55.75 KB 56.36 KB 602 B 1.08%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.89 KB 42.29 KB 406 B 0.97%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 645μs 512ns 1.98μs 0 0 0 41.73 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 631μs 1.67μs 6.67μs 0 0 0 41.89 KB
master WriteAndFlushEnrichedTraces net472 923μs 1.93μs 7.2μs 4.46 0 0 55.75 KB
#7084 WriteAndFlushEnrichedTraces net6.0 670μs 2.86μs 10.7μs 0 0 0 41.78 KB
#7084 WriteAndFlushEnrichedTraces netcoreapp3.1 671μs 3.13μs 12.5μs 0 0 0 42.29 KB
#7084 WriteAndFlushEnrichedTraces net472 898μs 4.36μs 18.5μs 8.33 4.17 0 56.36 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.03 KB 1.02 KB -8 B -0.78%
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑netcoreapp3.1 1.02 KB 1.02 KB -8 B -0.78%
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net472 995 B 987 B -8 B -0.80%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.99μs 10.2ns 46.8ns 0 0 0 1.03 KB
master ExecuteNonQuery netcoreapp3.1 2.53μs 3.43ns 13.3ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.7μs 2.41ns 9.34ns 0.147 0.0134 0 995 B
#7084 ExecuteNonQuery net6.0 1.9μs 9.53ns 40.4ns 0 0 0 1.02 KB
#7084 ExecuteNonQuery netcoreapp3.1 2.58μs 3.68ns 14.3ns 0 0 0 1.02 KB
#7084 ExecuteNonQuery net472 2.78μs 4.04ns 15.7ns 0.152 0.0138 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net472 1.11 KB 1.1 KB -8 B -0.72%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑netcoreapp3.1 1.09 KB 1.08 KB -8 B -0.74%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net472 1.05 KB 1.04 KB -8 B -0.76%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑net6.0 1.04 KB 1.03 KB -8 B -0.77%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch‑netcoreapp3.1 1.04 KB 1.03 KB -8 B -0.77%
Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync‑net6.0 1.02 KB 1.01 KB -8 B -0.79%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.83μs 5.85ns 22.7ns 0 0 0 1.04 KB
master CallElasticsearch netcoreapp3.1 2.3μs 11.8ns 56.6ns 0 0 0 1.04 KB
master CallElasticsearch net472 3.55μs 3.05ns 11.8ns 0.159 0 0 1.05 KB
master CallElasticsearchAsync net6.0 1.81μs 3.89ns 14.5ns 0 0 0 1.02 KB
master CallElasticsearchAsync netcoreapp3.1 2.35μs 7.26ns 28.1ns 0 0 0 1.09 KB
master CallElasticsearchAsync net472 3.84μs 3.19ns 12.4ns 0.169 0 0 1.11 KB
#7084 CallElasticsearch net6.0 1.81μs 9.03ns 41.4ns 0 0 0 1.03 KB
#7084 CallElasticsearch netcoreapp3.1 2.43μs 7.97ns 30.9ns 0 0 0 1.03 KB
#7084 CallElasticsearch net472 3.64μs 3.71ns 14.4ns 0.165 0 0 1.04 KB
#7084 CallElasticsearchAsync net6.0 1.83μs 2.18ns 8.46ns 0 0 0 1.01 KB
#7084 CallElasticsearchAsync netcoreapp3.1 2.44μs 1.7ns 6.58ns 0 0 0 1.08 KB
#7084 CallElasticsearchAsync net472 3.71μs 3.11ns 12ns 0.168 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 960 B 952 B -8 B -0.83%
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 960 B 952 B -8 B -0.83%
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net472 923 B 915 B -8 B -0.87%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.78μs 9.27ns 43.5ns 0 0 0 960 B
master ExecuteAsync netcoreapp3.1 2.29μs 7.45ns 25.8ns 0 0 0 960 B
master ExecuteAsync net472 2.58μs 1.78ns 6.88ns 0.143 0 0 923 B
#7084 ExecuteAsync net6.0 1.98μs 1.16ns 4.48ns 0 0 0 952 B
#7084 ExecuteAsync netcoreapp3.1 2.33μs 4.72ns 17.7ns 0 0 0 952 B
#7084 ExecuteAsync net472 2.66μs 3.74ns 14.5ns 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.1μs 10.4ns 39ns 0 0 0 2.37 KB
master SendAsync netcoreapp3.1 8.69μs 14.1ns 54.6ns 0 0 0 2.9 KB
master SendAsync net472 12.5μs 10.3ns 38.5ns 0.498 0 0 3.19 KB
#7084 SendAsync net6.0 6.85μs 10.6ns 39.7ns 0 0 0 2.36 KB
#7084 SendAsync netcoreapp3.1 8.86μs 28.8ns 112ns 0 0 0 2.9 KB
#7084 SendAsync net472 12.8μs 12.5ns 48.3ns 0.445 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7084

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 1.270 413,700.00 525,300.00

More allocations ⚠️ in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 259.96 KB 279.61 KB 19.65 KB 7.56%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 42.64 KB 43.09 KB 448 B 1.05%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 44.6μs 212ns 1.6μs 0 0 0 43.83 KB
master StringConcatBenchmark netcoreapp3.1 47.2μs 224ns 838ns 0 0 0 42.64 KB
master StringConcatBenchmark net472 56.8μs 259ns 968ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 458μs 1.08μs 3.89μs 0 0 0 259.96 KB
master StringConcatAspectBenchmark netcoreapp3.1 447μs 6.44μs 63.7μs 0 0 0 274.93 KB
master StringConcatAspectBenchmark net472 410μs 2.07μs 9.27μs 0 0 0 286.72 KB
#7084 StringConcatBenchmark net6.0 44.1μs 209ns 980ns 0 0 0 43.85 KB
#7084 StringConcatBenchmark netcoreapp3.1 54.6μs 671ns 6.54μs 0 0 0 43.09 KB
#7084 StringConcatBenchmark net472 56.7μs 173ns 647ns 0 0 0 57.34 KB
#7084 StringConcatAspectBenchmark net6.0 505μs 1.79μs 6.2μs 0 0 0 279.61 KB
#7084 StringConcatAspectBenchmark netcoreapp3.1 529μs 2.59μs 10.7μs 0 0 0 276.02 KB
#7084 StringConcatAspectBenchmark net472 411μs 1.96μs 7.83μs 0 0 0 286.72 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net6.0 1.76 KB 1.7 KB -56 B -3.18%
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑netcoreapp3.1 1.76 KB 1.7 KB -56 B -3.18%
Benchmarks.Trace.ILoggerBenchmark.EnrichedLog‑net472 1.69 KB 1.64 KB -56 B -3.31%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.63μs 2.6ns 10.1ns 0 0 0 1.76 KB
master EnrichedLog netcoreapp3.1 3.44μs 4.38ns 17ns 0 0 0 1.76 KB
master EnrichedLog net472 4.05μs 4.83ns 18.7ns 0.265 0 0 1.69 KB
#7084 EnrichedLog net6.0 2.55μs 1.53ns 5.73ns 0 0 0 1.7 KB
#7084 EnrichedLog netcoreapp3.1 3.45μs 17.7ns 79ns 0 0 0 1.7 KB
#7084 EnrichedLog net472 3.87μs 4.78ns 18.5ns 0.251 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑net472 4.57 KB 4.52 KB -55 B -1.20%
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑netcoreapp3.1 4.37 KB 4.31 KB -57 B -1.30%
Benchmarks.Trace.Log4netBenchmark.EnrichedLog‑net6.0 4.37 KB 4.31 KB -58 B -1.33%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 123μs 145ns 563ns 0 0 0 4.37 KB
master EnrichedLog netcoreapp3.1 126μs 330ns 1.24μs 0 0 0 4.37 KB
master EnrichedLog net472 167μs 161ns 603ns 0 0 0 4.57 KB
#7084 EnrichedLog net6.0 123μs 61.3ns 221ns 0 0 0 4.31 KB
#7084 EnrichedLog netcoreapp3.1 127μs 62.7ns 226ns 0 0 0 4.31 KB
#7084 EnrichedLog net472 166μs 44.6ns 173ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net6.0 2.32 KB 2.26 KB -56 B -2.41%
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑netcoreapp3.1 2.32 KB 2.26 KB -56 B -2.41%
Benchmarks.Trace.NLogBenchmark.EnrichedLog‑net472 2.14 KB 2.08 KB -56 B -2.62%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.94μs 19.3ns 74.6ns 0 0 0 2.32 KB
master EnrichedLog netcoreapp3.1 6.77μs 22.2ns 79.9ns 0 0 0 2.32 KB
master EnrichedLog net472 7.45μs 8.04ns 31.1ns 0.335 0 0 2.14 KB
#7084 EnrichedLog net6.0 5.01μs 19.2ns 74.5ns 0 0 0 2.26 KB
#7084 EnrichedLog netcoreapp3.1 6.73μs 15.5ns 59.9ns 0 0 0 2.26 KB
#7084 EnrichedLog net472 7.67μs 6.26ns 24.2ns 0.309 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.RedisBenchmark.SendReceive‑net472 1.21 KB 1.2 KB -8 B -0.66%
Benchmarks.Trace.RedisBenchmark.SendReceive‑net6.0 1.21 KB 1.2 KB -8 B -0.66%
Benchmarks.Trace.RedisBenchmark.SendReceive‑netcoreapp3.1 1.21 KB 1.2 KB -8 B -0.66%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2.04μs 10.5ns 49.4ns 0 0 0 1.21 KB
master SendReceive netcoreapp3.1 2.53μs 11.8ns 47.4ns 0 0 0 1.21 KB
master SendReceive net472 3.28μs 2.71ns 10.5ns 0.178 0 0 1.21 KB
#7084 SendReceive net6.0 2.03μs 9.63ns 37.3ns 0 0 0 1.2 KB
#7084 SendReceive netcoreapp3.1 2.66μs 13.1ns 57.2ns 0 0 0 1.2 KB
#7084 SendReceive net472 3.14μs 4ns 15.5ns 0.189 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑net472 2.08 KB 2.03 KB -56 B -2.69%
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑netcoreapp3.1 1.69 KB 1.63 KB -56 B -3.32%
Benchmarks.Trace.SerilogBenchmark.EnrichedLog‑net6.0 1.64 KB 1.58 KB -56 B -3.41%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.18μs 0.92ns 3.44ns 0 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 5.64μs 23ns 89.3ns 0 0 0 1.69 KB
master EnrichedLog net472 6.67μs 7.28ns 27.3ns 0.298 0 0 2.08 KB
#7084 EnrichedLog net6.0 4.16μs 2.8ns 10.8ns 0 0 0 1.58 KB
#7084 EnrichedLog netcoreapp3.1 5.48μs 16ns 61.9ns 0 0 0 1.63 KB
#7084 EnrichedLog net472 6.55μs 10.3ns 39.9ns 0.294 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 704 B 696 B -8 B -1.14%
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑netcoreapp3.1 704 B 696 B -8 B -1.14%
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net472 666 B 658 B -8 B -1.20%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 586 B 578 B -8 B -1.37%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 584 B 576 B -8 B -1.37%
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑netcoreapp3.1 584 B 576 B -8 B -1.37%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 751ns 3.97ns 22.4ns 0 0 0 584 B
master StartFinishSpan netcoreapp3.1 953ns 4.42ns 17.7ns 0 0 0 584 B
master StartFinishSpan net472 914ns 0.809ns 3.13ns 0.0912 0 0 586 B
master StartFinishScope net6.0 918ns 0.479ns 1.73ns 0 0 0 704 B
master StartFinishScope netcoreapp3.1 1.15μs 6.24ns 34.2ns 0 0 0 704 B
master StartFinishScope net472 1.09μs 0.174ns 0.652ns 0.104 0 0 666 B
#7084 StartFinishSpan net6.0 748ns 3.6ns 15.3ns 0 0 0 576 B
#7084 StartFinishSpan netcoreapp3.1 945ns 4.57ns 17.7ns 0 0 0 576 B
#7084 StartFinishSpan net472 927ns 0.0686ns 0.247ns 0.088 0 0 578 B
#7084 StartFinishScope net6.0 910ns 0.514ns 1.99ns 0 0 0 696 B
#7084 StartFinishScope netcoreapp3.1 1.14μs 6.12ns 32.4ns 0 0 0 696 B
#7084 StartFinishScope net472 1.1μs 0.188ns 0.727ns 0.0997 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Fewer allocations 🎉

Slower ⚠️ in #7084

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.157 1,373.36 1,589.45

Fewer allocations 🎉 in #7084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 704 B 696 B -8 B -1.14%
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 704 B 696 B -8 B -1.14%
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 666 B 658 B -8 B -1.20%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.02μs 5.36ns 26.8ns 0 0 0 704 B
master RunOnMethodBegin netcoreapp3.1 1.38μs 2.28ns 8.82ns 0 0 0 704 B
master RunOnMethodBegin net472 1.36μs 0.141ns 0.544ns 0.102 0 0 666 B
#7084 RunOnMethodBegin net6.0 1.05μs 5.55ns 27.7ns 0 0 0 696 B
#7084 RunOnMethodBegin netcoreapp3.1 1.58μs 8.13ns 36.4ns 0 0 0 696 B
#7084 RunOnMethodBegin net472 1.42μs 1.24ns 4.8ns 0.0994 0 0 658 B

@andrewlock andrewlock requested a review from a team as a code owner June 11, 2025 08:46
@andrewlock andrewlock force-pushed the andrew/libdd-logger-updates branch 5 times, most recently from f186b70 to 4a81a0a Compare June 17, 2025 09:26
@andrewlock andrewlock requested review from a team as code owners June 17, 2025 09:26
@andrewlock andrewlock force-pushed the ganeshnj/feat/libdd-logger branch from e817c37 to 011895f Compare June 17, 2025 09:26
@andrewlock andrewlock force-pushed the andrew/libdd-logger-updates branch from 4a81a0a to 719a4e8 Compare June 17, 2025 09:41
@andrewlock andrewlock force-pushed the andrew/libdd-logger-updates branch from 719a4e8 to 70c4fe3 Compare June 17, 2025 11:04
@andrewlock andrewlock force-pushed the ganeshnj/feat/libdd-logger branch from 269525f to e310b02 Compare June 17, 2025 11:04
@andrewlock andrewlock force-pushed the andrew/libdd-logger-updates branch from 70c4fe3 to 30282e8 Compare June 17, 2025 12:28
@andrewlock andrewlock force-pushed the ganeshnj/feat/libdd-logger branch from e310b02 to 3388f68 Compare June 17, 2025 12:28
andrewlock added a commit that referenced this pull request Jun 20, 2025
## Summary of changes

- Simplify the copying of libdatadog for tests
- Minor changes to the serilog logger to allow subsequent usage by
libdatadog

## Reason for change

Prerequistes for #7075

## Implementation details

- Copy the libdatadog file to all the test output directories
(maintaining a seperate list of projects to copy is redundant, and
ever-increasing.
- Expose `FileLoggingConfiguration` on `DatadogSerilogLogger` (we
already exposed _one_ of the properties, may as well expose it all

## Test coverage

If it builds, we're good

## Other details

Required for 
- #7075
- #7084
@andrewlock andrewlock force-pushed the andrew/libdd-logger-updates branch from 30282e8 to 90385db Compare June 20, 2025 12:55
@andrewlock andrewlock requested a review from a team as a code owner June 20, 2025 12:55
@andrewlock andrewlock force-pushed the ganeshnj/feat/libdd-logger branch from a120b38 to a89663d Compare June 20, 2025 12:55
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) libdatadog Updates to the libdatadog library and Rust integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants