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

[Profiler] Fix duplicated lifecycle telemetry #6002

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

chrisnas
Copy link
Contributor

@chrisnas chrisnas commented Sep 6, 2024

Summary of changes

Avoid sending application lifecycle telemetry

Reason for change

The Tracer is already sending these application lifecycle telemetry events

Implementation details

Use a different API from libdatadog telemetry

Test coverage

Other details

@chrisnas chrisnas requested a review from a team as a code owner September 6, 2024 13:56
Copy link
Collaborator

@gleocadie gleocadie left a comment

Choose a reason for hiding this comment

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

🤞

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Sep 6, 2024

Datadog Report

Branch report: chrisnas/fix_duplicate_telemetry
Commit report: 55ea96f
Test service: dd-trace-dotnet

✅ 0 Failed, 366494 Passed, 2328 Skipped, 16h 11m 7.59s Total Time

@andrewlock
Copy link
Member

andrewlock commented Sep 6, 2024

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 (6002) - mean (70ms)  : 66, 74
     .   : milestone, 70,
    master - mean (75ms)  : 66, 84
     .   : milestone, 75,

    section CallTarget+Inlining+NGEN
    This PR (6002) - mean (1,108ms)  : 1091, 1126
     .   : milestone, 1108,
    master - mean (1,135ms)  : 1097, 1172
     .   : milestone, 1135,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6002) - mean (109ms)  : 106, 113
     .   : milestone, 109,
    master - mean (117ms)  : 108, 127
     .   : milestone, 117,

    section CallTarget+Inlining+NGEN
    This PR (6002) - mean (826ms)  : 809, 843
     .   : milestone, 826,
    master - mean (837ms)  : 811, 863
     .   : milestone, 837,

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

    section CallTarget+Inlining+NGEN
    This PR (6002) - mean (769ms)  : 750, 788
     .   : milestone, 769,
    master - mean (792ms)  : 764, 819
     .   : milestone, 792,

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

    section CallTarget+Inlining+NGEN
    This PR (6002) - mean (1,194ms)  : 1166, 1223
     .   : milestone, 1194,
    master - mean (1,195ms)  : 1170, 1220
     .   : milestone, 1195,

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

    section CallTarget+Inlining+NGEN
    This PR (6002) - mean (967ms)  : 947, 987
     .   : milestone, 967,
    master - mean (973ms)  : 950, 996
     .   : milestone, 973,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6002) - mean (265ms)  : 261, 269
     .   : milestone, 265,
    master - mean (265ms)  : 261, 269
     .   : milestone, 265,

    section CallTarget+Inlining+NGEN
    This PR (6002) - mean (948ms)  : 922, 974
     .   : milestone, 948,
    master - mean (949ms)  : 931, 967
     .   : milestone, 949,

Loading

@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 (6002) (11.240M)   : 0, 11239624
    master (11.181M)   : 0, 11180988

    section Automatic
    This PR (6002) (7.484M)   : 0, 7483648
    master (7.344M)   : 0, 7344076

    section Trace stats
    master (7.631M)   : 0, 7630555

    section Manual
    master (11.084M)   : 0, 11084343

    section Manual + Automatic
    This PR (6002) (6.891M)   : 0, 6891387
    master (6.749M)   : 0, 6748775

    section DD_TRACE_ENABLED=0
    master (10.330M)   : 0, 10330053

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6002) (9.543M)   : 0, 9542716
    benchmarks/2.9.0 (9.645M)   : 0, 9644839

    section Automatic
    This PR (6002) (6.504M)   : 0, 6503601

    section Manual + Automatic
    This PR (6002) (6.115M)   : 0, 6114562

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6002) (9.929M)   : 0, 9928746
    master (10.229M)   : 0, 10228633
    benchmarks/2.9.0 (10.408M)   : 0, 10408319

    section Automatic
    This PR (6002) (6.657M)   : 0, 6656614
    master (6.768M)   : 0, 6768160
    benchmarks/2.9.0 (7.412M)   : 0, 7412035

    section Trace stats
    master (7.381M)   : 0, 7380947

    section Manual
    master (10.100M)   : 0, 10100381

    section Manual + Automatic
    This PR (6002) (6.167M)   : 0, 6167167
    master (6.294M)   : 0, 6293834

    section DD_TRACE_ENABLED=0
    master (9.482M)   : 0, 9482452

Loading

@andrewlock
Copy link
Member

Benchmarks Report for tracer 🐌

Benchmarks for #6002 compared to master:

  • All benchmarks have the same speed
  • 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 7.67μs 44ns 343ns 0.0152 0.00761 0 5.42 KB
master StartStopWithChild netcoreapp3.1 9.95μs 55.8ns 353ns 0.0248 0.00992 0 5.62 KB
master StartStopWithChild net472 16.1μs 39.7ns 154ns 1.02 0.309 0.0895 6.06 KB
#6002 StartStopWithChild net6.0 7.75μs 42ns 245ns 0.0117 0.00389 0 5.43 KB
#6002 StartStopWithChild netcoreapp3.1 9.91μs 54.6ns 332ns 0.0199 0.00994 0 5.61 KB
#6002 StartStopWithChild net472 15.8μs 57.2ns 222ns 1.03 0.323 0.105 6.06 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 469μs 231ns 866ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 659μs 642ns 2.49μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 829μs 525ns 1.96μs 0.414 0 0 3.3 KB
#6002 WriteAndFlushEnrichedTraces net6.0 465μs 211ns 791ns 0 0 0 2.7 KB
#6002 WriteAndFlushEnrichedTraces netcoreapp3.1 631μs 457ns 1.71μs 0 0 0 2.7 KB
#6002 WriteAndFlushEnrichedTraces net472 848μs 708ns 3.09μs 0.425 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 205μs 1.42μs 14.2μs 0.207 0 0 18.45 KB
master SendRequest netcoreapp3.1 227μs 1.32μs 11.8μs 0.229 0 0 20.61 KB
master SendRequest net472 0.00329ns 0.0011ns 0.00426ns 0 0 0 0 b
#6002 SendRequest net6.0 197μs 1μs 4.8μs 0.195 0 0 18.45 KB
#6002 SendRequest netcoreapp3.1 221μs 1.25μs 8.54μs 0.226 0 0 20.61 KB
#6002 SendRequest net472 0ns 0ns 0ns 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 575μs 2.98μs 14.3μs 0.561 0 0 41.61 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 702μs 3.83μs 21.7μs 0.353 0 0 41.77 KB
master WriteAndFlushEnrichedTraces net472 896μs 4.16μs 16.6μs 8.61 2.26 0.453 53.33 KB
#6002 WriteAndFlushEnrichedTraces net6.0 593μs 3.37μs 24μs 0.28 0 0 41.75 KB
#6002 WriteAndFlushEnrichedTraces netcoreapp3.1 720μs 4.13μs 33.6μs 0.345 0 0 41.69 KB
#6002 WriteAndFlushEnrichedTraces net472 885μs 4.28μs 18.1μs 8.36 2.64 0.44 53.33 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.22μs 1.29ns 4.99ns 0.014 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.76μs 1.02ns 3.67ns 0.0133 0 0 1.02 KB
master ExecuteNonQuery net472 2.13μs 3.52ns 13.6ns 0.157 0 0 987 B
#6002 ExecuteNonQuery net6.0 1.24μs 1.13ns 4.24ns 0.0142 0 0 1.02 KB
#6002 ExecuteNonQuery netcoreapp3.1 1.82μs 1.81ns 7.03ns 0.0138 0 0 1.02 KB
#6002 ExecuteNonQuery net472 2.09μs 2.57ns 9.97ns 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.25μs 1.11ns 4.15ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.47μs 1.2ns 4.66ns 0.0127 0 0 976 B
master CallElasticsearch net472 2.52μs 1.02ns 3.8ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.23μs 0.609ns 2.28ns 0.0129 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.7μs 0.489ns 1.83ns 0.0135 0 0 1.02 KB
master CallElasticsearchAsync net472 2.62μs 1.65ns 6.39ns 0.167 0 0 1.05 KB
#6002 CallElasticsearch net6.0 1.21μs 1.09ns 4.08ns 0.0133 0 0 976 B
#6002 CallElasticsearch netcoreapp3.1 1.46μs 0.465ns 1.68ns 0.0132 0 0 976 B
#6002 CallElasticsearch net472 2.45μs 0.987ns 3.69ns 0.157 0 0 995 B
#6002 CallElasticsearchAsync net6.0 1.32μs 0.721ns 2.7ns 0.0134 0 0 952 B
#6002 CallElasticsearchAsync netcoreapp3.1 1.61μs 0.705ns 2.64ns 0.0136 0 0 1.02 KB
#6002 CallElasticsearchAsync net472 2.55μs 1.33ns 5.15ns 0.166 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.39μs 0.417ns 1.5ns 0.0132 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.67μs 0.614ns 2.38ns 0.0124 0 0 952 B
master ExecuteAsync net472 1.8μs 0.695ns 2.6ns 0.145 0 0 915 B
#6002 ExecuteAsync net6.0 1.3μs 1.89ns 7.08ns 0.0132 0 0 952 B
#6002 ExecuteAsync netcoreapp3.1 1.58μs 0.368ns 1.33ns 0.0128 0 0 952 B
#6002 ExecuteAsync net472 1.7μs 0.654ns 2.53ns 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.12μs 1.95ns 7.29ns 0.0311 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.1μs 1.63ns 6.32ns 0.0382 0 0 2.76 KB
master SendAsync net472 7.68μs 1.55ns 5.99ns 0.497 0 0 3.15 KB
#6002 SendAsync net6.0 4.25μs 2.4ns 9.3ns 0.0297 0 0 2.22 KB
#6002 SendAsync netcoreapp3.1 5.04μs 2.41ns 9.34ns 0.0358 0 0 2.76 KB
#6002 SendAsync net472 7.81μs 2.37ns 8.85ns 0.5 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.57μs 0.437ns 1.63ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.37μs 0.898ns 3.48ns 0.0226 0 0 1.64 KB
master EnrichedLog net472 2.8μs 1.72ns 6.64ns 0.25 0 0 1.57 KB
#6002 EnrichedLog net6.0 1.48μs 0.679ns 2.45ns 0.0228 0 0 1.64 KB
#6002 EnrichedLog netcoreapp3.1 2.29μs 0.833ns 3.22ns 0.0217 0 0 1.64 KB
#6002 EnrichedLog net472 2.81μs 2.2ns 8.53ns 0.25 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 117μs 193ns 747ns 0 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 180ns 674ns 0.0591 0 0 4.28 KB
master EnrichedLog net472 149μs 235ns 910ns 0.667 0.222 0 4.46 KB
#6002 EnrichedLog net6.0 115μs 241ns 933ns 0.0578 0 0 4.28 KB
#6002 EnrichedLog netcoreapp3.1 121μs 156ns 563ns 0 0 0 4.28 KB
#6002 EnrichedLog net472 147μs 156ns 604ns 0.656 0.219 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 2.92μs 0.651ns 2.44ns 0.0307 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.27μs 1.94ns 7.24ns 0.0278 0 0 2.2 KB
master EnrichedLog net472 4.79μs 1.32ns 5.12ns 0.318 0 0 2.02 KB
#6002 EnrichedLog net6.0 3.19μs 0.924ns 3.58ns 0.031 0 0 2.2 KB
#6002 EnrichedLog netcoreapp3.1 4.3μs 0.755ns 2.83ns 0.0302 0 0 2.2 KB
#6002 EnrichedLog net472 5.03μs 1.6ns 6.18ns 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.29μs 0.516ns 2ns 0.0162 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.75μs 2.09ns 8.1ns 0.0158 0 0 1.14 KB
master SendReceive net472 2.1μs 2.77ns 10.7ns 0.183 0.00106 0 1.16 KB
#6002 SendReceive net6.0 1.37μs 0.902ns 3.37ns 0.0165 0 0 1.14 KB
#6002 SendReceive netcoreapp3.1 1.79μs 0.456ns 1.71ns 0.0151 0 0 1.14 KB
#6002 SendReceive net472 2.2μs 2.06ns 7.96ns 0.183 0.0011 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.79μs 0.773ns 2.89ns 0.0223 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.87μs 0.913ns 3.42ns 0.0214 0 0 1.65 KB
master EnrichedLog net472 4.38μs 1.44ns 5.57ns 0.323 0 0 2.04 KB
#6002 EnrichedLog net6.0 2.8μs 1.11ns 4.3ns 0.0225 0 0 1.6 KB
#6002 EnrichedLog netcoreapp3.1 3.79μs 1.81ns 6.54ns 0.0209 0 0 1.65 KB
#6002 EnrichedLog net472 4.26μs 2.2ns 8.24ns 0.322 0 0 2.04 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 392ns 0.206ns 0.798ns 0.00793 0 0 576 B
master StartFinishSpan netcoreapp3.1 592ns 0.189ns 0.68ns 0.0077 0 0 576 B
master StartFinishSpan net472 641ns 0.558ns 2.16ns 0.0916 0 0 578 B
master StartFinishScope net6.0 537ns 0.403ns 1.56ns 0.00972 0 0 696 B
master StartFinishScope netcoreapp3.1 669ns 0.347ns 1.34ns 0.00948 0 0 696 B
master StartFinishScope net472 859ns 0.923ns 3.58ns 0.105 0 0 658 B
#6002 StartFinishSpan net6.0 397ns 0.183ns 0.707ns 0.00799 0 0 576 B
#6002 StartFinishSpan netcoreapp3.1 547ns 0.53ns 1.98ns 0.0079 0 0 576 B
#6002 StartFinishSpan net472 648ns 0.813ns 3.15ns 0.0916 0 0 578 B
#6002 StartFinishScope net6.0 484ns 0.16ns 0.62ns 0.00969 0 0 696 B
#6002 StartFinishScope netcoreapp3.1 687ns 0.331ns 2.09ns 0.00938 0 0 696 B
#6002 StartFinishScope net472 877ns 0.916ns 3.55ns 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 602ns 0.481ns 1.86ns 0.00967 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 943ns 0.737ns 2.86ns 0.00942 0 0 696 B
master RunOnMethodBegin net472 1.18μs 1.16ns 4.48ns 0.104 0 0 658 B
#6002 RunOnMethodBegin net6.0 600ns 0.407ns 1.58ns 0.00992 0 0 696 B
#6002 RunOnMethodBegin netcoreapp3.1 877ns 0.591ns 2.29ns 0.00964 0 0 696 B
#6002 RunOnMethodBegin net472 1.17μs 0.827ns 3.2ns 0.104 0 0 658 B

@andrewlock andrewlock added area:profiler Issues related to the continous-profiler and removed area:profiler labels Sep 10, 2024
@chrisnas chrisnas merged commit 033b89c into master Sep 12, 2024
62 of 68 checks passed
@chrisnas chrisnas deleted the chrisnas/fix_duplicate_telemetry branch September 12, 2024 12:01
@github-actions github-actions bot added this to the vNext-v3 milestone Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:profiler Issues related to the continous-profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants