Skip to content

[Tracer] Use peer.service as dddbs for DBM when available#4619

Merged
pablomartinezbernardo merged 4 commits into
masterfrom
dddbs
Sep 25, 2023
Merged

[Tracer] Use peer.service as dddbs for DBM when available#4619
pablomartinezbernardo merged 4 commits into
masterfrom
dddbs

Conversation

@pablomartinezbernardo

@pablomartinezbernardo pablomartinezbernardo commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

Summary of changes

Prioritize peer.service as dddbs for SQL comments when available.

Reason for change

Explanation here.

Test coverage

Unit Test

@andrewlock

andrewlock commented Sep 13, 2023

Copy link
Copy Markdown
Member

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4619) - mean (70ms)  : 64, 77
     .   : milestone, 70,
    master - mean (71ms)  : 61, 82
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (4619) - mean (1,035ms)  : 1008, 1062
     .   : milestone, 1035,
    master - mean (1,040ms)  : 1009, 1070
     .   : milestone, 1040,

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

    section CallTarget+Inlining+NGEN
    This PR (4619) - mean (744ms)  : 730, 759
     .   : milestone, 744,
    master - mean (747ms)  : 723, 772
     .   : milestone, 747,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4619) - mean (90ms)  : 84, 95
     .   : milestone, 90,
    master - mean (90ms)  : 86, 94
     .   : milestone, 90,

    section CallTarget+Inlining+NGEN
    This PR (4619) - mean (708ms)  : 689, 727
     .   : milestone, 708,
    master - mean (712ms)  : 697, 727
     .   : milestone, 712,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4619) - mean (184ms)  : 177, 191
     .   : milestone, 184,
    master - mean (185ms)  : 179, 192
     .   : milestone, 185,

    section CallTarget+Inlining+NGEN
    This PR (4619) - mean (1,119ms)  : 1090, 1149
     .   : milestone, 1119,
    master - mean (1,116ms)  : 1088, 1144
     .   : milestone, 1116,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4619) - mean (266ms)  : 252, 280
     .   : milestone, 266,
    master - mean (265ms)  : 254, 276
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (4619) - mean (1,083ms)  : 1045, 1120
     .   : milestone, 1083,
    master - mean (1,069ms)  : 1035, 1104
     .   : milestone, 1069,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (4619) - mean (262ms)  : 253, 271
     .   : milestone, 262,
    master - mean (256ms)  : 245, 266
     .   : milestone, 256,

    section CallTarget+Inlining+NGEN
    This PR (4619) - mean (1,044ms)  : 1016, 1073
     .   : milestone, 1044,
    master - mean (1,027ms)  : 990, 1064
     .   : milestone, 1027,

Loading

@datadog-ddstaging

datadog-ddstaging Bot commented Sep 13, 2023

Copy link
Copy Markdown

Datadog Report

Branch report: dddbs
Commit report: 7c031ee

❄️ dd-trace-dotnet: 0 Failed, 1 New Flaky, 291806 Passed, 1145 Skipped, 24m 28.9s Wall Time

New Flaky Tests (1)

  • UpdateMemoryLeakCheck - Datadog.Trace.Security.Unit.Tests.WafMemoryTests - Last Failure

    Expand for error
     Expected current to be less than or equal to 841792768L, but found 852058112L.
    

@andrewlock

andrewlock commented Sep 13, 2023

Copy link
Copy Markdown
Member

Throughput/Crank Report:zap:

Throughput results for AspNetCoreSimpleController comparing the following branches/commits:

Cases where throughput results for the PR are worse than latest master (5% drop or greater), results are shown in red.

Note that these results are based on a single point-in-time result for each branch. For full results, see one of the many, many dashboards!

gantt
    title Throughput Linux x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4619) (11.725M)   : 0, 11724559
    master (11.411M)   : 0, 11410575
    benchmarks/2.38.0 (11.532M)   : 0, 11531559
    benchmarks/2.9.0 (11.702M)   : 0, 11701871

    section Automatic
    This PR (4619) (8.230M)   : 0, 8229787
    master (8.029M)   : 0, 8029231
    benchmarks/2.38.0 (8.007M)   : 0, 8006818
    benchmarks/2.9.0 (8.520M)   : 0, 8520094

    section Trace stats
    master (8.282M)   : 0, 8281771
    benchmarks/2.38.0 (8.303M)   : 0, 8302876

    section Manual
    This PR (4619) (10.295M)   : 0, 10294539
    master (10.079M)   : 0, 10078776
    benchmarks/2.38.0 (10.141M)   : 0, 10141358

    section Manual + Automatic
    This PR (4619) (7.842M)   : 0, 7842169
    master (7.468M)   : 0, 7468491
    benchmarks/2.38.0 (7.579M)   : 0, 7579310

    section Version Conflict
    master (6.961M)   : 0, 6960831
    benchmarks/2.38.0 (7.066M)   : 0, 7065978

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4619) (9.513M)   : 0, 9512774
    master (9.571M)   : 0, 9571222
    benchmarks/2.38.0 (9.703M)   : 0, 9703171
    benchmarks/2.9.0 (9.518M)   : 0, 9517755

    section Automatic
    This PR (4619) (6.645M)   : 0, 6644919
    master (6.807M)   : 0, 6806672
    benchmarks/2.38.0 (6.646M)   : 0, 6646287

    section Trace stats
    master (6.909M)   : 0, 6908980
    benchmarks/2.38.0 (6.925M)   : 0, 6925272

    section Manual
    This PR (4619) (8.415M)   : 0, 8414601
    master (8.273M)   : 0, 8273041
    benchmarks/2.38.0 (8.478M)   : 0, 8477667

    section Manual + Automatic
    This PR (4619) (6.380M)   : 0, 6380270
    master (6.317M)   : 0, 6317446
    benchmarks/2.38.0 (6.421M)   : 0, 6421392

    section Version Conflict
    master (5.844M)   : 0, 5844362
    benchmarks/2.38.0 (5.868M)   : 0, 5867854

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4619) (10.553M)   : 0, 10552912
    master (10.521M)   : 0, 10520760
    benchmarks/2.38.0 (10.451M)   : 0, 10451481
    benchmarks/2.9.0 (10.049M)   : 0, 10049044

    section Automatic
    This PR (4619) (7.388M)   : 0, 7387694
    master (7.508M)   : 0, 7507847
    benchmarks/2.38.0 (7.619M)   : 0, 7619144
    benchmarks/2.9.0 (7.760M)   : 0, 7759587

    section Trace stats
    master (7.832M)   : 0, 7832385
    benchmarks/2.38.0 (7.836M)   : 0, 7835831

    section Manual
    This PR (4619) (9.092M)   : 0, 9091536
    master (9.406M)   : 0, 9406090
    benchmarks/2.38.0 (9.548M)   : 0, 9548306

    section Manual + Automatic
    This PR (4619) (7.177M)   : 0, 7176706
    master (7.347M)   : 0, 7346786
    benchmarks/2.38.0 (7.321M)   : 0, 7321222

    section Version Conflict
    master (6.660M)   : 0, 6659668
    benchmarks/2.38.0 (6.644M)   : 0, 6643795

Loading
gantt
    title Throughput Linux x64 (ASM) (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (4619) (7.226M)   : 0, 7226271
    master (7.517M)   : 0, 7517420
    benchmarks/2.38.0 (7.569M)   : 0, 7569264
    benchmarks/2.9.0 (7.723M)   : 0, 7723267

    section No attack
    This PR (4619) (2.087M)   : 0, 2087183
    master (2.170M)   : 0, 2169809
    benchmarks/2.38.0 (2.144M)   : 0, 2144152
    benchmarks/2.9.0 (3.201M)   : 0, 3200507

    section Attack
    This PR (4619) (1.665M)   : 0, 1665249
    master (1.745M)   : 0, 1744808
    benchmarks/2.38.0 (1.726M)   : 0, 1726094
    benchmarks/2.9.0 (2.537M)   : 0, 2536997

    section Blocking
    This PR (4619) (3.299M)   : 0, 3299132
    master (3.404M)   : 0, 3403710
    benchmarks/2.38.0 (3.470M)   : 0, 3469785

Loading

@andrewlock

andrewlock commented Sep 13, 2023

Copy link
Copy Markdown
Member

Benchmarks Report 🐌

Benchmarks for #4619 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.175
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.1μs 38.1ns 183ns 0.02 0.00799 0 7.29 KB
master StartStopWithChild netcoreapp3.1 10μs 53.3ns 261ns 0.0309 0.0154 0 7.38 KB
master StartStopWithChild net472 15.5μs 38.1ns 147ns 1.28 0.319 0.106 7.65 KB
#4619 StartStopWithChild net6.0 8.19μs 42ns 206ns 0.0259 0.013 0 7.29 KB
#4619 StartStopWithChild netcoreapp3.1 10.1μs 52.4ns 262ns 0.0194 0.00485 0 7.39 KB
#4619 StartStopWithChild net472 15.7μs 38.6ns 150ns 1.28 0.321 0.102 7.66 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 480μs 323ns 1.25μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 662μs 238ns 858ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 804μs 221ns 855ns 0.401 0 0 3.3 KB
#4619 WriteAndFlushEnrichedTraces net6.0 471μs 264ns 988ns 0 0 0 2.7 KB
#4619 WriteAndFlushEnrichedTraces netcoreapp3.1 662μs 694ns 2.69μs 0 0 0 2.7 KB
#4619 WriteAndFlushEnrichedTraces net472 809μs 471ns 1.76μs 0.406 0 0 3.3 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 44.6μs 205ns 738ns 0.0215 0 0 2.03 KB
master AllCycleSimpleBody netcoreapp3.1 44.8μs 32.2ns 120ns 0.0225 0 0 2.01 KB
master AllCycleSimpleBody net472 46μs 93.6ns 362ns 0.319 0 0 2.08 KB
master AllCycleMoreComplexBody net6.0 229μs 164ns 636ns 0.114 0 0 8.63 KB
master AllCycleMoreComplexBody netcoreapp3.1 235μs 95.2ns 369ns 0 0 0 8.52 KB
master AllCycleMoreComplexBody net472 237μs 92.9ns 360ns 1.3 0 0 8.7 KB
master ObjectExtractorSimpleBody net6.0 124ns 0.112ns 0.434ns 0.00396 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 177ns 0.0716ns 0.258ns 0.00369 0 0 272 B
master ObjectExtractorSimpleBody net472 147ns 0.105ns 0.392ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 2.99μs 0.957ns 3.71ns 0.0541 0 0 3.88 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 4.03μs 2.29ns 8.58ns 0.0504 0 0 3.78 KB
master ObjectExtractorMoreComplexBody net472 4.11μs 2.41ns 9.35ns 0.618 0.00614 0 3.89 KB
#4619 AllCycleSimpleBody net6.0 42.7μs 23.1ns 89.6ns 0.0214 0 0 2.03 KB
#4619 AllCycleSimpleBody netcoreapp3.1 44.9μs 78.9ns 306ns 0.0224 0 0 2.01 KB
#4619 AllCycleSimpleBody net472 47μs 116ns 451ns 0.324 0 0 2.08 KB
#4619 AllCycleMoreComplexBody net6.0 228μs 163ns 610ns 0.114 0 0 8.63 KB
#4619 AllCycleMoreComplexBody netcoreapp3.1 233μs 161ns 601ns 0.116 0 0 8.52 KB
#4619 AllCycleMoreComplexBody net472 239μs 88ns 341ns 1.31 0 0 8.7 KB
#4619 ObjectExtractorSimpleBody net6.0 118ns 0.044ns 0.165ns 0.00395 0 0 280 B
#4619 ObjectExtractorSimpleBody netcoreapp3.1 167ns 0.0673ns 0.242ns 0.00372 0 0 272 B
#4619 ObjectExtractorSimpleBody net472 144ns 0.137ns 0.529ns 0.0446 0 0 281 B
#4619 ObjectExtractorMoreComplexBody net6.0 2.98μs 1.03ns 3.84ns 0.0537 0 0 3.88 KB
#4619 ObjectExtractorMoreComplexBody netcoreapp3.1 4.03μs 1.85ns 6.66ns 0.0505 0 0 3.78 KB
#4619 ObjectExtractorMoreComplexBody net472 4.12μs 2.52ns 9.44ns 0.617 0.00619 0 3.89 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 RunWaf(args=NestedMap (10)) net6.0 12.7μs 6.34ns 23.7ns 0.128 0 0 9.42 KB
master RunWaf(args=NestedMap (10)) netcoreapp3.1 19.8μs 5.63ns 20.3ns 0.129 0 0 9.42 KB
master RunWaf(args=NestedMap (10)) net472 28.7μs 6.93ns 26.8ns 1.5 0 0 9.48 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 76.5μs 38.1ns 148ns 0.191 0 0 15.77 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 85.3μs 147ns 570ns 0.213 0 0 15.72 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 97.8μs 248ns 962ns 2.52 0 0 16.04 KB
master RunWaf(args=NestedMap (100)) net6.0 24.5μs 13ns 48.5ns 0.27 0 0 19.66 KB
master RunWaf(args=NestedMap (100)) netcoreapp3.1 37.6μs 11.8ns 42.6ns 0.264 0 0 20.42 KB
master RunWaf(args=NestedMap (100)) net472 53.7μs 19ns 71ns 3.27 0.0268 0 20.63 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 95.2μs 24.7ns 95.6ns 0.331 0 0 26.01 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 110μs 231ns 864ns 0.328 0 0 26.72 KB
master RunWafWithAttack(args=Neste(...)tack) [23]) net472 129μs 84.4ns 316ns 4.27 0.0647 0 27.19 KB
master RunWaf(args=NestedMap (20)) net6.0 23.7μs 9.4ns 36.4ns 0.271 0 0 19.4 KB
master RunWaf(args=NestedMap (20)) netcoreapp3.1 37.5μs 18.8ns 70.3ns 0.263 0 0 19.84 KB
master RunWaf(args=NestedMap (20)) net472 54.6μs 27.4ns 106ns 3.17 0.0546 0 20.04 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 91.1μs 43.4ns 162ns 0.32 0 0 25.74 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 108μs 211ns 819ns 0.324 0 0 26.14 KB
master RunWafWithAttack(args=Neste(...)tack) [22]) net472 131μs 91.5ns 355ns 4.22 0.065 0 26.6 KB
#4619 RunWaf(args=NestedMap (10)) net6.0 13μs 2.98ns 11.2ns 0.129 0 0 9.42 KB
#4619 RunWaf(args=NestedMap (10)) netcoreapp3.1 19.4μs 6.02ns 22.5ns 0.126 0 0 9.42 KB
#4619 RunWaf(args=NestedMap (10)) net472 28.5μs 10.6ns 41ns 1.5 0 0 9.48 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 77.6μs 39.3ns 147ns 0.195 0 0 15.77 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 86μs 185ns 692ns 0.217 0 0 15.72 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [22]) net472 96.8μs 59.5ns 223ns 2.51 0 0 16.04 KB
#4619 RunWaf(args=NestedMap (100)) net6.0 23.9μs 9.63ns 36ns 0.279 0 0 19.66 KB
#4619 RunWaf(args=NestedMap (100)) netcoreapp3.1 38.3μs 15.5ns 57.8ns 0.268 0 0 20.42 KB
#4619 RunWaf(args=NestedMap (100)) net472 54.3μs 25.9ns 97ns 3.28 0.0273 0 20.63 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [23]) net6.0 92.5μs 60.6ns 219ns 0.364 0 0 26.01 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [23]) netcoreapp3.1 109μs 176ns 660ns 0.328 0 0 26.72 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [23]) net472 131μs 61.5ns 238ns 4.26 0.0655 0 27.19 KB
#4619 RunWaf(args=NestedMap (20)) net6.0 24.7μs 10.7ns 40ns 0.273 0 0 19.4 KB
#4619 RunWaf(args=NestedMap (20)) netcoreapp3.1 37.6μs 14ns 50.6ns 0.263 0 0 19.84 KB
#4619 RunWaf(args=NestedMap (20)) net472 53.2μs 28.8ns 108ns 3.16 0.0532 0 20.04 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [22]) net6.0 91.9μs 49.1ns 184ns 0.33 0 0 25.74 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [22]) netcoreapp3.1 108μs 215ns 831ns 0.322 0 0 26.14 KB
#4619 RunWafWithAttack(args=Neste(...)tack) [22]) net472 130μs 317ns 1.23μs 4.18 0.0642 0 26.6 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 170μs 154ns 596ns 0.254 0 0 18.09 KB
master SendRequest netcoreapp3.1 191μs 118ns 424ns 0.192 0 0 20.25 KB
master SendRequest net472 0.000191ns 0.000154ns 0.000598ns 0 0 0 0 b
#4619 SendRequest net6.0 168μs 137ns 531ns 0.254 0 0 18.09 KB
#4619 SendRequest netcoreapp3.1 190μs 373ns 1.45μs 0.189 0 0 20.25 KB
#4619 SendRequest net472 0.000244ns 0.000116ns 0.000434ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 506μs 596ns 2.23μs 0.772 0 0 41.42 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 616μs 979ns 3.66μs 0.305 0 0 41.84 KB
master WriteAndFlushEnrichedTraces net472 780μs 2.98μs 11.6μs 8.38 2.67 0.381 53.23 KB
#4619 WriteAndFlushEnrichedTraces net6.0 513μs 1.04μs 4.04μs 0.521 0 0 41.39 KB
#4619 WriteAndFlushEnrichedTraces netcoreapp3.1 618μs 1.08μs 4.19μs 0.311 0 0 41.82 KB
#4619 WriteAndFlushEnrichedTraces net472 794μs 3.41μs 13.2μs 8.1 2.31 0.386 53.23 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.09μs 0.903ns 3.5ns 0.0109 0 0 768 B
master ExecuteNonQuery netcoreapp3.1 1.34μs 0.837ns 3.24ns 0.0102 0 0 768 B
master ExecuteNonQuery net472 1.56μs 2.25ns 8.11ns 0.116 0 0 730 B
#4619 ExecuteNonQuery net6.0 1.11μs 0.526ns 1.97ns 0.0106 0 0 768 B
#4619 ExecuteNonQuery netcoreapp3.1 1.39μs 1.01ns 3.89ns 0.0104 0 0 768 B
#4619 ExecuteNonQuery net472 1.58μs 0.599ns 2.24ns 0.116 0 0 730 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.2μs 1.56ns 6.04ns 0.0136 0 0 992 B
master CallElasticsearch netcoreapp3.1 1.52μs 0.593ns 2.22ns 0.0137 0 0 992 B
master CallElasticsearch net472 2.39μs 0.988ns 3.83ns 0.159 0.00119 0 1 KB
master CallElasticsearchAsync net6.0 1.35μs 1.07ns 4.16ns 0.0133 0 0 968 B
master CallElasticsearchAsync netcoreapp3.1 1.52μs 0.827ns 3.2ns 0.0139 0 0 1.04 KB
master CallElasticsearchAsync net472 2.48μs 1.21ns 4.68ns 0.167 0.00124 0 1.06 KB
#4619 CallElasticsearch net6.0 1.22μs 1.27ns 4.76ns 0.0136 0 0 992 B
#4619 CallElasticsearch netcoreapp3.1 1.51μs 0.974ns 3.64ns 0.0135 0 0 992 B
#4619 CallElasticsearch net472 2.39μs 0.52ns 1.94ns 0.158 0.0012 0 1 KB
#4619 CallElasticsearchAsync net6.0 1.25μs 1.04ns 4.04ns 0.0137 0 0 968 B
#4619 CallElasticsearchAsync netcoreapp3.1 1.53μs 0.549ns 2.13ns 0.0139 0 0 1.04 KB
#4619 CallElasticsearchAsync net472 2.47μs 0.822ns 3.08ns 0.168 0.00124 0 1.06 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.19μs 0.369ns 1.33ns 0.0125 0 0 912 B
master ExecuteAsync netcoreapp3.1 1.48μs 0.633ns 2.45ns 0.012 0 0 912 B
master ExecuteAsync net472 1.66μs 1.02ns 3.96ns 0.138 0.000829 0 875 B
#4619 ExecuteAsync net6.0 1.22μs 0.632ns 2.36ns 0.013 0 0 912 B
#4619 ExecuteAsync netcoreapp3.1 1.48μs 1.4ns 5.43ns 0.0126 0 0 912 B
#4619 ExecuteAsync net472 1.7μs 0.499ns 1.93ns 0.138 0.000853 0 875 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 3.67μs 2.27ns 8.48ns 0.0273 0 0 1.94 KB
master SendAsync netcoreapp3.1 4.48μs 2.26ns 8.77ns 0.0313 0 0 2.48 KB
master SendAsync net472 7.16μs 2.33ns 9.03ns 0.483 0 0 3.05 KB
#4619 SendAsync net6.0 3.81μs 1.64ns 6.15ns 0.0267 0 0 1.94 KB
#4619 SendAsync netcoreapp3.1 4.46μs 3.58ns 13.4ns 0.0337 0 0 2.48 KB
#4619 SendAsync net472 7.08μs 3.08ns 11.5ns 0.484 0 0 3.05 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.34μs 1.4ns 5.42ns 0.0227 0 0 1.62 KB
master EnrichedLog netcoreapp3.1 1.92μs 0.537ns 1.86ns 0.0215 0 0 1.62 KB
master EnrichedLog net472 2.39μs 0.967ns 3.62ns 0.244 0 0 1.54 KB
#4619 EnrichedLog net6.0 1.46μs 1.04ns 3.88ns 0.0226 0 0 1.62 KB
#4619 EnrichedLog netcoreapp3.1 1.83μs 0.873ns 3.27ns 0.022 0 0 1.62 KB
#4619 EnrichedLog net472 2.32μs 2.19ns 8.2ns 0.244 0 0 1.54 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 114μs 201ns 779ns 0.0566 0 0 4.21 KB
master EnrichedLog netcoreapp3.1 117μs 164ns 613ns 0.0589 0 0 4.21 KB
master EnrichedLog net472 148μs 165ns 641ns 0.668 0.223 0 4.38 KB
#4619 EnrichedLog net6.0 113μs 130ns 505ns 0.0559 0 0 4.21 KB
#4619 EnrichedLog netcoreapp3.1 122μs 263ns 984ns 0 0 0 4.21 KB
#4619 EnrichedLog net472 148μs 126ns 470ns 0.657 0.219 0 4.38 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.94μs 1.03ns 3.86ns 0.0305 0 0 2.18 KB
master EnrichedLog netcoreapp3.1 3.84μs 1.84ns 7.14ns 0.029 0 0 2.18 KB
master EnrichedLog net472 4.61μs 1.19ns 4.59ns 0.316 0 0 1.99 KB
#4619 EnrichedLog net6.0 2.91μs 1.3ns 5.03ns 0.0307 0 0 2.18 KB
#4619 EnrichedLog netcoreapp3.1 3.99μs 1.26ns 4.37ns 0.03 0 0 2.18 KB
#4619 EnrichedLog net472 4.55μs 0.797ns 2.98ns 0.316 0 0 1.99 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.37μs 0.688ns 2.48ns 0.0164 0 0 1.16 KB
master SendReceive netcoreapp3.1 1.64μs 1.04ns 3.9ns 0.0154 0 0 1.16 KB
master SendReceive net472 2.06μs 1.13ns 4.39ns 0.185 0 0 1.16 KB
#4619 SendReceive net6.0 1.34μs 0.738ns 2.76ns 0.0167 0 0 1.16 KB
#4619 SendReceive netcoreapp3.1 1.69μs 0.656ns 2.46ns 0.0152 0 0 1.16 KB
#4619 SendReceive net472 2.07μs 2.52ns 9.42ns 0.184 0 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.54μs 0.861ns 3.1ns 0.0216 0 0 1.53 KB
master EnrichedLog netcoreapp3.1 3.69μs 1.59ns 6.16ns 0.0202 0 0 1.58 KB
master EnrichedLog net472 3.99μs 0.959ns 3.59ns 0.311 0 0 1.96 KB
#4619 EnrichedLog net6.0 2.55μs 1.45ns 5.44ns 0.0216 0 0 1.53 KB
#4619 EnrichedLog netcoreapp3.1 3.58μs 2.82ns 10.9ns 0.0196 0 0 1.58 KB
#4619 EnrichedLog net472 4.18μs 1.34ns 5.2ns 0.311 0 0 1.96 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #4619

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.175 401.00 471.30

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 401ns 0.372ns 1.44ns 0.00755 0 0 536 B
master StartFinishSpan netcoreapp3.1 575ns 0.137ns 0.512ns 0.00709 0 0 536 B
master StartFinishSpan net472 647ns 0.258ns 1ns 0.0854 0 0 538 B
master StartFinishScope net6.0 521ns 0.265ns 0.993ns 0.00917 0 0 656 B
master StartFinishScope netcoreapp3.1 673ns 0.593ns 2.22ns 0.00894 0 0 656 B
master StartFinishScope net472 852ns 0.646ns 2.5ns 0.098 0 0 618 B
#4619 StartFinishSpan net6.0 471ns 0.163ns 0.609ns 0.00745 0 0 536 B
#4619 StartFinishSpan netcoreapp3.1 577ns 0.257ns 0.962ns 0.00741 0 0 536 B
#4619 StartFinishSpan net472 605ns 0.522ns 2.02ns 0.0852 0 0 538 B
#4619 StartFinishScope net6.0 543ns 1.04ns 3.75ns 0.0093 0 0 656 B
#4619 StartFinishScope netcoreapp3.1 718ns 0.299ns 1.16ns 0.00894 0 0 656 B
#4619 StartFinishScope net472 838ns 0.229ns 0.887ns 0.098 0 0 618 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 616ns 0.462ns 1.79ns 0.009 0 0 656 B
master RunOnMethodBegin netcoreapp3.1 795ns 0.278ns 1.08ns 0.00913 0 0 656 B
master RunOnMethodBegin net472 919ns 0.506ns 1.96ns 0.0982 0 0 618 B
#4619 RunOnMethodBegin net6.0 653ns 0.35ns 1.36ns 0.00919 0 0 656 B
#4619 RunOnMethodBegin netcoreapp3.1 829ns 0.33ns 1.28ns 0.00883 0 0 656 B
#4619 RunOnMethodBegin net472 952ns 0.191ns 0.739ns 0.098 0 0 618 B

@pablomartinezbernardo
pablomartinezbernardo marked this pull request as ready for review September 18, 2023 09:59
@pablomartinezbernardo
pablomartinezbernardo requested a review from a team as a code owner September 18, 2023 09:59
@pablomartinezbernardo pablomartinezbernardo changed the title Use peer.service as dddbs for DBM when available [Tracer] Use peer.service as dddbs for DBM when available Sep 18, 2023

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just a couple of minor suggestions on testing

@datadog-ddstaging

datadog-ddstaging Bot commented Sep 25, 2023

Copy link
Copy Markdown

Datadog Report

Branch report: dddbs
Commit report: 290f4fe

dd-trace-dotnet: 0 Failed, 0 New Flaky, 302776 Passed, 1148 Skipped, 23m 5.56s Wall Time

{
var propagatorStringBuilder = StringBuilderCache.Acquire(StringBuilderCache.MaxBuilderSize);
propagatorStringBuilder.Append(DbmPrefix).Append(Uri.EscapeDataString(context.ServiceNameInternal)).Append('\'');
var dddbs = (span.Tags is SqlV1Tags sqlTags) ? sqlTags.PeerService : span.Context.ServiceNameInternal;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fact that peer.service can be an override, the dbname or out.host is wanted I assume. But asking just in case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As read in the original doc

The correct value is whatever we would expose to the customer on the trace flamegraph and dependency map

Which is not a very technical term, but in this case means whatever is set in peer.service

@pablomartinezbernardo
pablomartinezbernardo merged commit b1f6cb0 into master Sep 25, 2023
@github-actions github-actions Bot added this to the vNext milestone Sep 25, 2023
vandonr added a commit that referenced this pull request Sep 27, 2024
## Summary of changes

- add `ddprs` (peer service) to the comment injected by DBM, contains
the peer service value only if set explicitely
- revert the behavior introduced in #4619, as per spec, peer service is
not supposed to override `dddbs`.

## Reason for change

spec:
https://docs.google.com/document/d/1Cg9RLydNzK1BTf3EFaEC4NlQtvAO-_rDdPLSO8HgDCs
slack thread:
https://dd.slack.com/archives/C02U25426A1/p1727254455343209

## Implementation details

By taking the value of `ServiceNameInternal` from the span, dddbs will
have either the service name of the calling service or the name of the
DB depending on how fake services are configured.

The SQL tags V1 record if a peer service override was set

https://github.com/DataDog/dd-trace-dotnet/blob/40c8f59154c71dcce502c740304b9ef281f5c355/tracer/src/Datadog.Trace/Tagging/SqlTags.cs#L57-L58
so I'm using that to know if I should use the `PeerService` value
(because it always has a value, it falls back to the DB type or the
outhost if peer service is not set).

https://github.com/DataDog/dd-trace-dotnet/blob/40c8f59154c71dcce502c740304b9ef281f5c355/tracer/src/Datadog.Trace/Tagging/SqlTags.cs#L48

For V0, I'm relying on the fact that the old value is saved when peer
service is set. Not sure if I could just always use peer service in that
case ?

https://github.com/DataDog/dd-trace-dotnet/blob/4bafc78fa25382fefb03fa4e052905ca371d1ffa/tracer/src/Datadog.Trace/Configuration/Schema/NamingSchema.cs#L64-L65

## Test coverage

## Other details
JIRA: AIT-10032
<!-- Fixes #{issue} -->

<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
nhulston pushed a commit that referenced this pull request Sep 27, 2024
## Summary of changes

- add `ddprs` (peer service) to the comment injected by DBM, contains
the peer service value only if set explicitely
- revert the behavior introduced in #4619, as per spec, peer service is
not supposed to override `dddbs`.

## Reason for change

spec:
https://docs.google.com/document/d/1Cg9RLydNzK1BTf3EFaEC4NlQtvAO-_rDdPLSO8HgDCs
slack thread:
https://dd.slack.com/archives/C02U25426A1/p1727254455343209

## Implementation details

By taking the value of `ServiceNameInternal` from the span, dddbs will
have either the service name of the calling service or the name of the
DB depending on how fake services are configured.

The SQL tags V1 record if a peer service override was set

https://github.com/DataDog/dd-trace-dotnet/blob/40c8f59154c71dcce502c740304b9ef281f5c355/tracer/src/Datadog.Trace/Tagging/SqlTags.cs#L57-L58
so I'm using that to know if I should use the `PeerService` value
(because it always has a value, it falls back to the DB type or the
outhost if peer service is not set).

https://github.com/DataDog/dd-trace-dotnet/blob/40c8f59154c71dcce502c740304b9ef281f5c355/tracer/src/Datadog.Trace/Tagging/SqlTags.cs#L48

For V0, I'm relying on the fact that the old value is saved when peer
service is set. Not sure if I could just always use peer service in that
case ?

https://github.com/DataDog/dd-trace-dotnet/blob/4bafc78fa25382fefb03fa4e052905ca371d1ffa/tracer/src/Datadog.Trace/Configuration/Schema/NamingSchema.cs#L64-L65

## Test coverage

## Other details
JIRA: AIT-10032
<!-- Fixes #{issue} -->

<!-- ⚠️ Note: where possible, please obtain 2 approvals prior to
merging. Unless CODEOWNERS specifies otherwise, for external teams it is
typically best to have one review from a team member, and one review
from apm-dotnet. Trivial changes do not require 2 reviews. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants