Skip to content

Normalize the environment variable names used by crashtracking (#5898 -> v2)#5936

Merged
andrewlock merged 2 commits into
release/2.xfrom
kevin/crashtracking_env-v2
Aug 27, 2024
Merged

Normalize the environment variable names used by crashtracking (#5898 -> v2)#5936
andrewlock merged 2 commits into
release/2.xfrom
kevin/crashtracking_env-v2

Conversation

@andrewlock

Copy link
Copy Markdown
Member

Summary of changes

Normalize the environment variable names used by crashtracking.

DD_CRASHTRACKING_*: environment variables expected to be set by the customers. Currently:

  • DD_CRASHTRACKING_ENABLED: enables or disables crashtracking (default: enabled)

DD_INTERNAL_CRASHTRACKING_*: environment variables used by the tracer infrastructure and/or tests. Currently:

  • DD_INTERNAL_CRASHTRACKING_PASSTHROUGH: automatically set to decide whether the real createdump should be called or not
  • DD_INTERNAL_CRASHTRACKING_OUTPUT: save the crash report to a file instead of using telemetry

Reason for change

Now that other languages are implementing the feature, it's important to have consistent names.

Implementation details

DD_TRACE_CRASH_HANDLER is not needed anymore, removed it.
Removed the profiler tests that relied on DD_TRACE_CRASH_HANDLER (they're not needed now that we have crashtracking tests).

Test coverage

The existing tests were updated.

Other Details

Backport of

Normalize the environment variable names used by crashtracking.

`DD_CRASHTRACKING_*`: environment variables expected to be set by the
customers. Currently:
- `DD_CRASHTRACKING_ENABLED`: enables or disables crashtracking
(default: enabled)

`DD_INTERNAL_CRASHTRACKING_*`: environment variables used by the tracer
infrastructure and/or tests. Currently:
- `DD_INTERNAL_CRASHTRACKING_PASSTHROUGH`: automatically set to decide
whether the real createdump should be called or not
- `DD_INTERNAL_CRASHTRACKING_OUTPUT`: save the crash report to a file
instead of using telemetry

Now that other languages are implementing the feature, it's important to
have consistent names.

`DD_TRACE_CRASH_HANDLER` is not needed anymore, removed it.
Removed the profiler tests that relied on `DD_TRACE_CRASH_HANDLER`
(they're not needed now that we have crashtracking tests).

The existing tests were updated.

@dromanol dromanol left a comment

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.

👍

@datadog-ddstaging

datadog-ddstaging Bot commented Aug 23, 2024

Copy link
Copy Markdown

Datadog Report

Branch report: kevin/crashtracking_env-v2
Commit report: b0ff5ed
Test service: dd-trace-dotnet

✅ 0 Failed, 344226 Passed, 2050 Skipped, 15h 33m 20.67s Total Time

@andrewlock

andrewlock commented Aug 23, 2024

Copy link
Copy Markdown
Member Author

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 (5936) - mean (74ms)  : 65, 83
     .   : milestone, 74,

    section CallTarget+Inlining+NGEN
    This PR (5936) - mean (1,026ms)  : 1010, 1041
     .   : milestone, 1026,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5936) - mean (110ms)  : 107, 113
     .   : milestone, 110,

    section CallTarget+Inlining+NGEN
    This PR (5936) - mean (708ms)  : 689, 727
     .   : milestone, 708,

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

    section CallTarget+Inlining+NGEN
    This PR (5936) - mean (666ms)  : 646, 686
     .   : milestone, 666,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (5936) - mean (192ms)  : 188, 195
     .   : milestone, 192,

    section CallTarget+Inlining+NGEN
    This PR (5936) - mean (1,111ms)  : 1085, 1136
     .   : milestone, 1111,

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

    section CallTarget+Inlining+NGEN
    This PR (5936) - mean (878ms)  : 853, 903
     .   : milestone, 878,

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

    section CallTarget+Inlining+NGEN
    This PR (5936) - mean (865ms)  : 836, 893
     .   : milestone, 865,

Loading

Comment thread profiler/src/ProfilerEngine/Datadog.Linux.ApiWrapper/functions_to_wrap.c Outdated
@andrewlock

Copy link
Copy Markdown
Member Author

Benchmarks Report for tracer 🐌

Benchmarks for #5936 compared to master:

  • 2 benchmarks are faster, with geometric mean 1.157
  • 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.98μs 45ns 305ns 0.0188 0.0075 0 5.43 KB
master StartStopWithChild netcoreapp3.1 9.93μs 56ns 376ns 0.0297 0.0149 0 5.62 KB
master StartStopWithChild net472 15.8μs 55.7ns 216ns 1.02 0.306 0.0943 6.06 KB
#5936 StartStopWithChild net6.0 7.81μs 43ns 251ns 0.015 0.00748 0 5.43 KB
#5936 StartStopWithChild netcoreapp3.1 9.84μs 52.2ns 271ns 0.0189 0.00944 0 5.62 KB
#5936 StartStopWithChild net472 17.2μs 97.8ns 770ns 1.01 0.301 0.0951 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 459μs 209ns 809ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 635μs 426ns 1.59μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 845μs 532ns 1.99μs 0.422 0 0 3.3 KB
#5936 WriteAndFlushEnrichedTraces net6.0 510μs 374ns 1.45μs 0 0 0 2.7 KB
#5936 WriteAndFlushEnrichedTraces netcoreapp3.1 643μs 431ns 1.67μs 0 0 0 2.7 KB
#5936 WriteAndFlushEnrichedTraces net472 845μs 343ns 1.28μs 0.422 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 192μs 1.07μs 7.01μs 0.198 0 0 18.45 KB
master SendRequest netcoreapp3.1 214μs 1.22μs 9.35μs 0.211 0 0 20.61 KB
master SendRequest net472 0.000893ns 0.000468ns 0.00175ns 0 0 0 0 b
#5936 SendRequest net6.0 186μs 998ns 5.55μs 0.195 0 0 18.45 KB
#5936 SendRequest netcoreapp3.1 211μs 1.2μs 8.98μs 0.203 0 0 20.61 KB
#5936 SendRequest net472 0.003ns 0.000913ns 0.00353ns 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 573μs 989ns 3.57μs 0.536 0 0 41.76 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 731μs 3.79μs 19.3μs 0.368 0 0 41.42 KB
master WriteAndFlushEnrichedTraces net472 880μs 3.72μs 14.4μs 8.8 2.64 0.44 53.34 KB
#5936 WriteAndFlushEnrichedTraces net6.0 564μs 2.69μs 14μs 0.571 0 0 41.72 KB
#5936 WriteAndFlushEnrichedTraces netcoreapp3.1 659μs 3.37μs 15.8μs 0.336 0 0 41.62 KB
#5936 WriteAndFlushEnrichedTraces net472 883μs 4.19μs 16.2μs 8.42 2.66 0.443 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5936

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.DbCommandBenchmark.ExecuteNonQuery‑net6.0 1.169 1,393.67 1,192.48

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.39μs 0.903ns 3.5ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.74μs 1.3ns 5.03ns 0.014 0 0 1.02 KB
master ExecuteNonQuery net472 2.07μs 2.93ns 11.4ns 0.156 0 0 987 B
#5936 ExecuteNonQuery net6.0 1.19μs 0.654ns 2.45ns 0.0145 0 0 1.02 KB
#5936 ExecuteNonQuery netcoreapp3.1 1.7μs 0.747ns 2.89ns 0.0136 0 0 1.02 KB
#5936 ExecuteNonQuery net472 1.99μs 1.18ns 4.55ns 0.157 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.22μs 1.52ns 5.7ns 0.0138 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.61μs 3.11ns 12.1ns 0.0131 0 0 976 B
master CallElasticsearch net472 2.4μs 1.63ns 6.32ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.2μs 0.715ns 2.68ns 0.0132 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.61μs 0.613ns 2.3ns 0.0137 0 0 1.02 KB
master CallElasticsearchAsync net472 2.57μs 1.35ns 5.24ns 0.167 0 0 1.05 KB
#5936 CallElasticsearch net6.0 1.21μs 0.726ns 2.72ns 0.0133 0 0 976 B
#5936 CallElasticsearch netcoreapp3.1 1.49μs 0.601ns 2.33ns 0.0127 0 0 976 B
#5936 CallElasticsearch net472 2.43μs 0.818ns 2.95ns 0.157 0 0 995 B
#5936 CallElasticsearchAsync net6.0 1.15μs 0.929ns 3.48ns 0.0132 0 0 952 B
#5936 CallElasticsearchAsync netcoreapp3.1 1.55μs 0.779ns 2.91ns 0.0141 0 0 1.02 KB
#5936 CallElasticsearchAsync net472 2.61μs 1.94ns 7.01ns 0.167 0.0013 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.27μs 1.09ns 4.08ns 0.0133 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.65μs 0.858ns 3.21ns 0.0125 0 0 952 B
master ExecuteAsync net472 1.66μs 0.384ns 1.44ns 0.145 0 0 915 B
#5936 ExecuteAsync net6.0 1.32μs 0.743ns 2.88ns 0.0132 0 0 952 B
#5936 ExecuteAsync netcoreapp3.1 1.67μs 1.05ns 3.92ns 0.0125 0 0 952 B
#5936 ExecuteAsync net472 1.84μs 0.458ns 1.77ns 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.34μs 2.08ns 7.8ns 0.0304 0 0 2.22 KB
master SendAsync netcoreapp3.1 5.08μs 1.51ns 5.64ns 0.0357 0 0 2.76 KB
master SendAsync net472 7.85μs 2.83ns 11ns 0.497 0 0 3.15 KB
#5936 SendAsync net6.0 4.15μs 1.57ns 5.86ns 0.0315 0 0 2.22 KB
#5936 SendAsync netcoreapp3.1 5μs 2.72ns 10.5ns 0.0374 0 0 2.76 KB
#5936 SendAsync net472 7.85μs 2.21ns 7.97ns 0.498 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.49μs 0.763ns 2.96ns 0.0232 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.24μs 1.61ns 6.02ns 0.0223 0 0 1.64 KB
master EnrichedLog net472 2.65μs 1.83ns 6.59ns 0.249 0 0 1.57 KB
#5936 EnrichedLog net6.0 1.55μs 0.541ns 2.02ns 0.0226 0 0 1.64 KB
#5936 EnrichedLog netcoreapp3.1 2.24μs 5.87ns 22ns 0.0223 0 0 1.64 KB
#5936 EnrichedLog net472 2.65μs 3.04ns 10.5ns 0.248 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 200ns 774ns 0.0583 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 120μs 265ns 1.02μs 0 0 0 4.28 KB
master EnrichedLog net472 151μs 201ns 778ns 0.674 0.225 0 4.46 KB
#5936 EnrichedLog net6.0 114μs 186ns 722ns 0.0568 0 0 4.28 KB
#5936 EnrichedLog netcoreapp3.1 119μs 231ns 894ns 0 0 0 4.28 KB
#5936 EnrichedLog net472 148μs 378ns 1.46μ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 3.01μs 0.751ns 2.91ns 0.0301 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.3μs 1.37ns 5.32ns 0.0301 0 0 2.2 KB
master EnrichedLog net472 4.91μs 1.48ns 5.73ns 0.319 0 0 2.02 KB
#5936 EnrichedLog net6.0 2.96μs 0.924ns 3.33ns 0.0311 0 0 2.2 KB
#5936 EnrichedLog netcoreapp3.1 4.25μs 1.49ns 5.57ns 0.0296 0 0 2.2 KB
#5936 EnrichedLog net472 4.91μs 1.48ns 5.75ns 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.33μs 0.667ns 2.58ns 0.016 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.82μs 1.35ns 5.22ns 0.0154 0 0 1.14 KB
master SendReceive net472 2.21μs 2.01ns 7.77ns 0.183 0.00111 0 1.16 KB
#5936 SendReceive net6.0 1.39μs 0.602ns 2.33ns 0.016 0 0 1.14 KB
#5936 SendReceive netcoreapp3.1 1.73μs 1.01ns 3.92ns 0.0149 0 0 1.14 KB
#5936 SendReceive net472 2.13μs 2.6ns 10.1ns 0.183 0.00106 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.88μs 0.836ns 3.24ns 0.0216 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 4μs 1.16ns 4.48ns 0.022 0 0 1.65 KB
master EnrichedLog net472 4.32μs 2.36ns 9.14ns 0.323 0 0 2.04 KB
#5936 EnrichedLog net6.0 2.75μs 0.731ns 2.73ns 0.022 0 0 1.6 KB
#5936 EnrichedLog netcoreapp3.1 3.75μs 1.33ns 5.13ns 0.0225 0 0 1.65 KB
#5936 EnrichedLog net472 4.27μs 2.61ns 9.77ns 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 403ns 0.148ns 0.574ns 0.00813 0 0 576 B
master StartFinishSpan netcoreapp3.1 623ns 0.358ns 1.34ns 0.00779 0 0 576 B
master StartFinishSpan net472 666ns 0.202ns 0.783ns 0.0916 0 0 578 B
master StartFinishScope net6.0 535ns 0.185ns 0.715ns 0.00981 0 0 696 B
master StartFinishScope netcoreapp3.1 737ns 0.29ns 1.12ns 0.00951 0 0 696 B
master StartFinishScope net472 795ns 1.02ns 3.94ns 0.104 0 0 658 B
#5936 StartFinishSpan net6.0 403ns 0.976ns 3.78ns 0.008 0 0 576 B
#5936 StartFinishSpan netcoreapp3.1 629ns 0.502ns 1.94ns 0.00793 0 0 576 B
#5936 StartFinishSpan net472 607ns 0.378ns 1.46ns 0.0916 0 0 578 B
#5936 StartFinishScope net6.0 486ns 0.168ns 0.604ns 0.00976 0 0 696 B
#5936 StartFinishScope netcoreapp3.1 674ns 0.319ns 1.24ns 0.00943 0 0 696 B
#5936 StartFinishScope net472 828ns 0.563ns 2.18ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #5936

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.146 978.91 854.27

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 681ns 0.43ns 1.67ns 0.00963 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 979ns 0.281ns 1.09ns 0.00936 0 0 696 B
master RunOnMethodBegin net472 1.09μs 0.426ns 1.65ns 0.104 0 0 658 B
#5936 RunOnMethodBegin net6.0 667ns 0.605ns 2.26ns 0.00964 0 0 696 B
#5936 RunOnMethodBegin netcoreapp3.1 854ns 0.496ns 1.92ns 0.00948 0 0 696 B
#5936 RunOnMethodBegin net472 1.14μs 0.322ns 1.25ns 0.104 0 0 658 B

@gleocadie gleocadie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@andrewlock
andrewlock merged commit 2b8c0d2 into release/2.x Aug 27, 2024
@andrewlock
andrewlock deleted the kevin/crashtracking_env-v2 branch August 27, 2024 07:42
@github-actions github-actions Bot added this to the vNext-v2 milestone Aug 27, 2024
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.

4 participants