-
Notifications
You must be signed in to change notification settings - Fork 145
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
[Crashtracking] Fix crashtracking in single-file apps #6677
base: master
Are you sure you want to change the base?
Conversation
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:
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 (6677) - mean (69ms) : 65, 72
. : milestone, 69,
master - mean (73ms) : 70, 77
. : milestone, 73,
section CallTarget+Inlining+NGEN
This PR (6677) - mean (994ms) : 966, 1022
. : milestone, 994,
master - mean (1,034ms) : 1004, 1063
. : milestone, 1034,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6677) - mean (102ms) : 99, 104
. : milestone, 102,
master - mean (108ms) : 105, 111
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6677) - mean (669ms) : 653, 685
. : milestone, 669,
master - mean (698ms) : 680, 717
. : milestone, 698,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6677) - mean (88ms) : 86, 91
. : milestone, 88,
master - mean (95ms) : 92, 97
. : milestone, 95,
section CallTarget+Inlining+NGEN
This PR (6677) - mean (628ms) : 609, 647
. : milestone, 628,
master - mean (656ms) : 639, 672
. : milestone, 656,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6677) - mean (191ms) : 187, 195
. : milestone, 191,
master - mean (191ms) : 186, 197
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6677) - mean (1,112ms) : 1080, 1144
. : milestone, 1112,
master - mean (1,109ms) : 1073, 1146
. : milestone, 1109,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6677) - mean (271ms) : 266, 277
. : milestone, 271,
master - mean (273ms) : 266, 280
. : milestone, 273,
section CallTarget+Inlining+NGEN
This PR (6677) - mean (868ms) : 832, 904
. : milestone, 868,
master - mean (867ms) : 834, 900
. : milestone, 867,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6677) - mean (263ms) : 257, 268
. : milestone, 263,
master - mean (262ms) : 258, 267
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6677) - mean (843ms) : 810, 876
. : milestone, 843,
master - mean (849ms) : 822, 877
. : milestone, 849,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, hopefully it fixes the failures in #6678
Benchmarks Report for tracer 🐌Benchmarks for #6677 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 | 1.168 | 395.66 | 462.29 |
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 |
#6677 | StartFinishSpan |
net6.0 | 462ns | 1.05ns | 3.94ns | 0.00817 | 0 | 0 | 576 B |
#6677 | StartFinishSpan |
netcoreapp3.1 | 597ns | 0.991ns | 3.84ns | 0.00785 | 0 | 0 | 576 B |
#6677 | StartFinishSpan |
net472 | 613ns | 1.22ns | 4.71ns | 0.0917 | 0 | 0 | 578 B |
#6677 | StartFinishScope |
net6.0 | 482ns | 0.8ns | 3.1ns | 0.00972 | 0 | 0 | 696 B |
#6677 | StartFinishScope |
netcoreapp3.1 | 719ns | 1.36ns | 5.28ns | 0.00912 | 0 | 0 | 696 B |
#6677 | StartFinishScope |
net472 | 859ns | 1.75ns | 6.79ns | 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 | 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 |
#6677 | RunOnMethodBegin |
net6.0 | 673ns | 0.172ns | 0.668ns | 0.00981 | 0 | 0 | 696 B |
#6677 | RunOnMethodBegin |
netcoreapp3.1 | 936ns | 0.447ns | 1.55ns | 0.00937 | 0 | 0 | 696 B |
#6677 | RunOnMethodBegin |
net472 | 1.08μs | 0.658ns | 2.55ns | 0.104 | 0 | 0 | 658 B |
…ts for the NuGet packages (#6678) ## Summary of changes - Pack the trimming file into the _Datadog.Trace_ NuGet package - Add smoke tests for the _Datadog.Trace_ and _Datadog.Trace.Trimming_ NuGet packages - Remove the unnecessary sdk.props file from _Datadog.Trace.Trimming_ ## Reason for change When users are building trimmed (non-aot) apps, they need to reference our trimming file, which is currently exposed via the _Datadog.Trace.Trimming_ NuGet package. We created this as a separate package, because we didn't want people to have to reference the _Datadog.Trace_ NuGet if they didn't need it. However, there's not really a good reason to force people to _have_ to reference another NuGet package if they are _already_ referencing _Datadog.Trace_. And there's no harm in including the trimming file for non-trimmed apps, it has no impact. ## Implementation details - Pack the same trimming.XML file into the _Datadog.Trace_ NuGet package - Include a _Datadog.Trace.props_ file to automatically reference the trimmer file when the NuGet is referenced - Added smoke tests that confirm the _NuGet_ packaging is correct for both the new package, and the existing package - We already had "integration" tests that confirm the trimmer file works, but we didn't have any tests that were using the NuGet package, to confirm the `props` are correctly added etc. - Removed the `sdk/sdk.props` file from _Datadog.Trace.Trimming_ as it's unused. This file is only useful if you're creating a "[custom .NET SDK](https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022#use-the-sdk-attribute-on-the-project-element)" to reference in the `<Project SDK="Some.SDK">` element (which we're not). ## Test coverage Added smoke tests to confirm both the _Datadog.Trace_ and _Datadog.Trace.Trimming_ packages work as expected. For now, these are: - `linux-x64`/`linux-musl-x64` only - `net8.0`/`net9.0` only We could expand that further if we want, but I'm not massively inclined to do so - we primarily want to ensure the _packages_ are valid, and we don't really need to run that across all the different platforms IMO. Plus it will just increase the chance of flake. ## Other details As part of this, noticed that crash tracking didn't work. - Disabled crash tracking in these tests for now - #6677 was raised in response - Ideally we should merge this, and then re-enable the crash tracking tests in that PR I've kept these in the "standard, every PR" set of smoke tests for now, but maybe we should move them to the master-only set? 🤷♂️ --------- Co-authored-by: Kevin Gosse <[email protected]>
096456b
to
6b51050
Compare
6b51050
to
f488df3
Compare
Summary of changes
Register the crashtracking WER handler even if we fail to unregister the .NET one.
Reason for change
For crashtracking to work, we need to unregister the WER handler registered by .NET, because it claims the crash and we won't be called. To unregister it, we need two information: the path to
coreclr.dll
, and its address in memory. It fails in single-file apps because there is nocoreclr.dll
. However, it also means that the .NET registration is invalid, so we will still be called if we register our own handler.Regardless, even if the .NET WER handler registration is correct, it doesn't hurt to still register our own.
Test coverage
Tested on my machine. I don't think it's worth the hassle of publishing Samples.Console as single file.