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

[Tool] update continuous profiler diagnostics #6014

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Conversation

andrewlock
Copy link
Member

Summary of changes

Fix the diagnostics associated with the expected state of the continuous profiler

Reason for change

In #5240, the continuous profiler gained two new "modes" of operation: delayed enablement based on heuristics, and "monitoring" mode. The tool should be updated to understand those possibilities + handle it in the tests

Implementation details

  • Reset the DD_INJECTION_ENABLED variable before running the tests - the presence/absence of the variable changes the expectations, so we need to account for it
  • Explicitly test the various combinations of DD_INJECTION_ENABLED and DD_PROFILING_ENABLED.

Test coverage

Added additional integration and artifact tests

Other details

This should address most of the issues in the scheduled SSI run. I suspect the windows integration tests may need additional work, as currently the profiler library isn't copied to those tests. Will fix in this PR if that ends up being the case

Supersedes

@andrewlock andrewlock added area:tools area:profiler Issues related to the continous-profiler labels Sep 10, 2024
@andrewlock andrewlock requested a review from a team as a code owner September 10, 2024 09:28
@andrewlock
Copy link
Member Author

andrewlock commented Sep 10, 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 (6014) - mean (70ms)  : 67, 72
     .   : milestone, 70,
    master - mean (69ms)  : 67, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6014) - mean (1,114ms)  : 1095, 1133
     .   : milestone, 1114,
    master - mean (1,116ms)  : 1094, 1137
     .   : milestone, 1116,

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

    section CallTarget+Inlining+NGEN
    This PR (6014) - mean (814ms)  : 801, 827
     .   : milestone, 814,
    master - mean (816ms)  : 797, 834
     .   : milestone, 816,

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

    section CallTarget+Inlining+NGEN
    This PR (6014) - mean (770ms)  : 755, 785
     .   : milestone, 770,
    master - mean (768ms)  : 753, 784
     .   : milestone, 768,

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

    section CallTarget+Inlining+NGEN
    This PR (6014) - mean (1,194ms)  : 1171, 1218
     .   : milestone, 1194,
    master - mean (1,194ms)  : 1171, 1217
     .   : milestone, 1194,

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

    section CallTarget+Inlining+NGEN
    This PR (6014) - mean (972ms)  : 955, 988
     .   : milestone, 972,
    master - mean (974ms)  : 955, 993
     .   : milestone, 974,

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

    section CallTarget+Inlining+NGEN
    This PR (6014) - mean (955ms)  : 927, 982
     .   : milestone, 955,
    master - mean (959ms)  : 940, 978
     .   : milestone, 959,

Loading

@datadog-ddstaging
Copy link

datadog-ddstaging bot commented Sep 10, 2024

Datadog Report

Branch report: andrew/profiler_ssi
Commit report: 1c46986
Test service: dd-trace-dotnet

✅ 0 Failed, 359812 Passed, 2052 Skipped, 15h 10m 54.39s Total Time

@andrewlock
Copy link
Member Author

andrewlock commented Sep 10, 2024

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 (6014) (11.361M)   : 0, 11361016
    master (11.283M)   : 0, 11283455
    benchmarks/2.9.0 (11.185M)   : 0, 11185492

    section Automatic
    This PR (6014) (7.462M)   : 0, 7461794
    master (7.348M)   : 0, 7348323
    benchmarks/2.9.0 (7.935M)   : 0, 7934520

    section Trace stats
    master (7.775M)   : 0, 7774621

    section Manual
    master (10.877M)   : 0, 10876544

    section Manual + Automatic
    This PR (6014) (6.893M)   : 0, 6892787
    master (6.702M)   : 0, 6702266

    section DD_TRACE_ENABLED=0
    master (10.066M)   : 0, 10066409

Loading
gantt
    title Throughput Linux arm64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6014) (9.465M)   : 0, 9464744
    master (9.597M)   : 0, 9597221
    benchmarks/2.9.0 (9.560M)   : 0, 9559569

    section Automatic
    This PR (6014) (6.583M)   : 0, 6582760
    master (6.662M)   : 0, 6661866

    section Trace stats
    master (6.698M)   : 0, 6698477

    section Manual
    master (9.563M)   : 0, 9563004

    section Manual + Automatic
    This PR (6014) (6.273M)   : 0, 6272810
    master (6.210M)   : 0, 6210292

    section DD_TRACE_ENABLED=0
    master (8.980M)   : 0, 8979687

Loading
gantt
    title Throughput Windows x64 (Total requests) 
    dateFormat  X
    axisFormat %s
    section Baseline
    This PR (6014) (10.272M)   : 0, 10272477
    master (10.014M)   : 0, 10013811
    benchmarks/2.9.0 (10.118M)   : 0, 10117626

    section Automatic
    This PR (6014) (6.805M)   : 0, 6804899
    master (6.639M)   : 0, 6638596
    benchmarks/2.9.0 (7.416M)   : 0, 7415715

    section Trace stats
    master (7.359M)   : 0, 7358547

    section Manual
    master (10.064M)   : 0, 10063800

    section Manual + Automatic
    This PR (6014) (6.208M)   : 0, 6207629
    master (6.067M)   : 0, 6066682

    section DD_TRACE_ENABLED=0
    master (9.407M)   : 0, 9406887

Loading

Copy link
Contributor

@chrisnas chrisnas left a comment

Choose a reason for hiding this comment

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

LGTM in terms of validity
see my comments for typos and refactoring

? string.Empty
: ssiInjectionEnabled == true ? "tracer,profiler" : "tracer";

var expected = (enabled, ssiInjectionEnabled) switch
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe extract this code as a helper method and call it also from WorkingWithContinuousProfiler() instead of duplicating the code

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately easier said than done, as these are in completely different projects etc. We could pull it into a separate file that's linked in both, I'll have a look, thanks 👍 Worst case I'll add a comment

@andrewlock
Copy link
Member Author

andrewlock commented Sep 10, 2024

Benchmarks Report for tracer 🐌

Benchmarks for #6014 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.8μs 43.1ns 276ns 0.0155 0.00773 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.97μs 56ns 388ns 0.0192 0.00959 0 5.63 KB
master StartStopWithChild net472 15.7μs 50.2ns 194ns 0.996 0.282 0.0785 6.07 KB
#6014 StartStopWithChild net6.0 7.73μs 41.6ns 297ns 0.0154 0.00772 0 5.43 KB
#6014 StartStopWithChild netcoreapp3.1 9.75μs 50.5ns 294ns 0.0146 0.00487 0 5.62 KB
#6014 StartStopWithChild net472 16.1μs 36.1ns 140ns 1.03 0.304 0.0962 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 493μs 261ns 977ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 630μs 496ns 1.92μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 825μs 567ns 2.2μs 0.411 0 0 3.3 KB
#6014 WriteAndFlushEnrichedTraces net6.0 523μs 489ns 1.89μs 0 0 0 2.7 KB
#6014 WriteAndFlushEnrichedTraces netcoreapp3.1 649μs 460ns 1.78μs 0 0 0 2.7 KB
#6014 WriteAndFlushEnrichedTraces net472 857μs 633ns 2.45μs 0.428 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 208μs 1.38μs 13.6μs 0.212 0 0 18.45 KB
master SendRequest netcoreapp3.1 235μs 1.38μs 13.3μs 0.21 0 0 20.61 KB
master SendRequest net472 0.00116ns 0.000585ns 0.00219ns 0 0 0 0 b
#6014 SendRequest net6.0 199μs 1.15μs 9.39μs 0.185 0 0 18.45 KB
#6014 SendRequest netcoreapp3.1 220μs 1.23μs 8.53μs 0.212 0 0 20.61 KB
#6014 SendRequest net472 7.82E‑05ns 7.82E‑05ns 0.000282ns 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 554μs 1.86μs 6.71μs 0.556 0 0 41.72 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 702μs 3.46μs 15.5μs 0.347 0 0 41.72 KB
master WriteAndFlushEnrichedTraces net472 873μs 3.89μs 15.1μs 8.25 2.6 0.434 53.3 KB
#6014 WriteAndFlushEnrichedTraces net6.0 588μs 3.12μs 15.9μs 0.592 0 0 41.73 KB
#6014 WriteAndFlushEnrichedTraces netcoreapp3.1 694μs 3.86μs 23.8μs 0.353 0 0 41.79 KB
#6014 WriteAndFlushEnrichedTraces net472 893μs 4.46μs 18.9μs 8.36 2.64 0.44 53.38 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.28μs 1.49ns 5.78ns 0.0142 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.8μs 1.07ns 4.01ns 0.0136 0 0 1.02 KB
master ExecuteNonQuery net472 2.03μs 2.81ns 10.1ns 0.156 0 0 987 B
#6014 ExecuteNonQuery net6.0 1.23μs 0.85ns 3.18ns 0.0141 0 0 1.02 KB
#6014 ExecuteNonQuery netcoreapp3.1 1.71μs 1.35ns 5.22ns 0.0138 0 0 1.02 KB
#6014 ExecuteNonQuery net472 2.06μs 2.22ns 8.58ns 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.19μs 0.551ns 2.13ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.5μs 0.669ns 2.41ns 0.0136 0 0 976 B
master CallElasticsearch net472 2.46μs 1.65ns 6.39ns 0.157 0 0 995 B
master CallElasticsearchAsync net6.0 1.3μs 1.35ns 5.24ns 0.0136 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.59μs 0.63ns 2.44ns 0.0138 0 0 1.02 KB
master CallElasticsearchAsync net472 2.61μs 2.43ns 9.09ns 0.167 0 0 1.05 KB
#6014 CallElasticsearch net6.0 1.25μs 0.868ns 3.25ns 0.0138 0 0 976 B
#6014 CallElasticsearch netcoreapp3.1 1.56μs 1.31ns 4.74ns 0.0133 0 0 976 B
#6014 CallElasticsearch net472 2.48μs 2.53ns 9.81ns 0.157 0 0 995 B
#6014 CallElasticsearchAsync net6.0 1.26μs 0.933ns 3.61ns 0.0132 0 0 952 B
#6014 CallElasticsearchAsync netcoreapp3.1 1.54μs 0.986ns 3.69ns 0.0133 0 0 1.02 KB
#6014 CallElasticsearchAsync net472 2.56μs 2.51ns 9.38ns 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.18μs 0.738ns 2.86ns 0.0134 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.7μs 2.25ns 8.71ns 0.0127 0 0 952 B
master ExecuteAsync net472 1.76μs 1.03ns 3.85ns 0.145 0 0 915 B
#6014 ExecuteAsync net6.0 1.24μs 0.569ns 2.2ns 0.0132 0 0 952 B
#6014 ExecuteAsync netcoreapp3.1 1.63μs 0.76ns 2.94ns 0.013 0 0 952 B
#6014 ExecuteAsync net472 1.74μs 0.846ns 3.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.22μs 2.29ns 8.56ns 0.0317 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.05μs 2.54ns 9.5ns 0.0353 0 0 2.76 KB
master SendAsync net472 7.95μs 2.21ns 8.27ns 0.497 0 0 3.15 KB
#6014 SendAsync net6.0 4.17μs 6.46ns 25ns 0.0313 0 0 2.22 KB
#6014 SendAsync netcoreapp3.1 5.12μs 2.06ns 7.99ns 0.0359 0 0 2.76 KB
#6014 SendAsync net472 7.81μs 2.4ns 9.28ns 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.47μs 0.728ns 2.73ns 0.0234 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.16μs 0.635ns 2.46ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.73μs 1.37ns 5.13ns 0.25 0 0 1.57 KB
#6014 EnrichedLog net6.0 1.51μs 0.481ns 1.8ns 0.0226 0 0 1.64 KB
#6014 EnrichedLog netcoreapp3.1 2.25μs 1.09ns 4.23ns 0.0225 0 0 1.64 KB
#6014 EnrichedLog net472 2.83μs 3.91ns 15.1ns 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 116μs 164ns 636ns 0.0579 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 119μs 218ns 845ns 0 0 0 4.28 KB
master EnrichedLog net472 148μs 173ns 646ns 0.661 0.22 0 4.46 KB
#6014 EnrichedLog net6.0 116μs 181ns 700ns 0 0 0 4.28 KB
#6014 EnrichedLog netcoreapp3.1 121μs 205ns 793ns 0 0 0 4.28 KB
#6014 EnrichedLog net472 150μs 269ns 1.04μs 0.668 0.223 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.88μs 0.863ns 3.34ns 0.0304 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.15μs 2.12ns 8.2ns 0.0292 0 0 2.2 KB
master EnrichedLog net472 4.95μs 1.13ns 4.36ns 0.32 0 0 2.02 KB
#6014 EnrichedLog net6.0 3.1μs 0.931ns 3.48ns 0.031 0 0 2.2 KB
#6014 EnrichedLog netcoreapp3.1 4.08μs 1.45ns 5.62ns 0.0287 0 0 2.2 KB
#6014 EnrichedLog net472 4.86μs 1.56ns 6.04ns 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.657ns 2.55ns 0.0158 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.74μs 1.19ns 4.6ns 0.0156 0 0 1.14 KB
master SendReceive net472 2.09μs 2.24ns 8.69ns 0.183 0 0 1.16 KB
#6014 SendReceive net6.0 1.34μs 0.389ns 1.35ns 0.0161 0 0 1.14 KB
#6014 SendReceive netcoreapp3.1 1.76μs 1.77ns 6.86ns 0.0149 0 0 1.14 KB
#6014 SendReceive net472 2.17μs 1.85ns 6.94ns 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.74μs 1.28ns 4.97ns 0.0219 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.81μs 2.08ns 8.06ns 0.0209 0 0 1.65 KB
master EnrichedLog net472 4.23μs 3.42ns 13.2ns 0.322 0 0 2.04 KB
#6014 EnrichedLog net6.0 2.72μs 0.657ns 2.37ns 0.0218 0 0 1.6 KB
#6014 EnrichedLog netcoreapp3.1 3.86μs 2.52ns 9.77ns 0.0211 0 0 1.65 KB
#6014 EnrichedLog net472 4.3μs 3.58ns 13.9ns 0.324 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 399ns 0.218ns 0.846ns 0.00816 0 0 576 B
master StartFinishSpan netcoreapp3.1 587ns 0.523ns 2.03ns 0.00774 0 0 576 B
master StartFinishSpan net472 629ns 0.613ns 2.37ns 0.0916 0 0 578 B
master StartFinishScope net6.0 497ns 0.475ns 1.84ns 0.00971 0 0 696 B
master StartFinishScope netcoreapp3.1 680ns 0.464ns 1.74ns 0.00945 0 0 696 B
master StartFinishScope net472 931ns 2.06ns 7.97ns 0.104 0 0 658 B
#6014 StartFinishSpan net6.0 392ns 0.227ns 0.877ns 0.00812 0 0 576 B
#6014 StartFinishSpan netcoreapp3.1 591ns 0.443ns 1.6ns 0.00778 0 0 576 B
#6014 StartFinishSpan net472 586ns 0.698ns 2.7ns 0.0916 0 0 578 B
#6014 StartFinishScope net6.0 490ns 0.308ns 1.15ns 0.00978 0 0 696 B
#6014 StartFinishScope netcoreapp3.1 736ns 1.22ns 4.74ns 0.00941 0 0 696 B
#6014 StartFinishScope net472 934ns 0.893ns 3.46ns 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 642ns 0.652ns 2.53ns 0.00964 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 917ns 0.716ns 2.77ns 0.00923 0 0 696 B
master RunOnMethodBegin net472 1.1μs 1.17ns 4.52ns 0.105 0 0 658 B
#6014 RunOnMethodBegin net6.0 640ns 0.43ns 1.61ns 0.0098 0 0 696 B
#6014 RunOnMethodBegin netcoreapp3.1 947ns 2.37ns 9.18ns 0.00929 0 0 696 B
#6014 RunOnMethodBegin net472 1.09μs 0.755ns 2.92ns 0.104 0 0 658 B

andrewlock added a commit that referenced this pull request Sep 11, 2024
## Summary of changes

Fix profiler integration tests in the SSI run

## Reason for change

#5240 changed the behaviour of the profiler in the presence of SSI
variables. We have a scheduled run on master that specifically sets the
variables. This breaks the profiler integration tests that depend on
those variables.

## Implementation details

Add an "environment restorer" attribute, which mirrors the one we use in
the tracing integration tests. Ensures that the SSI tests are working in
their expected environment

## Test coverage

This is the test, but did [a dedicated run
too](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=163728&view=results),
and it works

## Other details

Related to #6014
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.

👍

@@ -46,9 +46,11 @@ internal static class Resources
public const string DdAgentChecks = "---- DATADOG AGENT CHECKS -----";

public const string ContinuousProfilerEnabled = "DD_PROFILING_ENABLED is set.";
public const string ContinuousProfilerSsiDeployed = "DD_INJECTION_ENABLED is set. Profiler is deployed through SSI.";
public const string ContinuousProfilerEnabledWithHeuristics = "DD_PROFILING_ENABLED is set to 'auto'. The continuous profiler is enabled and may begin profiling based on heuristics.";
Copy link
Contributor

Choose a reason for hiding this comment

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

Does may indicate that it also may not? Essentially wondering if may == will here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, it might not start profiling, depending on the heuristics. e.g. if it's a short-lived process, or a process where there's no tracing happening

@andrewlock andrewlock merged commit e84f74c into master Sep 12, 2024
69 of 72 checks passed
@andrewlock andrewlock deleted the andrew/profiler_ssi branch September 12, 2024 11:20
@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 area:tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants