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 DD_INSTRUMENTATION_INSTALL_TYPE variables for known install methods #6695

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewlock
Copy link
Member

@andrewlock andrewlock commented Feb 21, 2025

Summary of changes

Add the DD_INSTRUMENTATION_INSTALL_TYPE for install types for which we can set it

Reason for change

The DD_INSTRUMENTATION_INSTALL_TYPE is used to record when ssi instrumentation is used (for example). I think it makes sense to set this value for some of our installation methods (the ones that set variables automatically for users)

Implementation details

Add DD_INSTRUMENTATION_INSTALL_TYPE for:

  • The windows fleet installer (windows_fleet_installer)
  • The MSI (dotnet_msi)
  • dd-trace tool (dd_trace_tool)
  • dd-dotnet launcher (dd_dotnet_launcher)

Test coverage

Added a small test to the dd-dotnet test (because it was easy, and we were already testing this sort of thing). I don't think it's worth the effort to automatically test the rest personally, but if someone wants to ruin my day they have a great excuse.

Other details

Note that dd-dotnet doesn't use a get env var wrapper, but that's by-design as it doesn't run in partial trust, and there are bigger problems if that fails!

@andrewlock
Copy link
Member Author

andrewlock commented Feb 21, 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.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6695) - mean (69ms)  : 66, 71
     .   : milestone, 69,
    master - mean (70ms)  : 65, 75
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (6695) - mean (992ms)  : 970, 1013
     .   : milestone, 992,
    master - mean (1,001ms)  : 976, 1025
     .   : milestone, 1001,

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

    section CallTarget+Inlining+NGEN
    This PR (6695) - mean (669ms)  : 651, 687
     .   : milestone, 669,
    master - mean (725ms)  : 664, 787
     .   : milestone, 725,

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

    section CallTarget+Inlining+NGEN
    This PR (6695) - mean (630ms)  : 613, 646
     .   : milestone, 630,
    master - mean (690ms)  : 654, 726
     .   : milestone, 690,

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

    section CallTarget+Inlining+NGEN
    This PR (6695) - mean (1,107ms)  : 1075, 1138
     .   : milestone, 1107,
    master - mean (1,106ms)  : 1081, 1132
     .   : milestone, 1106,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6695) - mean (271ms)  : 266, 275
     .   : milestone, 271,
    master - mean (270ms)  : 266, 275
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (6695) - mean (863ms)  : 832, 893
     .   : milestone, 863,
    master - mean (865ms)  : 835, 894
     .   : milestone, 865,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6695) - mean (263ms)  : 258, 268
     .   : milestone, 263,
    master - mean (262ms)  : 258, 266
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (6695) - mean (844ms)  : 802, 885
     .   : milestone, 844,
    master - mean (847ms)  : 813, 881
     .   : milestone, 847,

Loading

@andrewlock
Copy link
Member Author

andrewlock commented Feb 21, 2025

Benchmarks Report for tracer 🐌

Benchmarks for #6695 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.171
  • 1 benchmarks are slower, with geometric mean 1.204
  • 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.17μs 50.4ns 501ns 0.0127 0.00422 0 5.6 KB
master StartStopWithChild netcoreapp3.1 10.4μs 61.1ns 573ns 0.0204 0.00509 0 5.81 KB
master StartStopWithChild net472 15.9μs 57.7ns 223ns 1.04 0.304 0.096 6.21 KB
#6695 StartStopWithChild net6.0 8.59μs 50.5ns 495ns 0.017 0.00849 0 5.61 KB
#6695 StartStopWithChild netcoreapp3.1 10.6μs 61.4ns 506ns 0.0194 0.00486 0 5.8 KB
#6695 StartStopWithChild net472 16.3μs 65.9ns 255ns 1.06 0.328 0.104 6.21 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 396ns 1.48μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 661μs 493ns 1.84μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 848μs 420ns 1.52μs 0.422 0 0 3.3 KB
#6695 WriteAndFlushEnrichedTraces net6.0 470μs 779ns 3.02μs 0 0 0 2.7 KB
#6695 WriteAndFlushEnrichedTraces netcoreapp3.1 656μs 481ns 1.74μs 0 0 0 2.7 KB
#6695 WriteAndFlushEnrichedTraces net472 841μs 481ns 1.73μs 0.419 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 129μs 519ns 2.01μs 0.19 0 0 14.47 KB
master SendRequest netcoreapp3.1 144μs 564ns 2.18μs 0.215 0 0 17.27 KB
master SendRequest net472 0.0138ns 0.00198ns 0.00769ns 0 0 0 0 b
#6695 SendRequest net6.0 132μs 485ns 1.88μs 0.13 0 0 14.47 KB
#6695 SendRequest netcoreapp3.1 142μs 629ns 2.43μs 0.209 0 0 17.27 KB
#6695 SendRequest net472 0.00845ns 0.00185ns 0.00715ns 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 568μs 3.03μs 16.3μs 0.566 0 0 41.58 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 661μs 2.35μs 8.49μs 0.327 0 0 41.74 KB
master WriteAndFlushEnrichedTraces net472 863μs 4.1μs 16.4μs 8.68 2.6 0.434 53.31 KB
#6695 WriteAndFlushEnrichedTraces net6.0 573μs 3.14μs 18.8μs 0.601 0 0 41.57 KB
#6695 WriteAndFlushEnrichedTraces netcoreapp3.1 687μs 3.87μs 33μs 0.331 0 0 41.74 KB
#6695 WriteAndFlushEnrichedTraces net472 842μs 3.57μs 13.8μs 8.39 2.52 0.419 53.28 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.31μs 1.04ns 4.02ns 0.0138 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.83μs 1.54ns 5.98ns 0.0137 0 0 1.02 KB
master ExecuteNonQuery net472 2.09μs 4.61ns 17.9ns 0.156 0.00105 0 987 B
#6695 ExecuteNonQuery net6.0 1.31μs 2.62ns 9.44ns 0.0144 0 0 1.02 KB
#6695 ExecuteNonQuery netcoreapp3.1 1.69μs 1.25ns 4.69ns 0.0135 0 0 1.02 KB
#6695 ExecuteNonQuery net472 2.1μs 1.34ns 5.02ns 0.157 0.00105 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.19μs 0.665ns 2.58ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.55μs 1.19ns 4.61ns 0.0132 0 0 976 B
master CallElasticsearch net472 2.52μs 1.47ns 5.69ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.27μs 0.432ns 1.67ns 0.0133 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.64μs 0.629ns 2.44ns 0.0139 0 0 1.02 KB
master CallElasticsearchAsync net472 2.67μs 2.35ns 9.1ns 0.166 0 0 1.05 KB
#6695 CallElasticsearch net6.0 1.27μs 0.921ns 3.45ns 0.0136 0 0 976 B
#6695 CallElasticsearch netcoreapp3.1 1.55μs 1.74ns 6.53ns 0.0132 0 0 976 B
#6695 CallElasticsearch net472 2.51μs 2.55ns 9.86ns 0.157 0 0 995 B
#6695 CallElasticsearchAsync net6.0 1.32μs 0.845ns 3.27ns 0.0132 0 0 952 B
#6695 CallElasticsearchAsync netcoreapp3.1 1.63μs 0.996ns 3.73ns 0.0139 0 0 1.02 KB
#6695 CallElasticsearchAsync net472 2.59μs 1.36ns 5.07ns 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.33μs 0.789ns 3.05ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.59μs 2.63ns 10.2ns 0.0128 0 0 952 B
master ExecuteAsync net472 1.9μs 0.837ns 3.24ns 0.145 0 0 915 B
#6695 ExecuteAsync net6.0 1.37μs 0.97ns 3.76ns 0.013 0 0 952 B
#6695 ExecuteAsync netcoreapp3.1 1.74μs 1.07ns 4.15ns 0.0131 0 0 952 B
#6695 ExecuteAsync net472 1.84μs 0.588ns 2.28ns 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.31μs 3.35ns 13ns 0.0323 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.28μs 2.02ns 7.81ns 0.037 0 0 2.85 KB
master SendAsync net472 7.4μs 2.09ns 8.1ns 0.496 0 0 3.12 KB
#6695 SendAsync net6.0 4.52μs 1.58ns 6.12ns 0.0315 0 0 2.31 KB
#6695 SendAsync netcoreapp3.1 5.15μs 2.38ns 8.92ns 0.0386 0 0 2.85 KB
#6695 SendAsync net472 7.41μs 2.15ns 8.31ns 0.494 0 0 3.12 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.47μs 0.573ns 2.22ns 0.0228 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.16μs 1.28ns 4.95ns 0.0228 0 0 1.64 KB
master EnrichedLog net472 2.66μs 1.78ns 6.65ns 0.25 0 0 1.57 KB
#6695 EnrichedLog net6.0 1.52μs 1.53ns 5.74ns 0.0228 0 0 1.64 KB
#6695 EnrichedLog netcoreapp3.1 2.23μs 2.95ns 11.4ns 0.0222 0 0 1.64 KB
#6695 EnrichedLog net472 2.63μs 1.31ns 5.06ns 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 113μs 329ns 1.27μs 0.0573 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 116μs 209ns 809ns 0 0 0 4.28 KB
master EnrichedLog net472 152μs 210ns 814ns 0.679 0.226 0 4.46 KB
#6695 EnrichedLog net6.0 113μs 174ns 672ns 0.0565 0 0 4.28 KB
#6695 EnrichedLog netcoreapp3.1 116μs 191ns 738ns 0.058 0 0 4.28 KB
#6695 EnrichedLog net472 152μs 199ns 771ns 0.677 0.226 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.06μs 0.809ns 2.8ns 0.0306 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.3μs 1.88ns 7.27ns 0.0281 0 0 2.2 KB
master EnrichedLog net472 4.98μs 2.19ns 8.19ns 0.319 0 0 2.02 KB
#6695 EnrichedLog net6.0 3.08μs 0.523ns 1.81ns 0.0312 0 0 2.2 KB
#6695 EnrichedLog netcoreapp3.1 4.18μs 1.25ns 4.85ns 0.0295 0 0 2.2 KB
#6695 EnrichedLog net472 4.79μs 1.31ns 4.89ns 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.45μs 0.764ns 2.86ns 0.016 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.85μs 0.793ns 2.97ns 0.0158 0 0 1.14 KB
master SendReceive net472 2.09μs 1.52ns 5.69ns 0.183 0 0 1.16 KB
#6695 SendReceive net6.0 1.38μs 0.364ns 1.41ns 0.0159 0 0 1.14 KB
#6695 SendReceive netcoreapp3.1 1.8μs 1.02ns 3.7ns 0.0154 0 0 1.14 KB
#6695 SendReceive net472 2.18μs 1.25ns 4.69ns 0.183 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.79μs 0.751ns 2.91ns 0.0223 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.89μs 1.32ns 5.11ns 0.0214 0 0 1.65 KB
master EnrichedLog net472 4.24μs 3.32ns 12.9ns 0.322 0 0 2.04 KB
#6695 EnrichedLog net6.0 2.69μs 1.52ns 5.89ns 0.0229 0 0 1.6 KB
#6695 EnrichedLog netcoreapp3.1 3.78μs 1.05ns 3.79ns 0.0208 0 0 1.65 KB
#6695 EnrichedLog net472 4.12μs 2.63ns 10.2ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6695

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.204 395.66 476.45

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 395ns 0.763ns 2.96ns 0.00817 0 0 576 B
master StartFinishSpan netcoreapp3.1 563ns 1.13ns 4.37ns 0.00781 0 0 576 B
master StartFinishSpan net472 584ns 0.913ns 3.42ns 0.0916 0 0 578 B
master StartFinishScope net6.0 470ns 0.94ns 3.64ns 0.00988 0 0 696 B
master StartFinishScope netcoreapp3.1 683ns 0.979ns 3.66ns 0.00936 0 0 696 B
master StartFinishScope net472 804ns 1.68ns 6.49ns 0.104 0 0 658 B
#6695 StartFinishSpan net6.0 476ns 0.271ns 1.05ns 0.00804 0 0 576 B
#6695 StartFinishSpan netcoreapp3.1 582ns 0.253ns 0.98ns 0.00809 0 0 576 B
#6695 StartFinishSpan net472 582ns 1.31ns 5.07ns 0.0916 0 0 578 B
#6695 StartFinishScope net6.0 503ns 0.142ns 0.551ns 0.00982 0 0 696 B
#6695 StartFinishScope netcoreapp3.1 750ns 1.65ns 6.41ns 0.00939 0 0 696 B
#6695 StartFinishScope net472 846ns 1.72ns 6.66ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #6695

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.171 718.39 613.27

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 717ns 0.979ns 3.79ns 0.00978 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 928ns 1.45ns 5.44ns 0.00949 0 0 696 B
master RunOnMethodBegin net472 1.03μs 3.58ns 13.9ns 0.104 0 0 658 B
#6695 RunOnMethodBegin net6.0 613ns 1.09ns 4.22ns 0.00973 0 0 696 B
#6695 RunOnMethodBegin netcoreapp3.1 905ns 1.33ns 5.16ns 0.00935 0 0 696 B
#6695 RunOnMethodBegin net472 1.06μs 2.39ns 9.25ns 0.104 0 0 658 B

@andrewlock andrewlock force-pushed the andrew/record-install-type branch from 044e0ca to bf59f82 Compare February 21, 2025 15:56
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.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants