Skip to content
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

Add ddprs to DBM injected comment + fix dddbs #6084

Merged
merged 4 commits into from
Sep 27, 2024
Merged

Add ddprs to DBM injected comment + fix dddbs #6084

merged 4 commits into from
Sep 27, 2024

Conversation

vandonr
Copy link
Contributor

@vandonr vandonr commented Sep 26, 2024

Summary of changes

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

return _peerServiceOverride is not null
? "peer.service"

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).
get => _peerServiceOverride ?? DbName ?? OutHost;

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 ?

tags.SetTag(Tags.PeerServiceRemappedFrom, peerService);
tags.SetTag(Tags.PeerService, mappedServiceName);

Test coverage

Other details

JIRA: AIT-10032

@vandonr vandonr requested review from a team as code owners September 26, 2024 09:40
@vandonr vandonr changed the title Vandonr/dbm Add ddprs to DBM injected comment + fix dddbs Sep 26, 2024
@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Sep 26, 2024

Datadog Report

Branch report: vandonr/dbm
Commit report: 0caec1a
Test service: dd-trace-dotnet

✅ 0 Failed, 365288 Passed, 2051 Skipped, 15h 45m 59.25s Total Time
❄️ 1 New Flaky

New Flaky Tests (1)

  • HttpClient_SubmitsTraces - Datadog.Trace.ClrProfiler.IntegrationTests.HttpMessageHandlerTests - Last Failure

    Expand for error
     Expected exit code: 0, actual exit code: 139.
    

@andrewlock
Copy link
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 (6084) - mean (78ms)  : 69, 87
     .   : milestone, 78,
    master - mean (71ms)  : 67, 74
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (6084) - mean (1,145ms)  : 1115, 1175
     .   : milestone, 1145,
    master - mean (1,105ms)  : 1089, 1122
     .   : milestone, 1105,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6084) - mean (121ms)  : 109, 133
     .   : milestone, 121,
    master - mean (110ms)  : 107, 114
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (6084) - mean (811ms)  : 788, 834
     .   : milestone, 811,
    master - mean (777ms)  : 762, 793
     .   : milestone, 777,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6084) - mean (100ms)  : 92, 109
     .   : milestone, 100,
    master - mean (93ms)  : 90, 96
     .   : milestone, 93,

    section CallTarget+Inlining+NGEN
    This PR (6084) - mean (765ms)  : 737, 793
     .   : milestone, 765,
    master - mean (735ms)  : 711, 758
     .   : milestone, 735,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6084) - mean (191ms)  : 188, 194
     .   : milestone, 191,
    master - mean (191ms)  : 186, 196
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6084) - mean (1,197ms)  : 1174, 1219
     .   : milestone, 1197,
    master - mean (1,195ms)  : 1170, 1221
     .   : milestone, 1195,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6084) - mean (276ms)  : 272, 280
     .   : milestone, 276,
    master - mean (277ms)  : 273, 282
     .   : milestone, 277,

    section CallTarget+Inlining+NGEN
    This PR (6084) - mean (939ms)  : 924, 955
     .   : milestone, 939,
    master - mean (946ms)  : 927, 965
     .   : milestone, 946,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6084) - mean (266ms)  : 262, 269
     .   : milestone, 266,
    master - mean (267ms)  : 262, 273
     .   : milestone, 267,

    section CallTarget+Inlining+NGEN
    This PR (6084) - mean (925ms)  : 900, 950
     .   : milestone, 925,
    master - mean (930ms)  : 911, 949
     .   : milestone, 930,

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6084 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.262
  • 1 benchmarks are slower, with geometric mean 1.123
  • 1 benchmarks have fewer 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 7.74μs 43.6ns 315ns 0.0143 0.00716 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.89μs 55ns 348ns 0.0193 0.00965 0 5.63 KB
master StartStopWithChild net472 16μs 39.4ns 153ns 1.04 0.329 0.0939 6.07 KB
#6084 StartStopWithChild net6.0 7.79μs 44.2ns 303ns 0.0197 0.00786 0 5.43 KB
#6084 StartStopWithChild netcoreapp3.1 9.94μs 55ns 356ns 0.0152 0.00506 0 5.62 KB
#6084 StartStopWithChild net472 16μs 46.3ns 179ns 1.02 0.299 0.102 6.07 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 465μs 204ns 789ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 648μs 356ns 1.38μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 823μs 425ns 1.59μs 0.411 0 0 3.3 KB
#6084 WriteAndFlushEnrichedTraces net6.0 469μs 398ns 1.49μs 0 0 0 2.7 KB
#6084 WriteAndFlushEnrichedTraces netcoreapp3.1 617μs 248ns 928ns 0 0 0 2.7 KB
#6084 WriteAndFlushEnrichedTraces net472 831μs 297ns 1.15μs 0.414 0 0 3.3 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 197μs 1.13μs 8.8μs 0.197 0 0 18.45 KB
master SendRequest netcoreapp3.1 222μs 1.19μs 8.36μs 0.217 0 0 20.61 KB
master SendRequest net472 0.00161ns 0.000764ns 0.00286ns 0 0 0 0 b
#6084 SendRequest net6.0 197μs 1.13μs 8.19μs 0.188 0 0 18.45 KB
#6084 SendRequest netcoreapp3.1 218μs 1.26μs 9.39μs 0.221 0 0 20.61 KB
#6084 SendRequest net472 0.000941ns 0.000401ns 0.0015ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #6084

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.94 KB 41.67 KB -269 B -0.64%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 569μs 2.49μs 9.66μs 0.576 0 0 41.56 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 688μs 3.33μs 13.7μs 0.334 0 0 41.94 KB
master WriteAndFlushEnrichedTraces net472 893μs 3.69μs 14.3μs 8.19 2.59 0.431 53.28 KB
#6084 WriteAndFlushEnrichedTraces net6.0 563μs 1.17μs 4.36μs 0.568 0 0 41.62 KB
#6084 WriteAndFlushEnrichedTraces netcoreapp3.1 680μs 3.52μs 18.3μs 0.327 0 0 41.67 KB
#6084 WriteAndFlushEnrichedTraces net472 871μs 3.17μs 12.3μs 8.39 2.52 0.419 53.31 KB
Benchmarks.Trace.DbCommandBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6084

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.123 1,183.01 1,329.06

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.18μs 0.8ns 3ns 0.0141 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.76μs 1.49ns 5.78ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.1μs 3.78ns 14.6ns 0.156 0 0 987 B
#6084 ExecuteNonQuery net6.0 1.33μs 0.924ns 3.58ns 0.014 0 0 1.02 KB
#6084 ExecuteNonQuery netcoreapp3.1 1.78μs 3.64ns 14.1ns 0.0139 0 0 1.02 KB
#6084 ExecuteNonQuery net472 2.1μs 2.32ns 9ns 0.156 0 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.24μs 0.686ns 2.66ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.54μs 1.33ns 5.15ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.5μs 2ns 7.75ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.26μs 1.14ns 4.43ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.71μs 0.829ns 3.21ns 0.0136 0 0 1.02 KB
master CallElasticsearchAsync net472 2.61μs 1.58ns 6.11ns 0.166 0 0 1.05 KB
#6084 CallElasticsearch net6.0 1.12μs 1.03ns 3.99ns 0.014 0 0 976 B
#6084 CallElasticsearch netcoreapp3.1 1.5μs 0.596ns 2.31ns 0.0134 0 0 976 B
#6084 CallElasticsearch net472 2.49μs 1.43ns 5.16ns 0.158 0 0 995 B
#6084 CallElasticsearchAsync net6.0 1.3μs 0.373ns 1.4ns 0.0136 0 0 952 B
#6084 CallElasticsearchAsync netcoreapp3.1 1.66μs 1.2ns 4.65ns 0.0133 0 0 1.02 KB
#6084 CallElasticsearchAsync net472 2.73μs 1.28ns 4.6ns 0.167 0 0 1.05 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.3μs 1.1ns 4.24ns 0.013 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.56μs 0.731ns 2.63ns 0.0128 0 0 952 B
master ExecuteAsync net472 1.79μs 0.497ns 1.86ns 0.145 0 0 915 B
#6084 ExecuteAsync net6.0 1.28μs 0.756ns 2.83ns 0.0134 0 0 952 B
#6084 ExecuteAsync netcoreapp3.1 1.66μs 0.845ns 3.27ns 0.0126 0 0 952 B
#6084 ExecuteAsync net472 1.83μs 0.7ns 2.71ns 0.145 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 4.19μs 1.95ns 7.31ns 0.031 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.12μs 2.45ns 9.49ns 0.0359 0 0 2.76 KB
master SendAsync net472 7.83μs 3.56ns 13.8ns 0.496 0 0 3.15 KB
#6084 SendAsync net6.0 4.14μs 2.14ns 7.99ns 0.0311 0 0 2.22 KB
#6084 SendAsync netcoreapp3.1 5.06μs 1.95ns 7.53ns 0.0353 0 0 2.76 KB
#6084 SendAsync net472 7.67μs 1.99ns 7.72ns 0.497 0 0 3.15 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.44μs 0.707ns 2.74ns 0.0231 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.22μs 1.06ns 3.98ns 0.0223 0 0 1.64 KB
master EnrichedLog net472 2.6μs 0.868ns 3.25ns 0.249 0 0 1.57 KB
#6084 EnrichedLog net6.0 1.45μs 0.832ns 3.11ns 0.0232 0 0 1.64 KB
#6084 EnrichedLog netcoreapp3.1 2.24μs 0.914ns 3.42ns 0.0224 0 0 1.64 KB
#6084 EnrichedLog net472 2.67μs 0.962ns 3.73ns 0.249 0 0 1.57 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 112μs 218ns 846ns 0.0569 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 118μs 115ns 414ns 0 0 0 4.28 KB
master EnrichedLog net472 147μs 145ns 542ns 0.657 0.219 0 4.46 KB
#6084 EnrichedLog net6.0 113μs 112ns 420ns 0 0 0 4.28 KB
#6084 EnrichedLog netcoreapp3.1 119μs 287ns 1.11μs 0 0 0 4.28 KB
#6084 EnrichedLog net472 147μs 116ns 449ns 0.66 0.22 0 4.46 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 3.05μs 1.25ns 4.5ns 0.0304 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.24μs 1.77ns 6.87ns 0.0276 0 0 2.2 KB
master EnrichedLog net472 4.81μs 1.24ns 4.79ns 0.32 0 0 2.02 KB
#6084 EnrichedLog net6.0 2.94μs 0.642ns 2.49ns 0.0309 0 0 2.2 KB
#6084 EnrichedLog netcoreapp3.1 4.21μs 4.56ns 17.7ns 0.0295 0 0 2.2 KB
#6084 EnrichedLog net472 4.78μs 1.87ns 7.23ns 0.319 0 0 2.02 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.32μs 0.909ns 3.4ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.76μs 2.53ns 9.47ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.16μs 0.733ns 2.74ns 0.183 0.00108 0 1.16 KB
#6084 SendReceive net6.0 1.28μs 0.551ns 1.99ns 0.016 0 0 1.14 KB
#6084 SendReceive netcoreapp3.1 1.72μs 1.27ns 4.93ns 0.0155 0 0 1.14 KB
#6084 SendReceive net472 2.04μs 1.01ns 3.91ns 0.184 0.00102 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.81μs 1.17ns 4.54ns 0.0225 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.96μs 2.26ns 8.75ns 0.0217 0 0 1.65 KB
master EnrichedLog net472 4.42μs 3.35ns 13ns 0.324 0 0 2.04 KB
#6084 EnrichedLog net6.0 2.69μs 0.603ns 2.34ns 0.0215 0 0 1.6 KB
#6084 EnrichedLog netcoreapp3.1 3.89μs 1.29ns 4.64ns 0.0213 0 0 1.65 KB
#6084 EnrichedLog net472 4.32μs 1.81ns 7.02ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6084

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishScope‑net6.0 1.326 628.27 473.73
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 1.201 741.28 617.06

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 398ns 0.208ns 0.807ns 0.00802 0 0 576 B
master StartFinishSpan netcoreapp3.1 552ns 0.47ns 1.82ns 0.00774 0 0 576 B
master StartFinishSpan net472 741ns 0.825ns 3.19ns 0.0917 0 0 578 B
master StartFinishScope net6.0 629ns 1.26ns 4.9ns 0.00983 0 0 696 B
master StartFinishScope netcoreapp3.1 717ns 0.555ns 2.15ns 0.00936 0 0 696 B
master StartFinishScope net472 855ns 0.634ns 2.46ns 0.105 0 0 658 B
#6084 StartFinishSpan net6.0 397ns 0.297ns 1.15ns 0.00799 0 0 576 B
#6084 StartFinishSpan netcoreapp3.1 590ns 0.442ns 1.65ns 0.00775 0 0 576 B
#6084 StartFinishSpan net472 616ns 0.795ns 3.08ns 0.0917 0 0 578 B
#6084 StartFinishScope net6.0 474ns 0.36ns 1.4ns 0.00972 0 0 696 B
#6084 StartFinishScope netcoreapp3.1 781ns 0.615ns 2.38ns 0.00941 0 0 696 B
#6084 StartFinishScope net472 835ns 0.692ns 2.68ns 0.104 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 612ns 0.446ns 1.73ns 0.00973 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 849ns 0.736ns 2.85ns 0.00936 0 0 696 B
master RunOnMethodBegin net472 1.12μs 0.834ns 3.23ns 0.104 0 0 658 B
#6084 RunOnMethodBegin net6.0 659ns 0.304ns 1.18ns 0.00955 0 0 696 B
#6084 RunOnMethodBegin netcoreapp3.1 895ns 0.795ns 3.08ns 0.00944 0 0 696 B
#6084 RunOnMethodBegin net472 1.15μs 1.66ns 6.45ns 0.104 0 0 658 B

@andrewlock
Copy link
Member

Throughput/Crank Report ⚡

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 (6084) (11.106M)   : 0, 11105692
    master (11.115M)   : 0, 11115019
    benchmarks/2.9.0 (11.081M)   : 0, 11080577

    section Automatic
    This PR (6084) (7.363M)   : 0, 7362554
    master (7.288M)   : 0, 7288058
    benchmarks/2.9.0 (7.732M)   : 0, 7732233

    section Trace stats
    master (7.570M)   : 0, 7569548

    section Manual
    master (11.119M)   : 0, 11118645

    section Manual + Automatic
    This PR (6084) (6.772M)   : 0, 6772494
    master (6.759M)   : 0, 6759326

    section DD_TRACE_ENABLED=0
    master (10.256M)   : 0, 10256341

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6084) (9.641M)   : 0, 9640974
    master (9.521M)   : 0, 9521038
    benchmarks/2.9.0 (9.798M)   : 0, 9798067

    section Automatic
    This PR (6084) (6.439M)   : 0, 6439435
    master (6.498M)   : 0, 6498406

    section Trace stats
    master (6.942M)   : 0, 6941628

    section Manual
    master (9.493M)   : 0, 9493351

    section Manual + Automatic
    This PR (6084) (6.068M)   : 0, 6067980
    master (5.986M)   : 0, 5986449

    section DD_TRACE_ENABLED=0
    master (8.976M)   : 0, 8976249

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6084) (10.212M)   : 0, 10211867
    master (10.101M)   : 0, 10100514
    benchmarks/2.9.0 (10.067M)   : 0, 10067315

    section Automatic
    This PR (6084) (6.892M)   : 0, 6892384
    master (6.620M)   : 0, 6619828
    benchmarks/2.9.0 (7.552M)   : 0, 7552193

    section Trace stats
    master (7.357M)   : 0, 7356653

    section Manual
    master (10.092M)   : 0, 10091514

    section Manual + Automatic
    This PR (6084) (6.293M)   : 0, 6293280
    master (6.098M)   : 0, 6097760

    section DD_TRACE_ENABLED=0
    master (9.472M)   : 0, 9472383

Loading

Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

Thanks and thanks for all the documentation in the PR :)

}
else
{
if (span.Tags.GetTag(Tags.PeerServiceRemappedFrom) != null)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if I could just always use peer service in that case ?

I think the way you have it looks fine to me

@vandonr vandonr merged commit 4b7002a into master Sep 27, 2024
73 checks passed
@vandonr vandonr deleted the vandonr/dbm branch September 27, 2024 14:39
@github-actions github-actions bot added this to the vNext-v3 milestone Sep 27, 2024
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. -->
@andrewlock andrewlock added type:enhancement Improvement to an existing feature area:database-monitoring labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:database-monitoring type:enhancement Improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants