Skip to content

Add net6.0 target#2405

Merged
andrewlock merged 14 commits into
masterfrom
colin/add-net6-target
Apr 8, 2022
Merged

Add net6.0 target#2405
andrewlock merged 14 commits into
masterfrom
colin/add-net6-target

Conversation

@colin-higgins

Copy link
Copy Markdown
Member

Add net6.0 target to enable UDS stream within HttpClient (And other things)

@DataDog/apm-dotnet

@colin-higgins
colin-higgins requested a review from a team as a code owner February 4, 2022 16:47
@colin-higgins colin-higgins self-assigned this Feb 4, 2022

@lucaspimentel lucaspimentel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left some comments about NETCOREAPP3_1_OR_GREATER.


<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net461;netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎉

@andrewlock

This comment has been minimized.

@kevingosse

Copy link
Copy Markdown
Contributor

The loader needs to be updated as well, there is a condition to load netstandard2.0 or netcoreapp3.1 depending on the runtime.

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Made some suggestions for simplifying the process of adding conditionals at a later date, and fixed one of the updated conditionals.

I think this update will require changes to the installer too?

We should probably hold off merging till after next release (in case of unforseen build issues)

Comment thread tracer/src/Datadog.Trace/ClrProfiler/Instrumentation.cs
Comment thread tracer/src/Datadog.Trace/Datadog.Trace.csproj Outdated
Comment thread tracer/src/Datadog.Trace/Datadog.Trace.csproj Outdated
Comment thread tracer/src/Datadog.Trace/Datadog.Trace.csproj Outdated
Comment thread tracer/test/benchmarks/Benchmarks.Trace/Benchmarks.Trace.csproj Outdated
Comment thread tracer/src/Datadog.Trace.BenchmarkDotNet/Datadog.Trace.BenchmarkDotNet.csproj Outdated
Comment thread tracer/src/Datadog.Trace.MSBuild/Datadog.Trace.MSBuild.csproj Outdated
Comment thread tracer/src/Datadog.Trace.MSBuild/Datadog.Trace.MSBuild.csproj Outdated
Comment thread tracer/src/Datadog.Trace.OpenTracing/Datadog.Trace.OpenTracing.csproj Outdated
Comment thread tracer/src/Datadog.Trace.OpenTracing/Datadog.Trace.OpenTracing.csproj Outdated
Comment thread tracer/src/Datadog.Trace/FrameworkDescription.NetCore.cs Outdated

@zacharycmontoya zacharycmontoya 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.

I completed a first pass through the PR. I think the other suggestions are good and it looks good to me after applying them

@lucaspimentel lucaspimentel added area:builds project files, build scripts, pipelines, versioning, releases, packages area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) labels Feb 10, 2022
@andrewlock
andrewlock force-pushed the colin/add-net6-target branch 2 times, most recently from 321740a to 99477ea Compare April 7, 2022 10:54
@colin-higgins
colin-higgins requested a review from a team as a code owner April 7, 2022 10:54
@andrewlock

This comment has been minimized.

@andrewlock

This comment has been minimized.

@andrewlock
andrewlock force-pushed the colin/add-net6-target branch from be7277e to 35796d0 Compare April 8, 2022 06:51
@andrewlock

This comment has been minimized.

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is good to go now 🎉

@andrewlock
andrewlock force-pushed the colin/add-net6-target branch from 1158588 to 71b6a9a Compare April 8, 2022 10:48

@kevingosse kevingosse 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.

LGTM, thanks!

public IEnumerable<string> GetValues(string name)
{
if (_headers.TryGetValues(name, out IEnumerable<string> values))
if (_headers.TryGetValues(name, out var values))

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.

❤️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😂 I wish it was due to pure intentions, but it's because it has a different type when it's on .NET 6 (nullable)

Comment thread tracer/src/Datadog.Trace/Vendors/dnlib/DotNet/ModuleDefMD.cs
@andrewlock

Copy link
Copy Markdown
Member

Code Coverage Report 📊

✔️ Merging #2405 into master will not change line coverage
✔️ Merging #2405 into master will not change branch coverage
⛔ Merging #2405 into master will will increase complexity by 6

master #2405 Change
Lines 13438 / 18464 13449 / 18473
Lines % 73% 73% 0% ✔️
Branches 7754 / 11017 7774 / 11017
Branches % 70% 71% 0% ✔️
Complexity 12307 12313 6

View the full report for further details:

Datadog.Trace Breakdown ✔️

master #2405 Change
Lines % 73% 73% 0% ✔️
Branches % 70% 71% 0% ✔️
Complexity 12307 12313 6

The following classes have significant coverage changes.

File Line coverage change Branch coverage change Complexity change
Datadog.Trace.DiagnosticListeners.AspNetCoreDiagnosticObserver 4% ✔️ 6% ✔️ 0 ✔️
Datadog.Trace.Telemetry.JsonHttpClientTelemetryTransport 26% ✔️ 38% ✔️ 0 ✔️
Datadog.Trace.Telemetry.JsonWebRequestTelemetryTransport 27% ✔️ 57% ✔️ 0 ✔️

View the full reports for further details:

@andrewlock

Copy link
Copy Markdown
Member

Benchmarks Report 🐌

Benchmarks for #2405 compared to master:

  • 1 benchmarks are faster, with geometric mean 1.183
  • 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.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net472 981μs 4.09μs 15.8μs 0 0 0 3.16 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 747μs 2.59μs 9.68μs 0 0 0 2.57 KB
#2405 WriteAndFlushEnrichedTraces net472 1.03ms 6.03μs 59.1μs 0 0 0 3.17 KB
#2405 WriteAndFlushEnrichedTraces netcoreapp3.1 750μs 3.62μs 14.5μs 0 0 0 2.57 KB
Benchmarks.Trace.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net472 320ns 1.84ns 13.5ns 0.0519 0 0 329 B
master AllCycleSimpleBody netcoreapp3.1 386ns 1.43ns 5.16ns 0.00446 0 0 328 B
master AllCycleMoreComplexBody net472 298ns 1.37ns 5.31ns 0.0482 0 0 305 B
master AllCycleMoreComplexBody netcoreapp3.1 376ns 1.38ns 4.97ns 0.00416 0 0 304 B
master BodyExtractorSimpleBody net472 451ns 2.35ns 12ns 0.0568 0 0 361 B
master BodyExtractorSimpleBody netcoreapp3.1 443ns 2.07ns 8.03ns 0.00377 0 0 272 B
master BodyExtractorMoreComplexBody net472 27.3μs 137ns 598ns 1.18 0.0127 0 7.62 KB
master BodyExtractorMoreComplexBody netcoreapp3.1 21.7μs 96.1ns 372ns 0.0946 0 0 6.75 KB
#2405 AllCycleSimpleBody net472 307ns 1.33ns 5.17ns 0.0519 0 0 329 B
#2405 AllCycleSimpleBody netcoreapp3.1 381ns 1.3ns 4.86ns 0.00458 0 0 328 B
#2405 AllCycleMoreComplexBody net472 309ns 1.18ns 4.24ns 0.0481 0 0 305 B
#2405 AllCycleMoreComplexBody netcoreapp3.1 384ns 1.75ns 6.56ns 0.00429 0 0 304 B
#2405 BodyExtractorSimpleBody net472 450ns 1.07ns 4.14ns 0.0569 0 0 361 B
#2405 BodyExtractorSimpleBody netcoreapp3.1 447ns 2.11ns 8.68ns 0.0038 0 0 272 B
#2405 BodyExtractorMoreComplexBody net472 25.4μs 120ns 690ns 1.19 0.0128 0 7.62 KB
#2405 BodyExtractorMoreComplexBody netcoreapp3.1 22.6μs 130ns 1.04μs 0.0968 0 0 6.75 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 net472 0.0139ns 0.0062ns 0.0416ns 0 0 0 0 b
master SendRequest netcoreapp3.1 341μs 814ns 3.15μs 0.168 0 0 19.74 KB
#2405 SendRequest net472 0.000334ns 0.000334ns 0.00195ns 0 0 0 0 b
#2405 SendRequest netcoreapp3.1 338μs 1.04μs 4.01μs 0.167 0 0 19.74 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 net472 1.88μs 6.85ns 25.6ns 0.0941 0 0 594 B
master ExecuteNonQuery netcoreapp3.1 1.6μs 9.32ns 78ns 0.00845 0 0 632 B
#2405 ExecuteNonQuery net472 1.88μs 7.36ns 27.5ns 0.0939 0.000958 0 594 B
#2405 ExecuteNonQuery netcoreapp3.1 1.61μs 7.66ns 29.7ns 0.00882 0 0 632 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 net472 2.82μs 9.7ns 37.6ns 0.127 0 0 803 B
master CallElasticsearch netcoreapp3.1 1.81μs 5.12ns 19.8ns 0.0109 0 0 792 B
master CallElasticsearchAsync net472 3.1μs 15ns 73.3ns 0.148 0.00154 0 939 B
master CallElasticsearchAsync netcoreapp3.1 1.91μs 5.43ns 20.3ns 0.0123 0 0 912 B
#2405 CallElasticsearch net472 3.04μs 15.2ns 64.6ns 0.126 0 0 803 B
#2405 CallElasticsearch netcoreapp3.1 1.77μs 6.3ns 23.6ns 0.0109 0 0 792 B
#2405 CallElasticsearchAsync net472 3.04μs 16.5ns 98.8ns 0.147 0 0 939 B
#2405 CallElasticsearchAsync netcoreapp3.1 1.93μs 9.21ns 43.2ns 0.0126 0 0 912 B
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️

Faster 🎉 in #2405

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 1.183 2,468.75 2,087.09

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net472 3.29μs 11.9ns 44.5ns 0.168 0.00163 0 1.06 KB
master ExecuteAsync netcoreapp3.1 2.47μs 9.34ns 33.7ns 0.0135 0 0 1.03 KB
#2405 ExecuteAsync net472 3.16μs 14.3ns 62.2ns 0.168 0.00159 0 1.06 KB
#2405 ExecuteAsync netcoreapp3.1 2.1μs 11.9ns 84.2ns 0.0137 0 0 1.03 KB
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net472 7.47μs 42.7ns 331ns 0.354 0 0 2.28 KB
master SendAsync netcoreapp3.1 5.1μs 25.2ns 104ns 0.0303 0 0 2.21 KB
#2405 SendAsync net472 7.63μs 32.4ns 126ns 0.361 0 0 2.28 KB
#2405 SendAsync netcoreapp3.1 5.04μs 28.9ns 227ns 0.0296 0 0 2.21 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 net472 3.54μs 18.1ns 78.7ns 0.228 0 0 1.45 KB
master EnrichedLog netcoreapp3.1 3.41μs 18.6ns 102ns 0.0204 0 0 1.53 KB
#2405 EnrichedLog net472 3.56μs 18.3ns 83.9ns 0.227 0 0 1.45 KB
#2405 EnrichedLog netcoreapp3.1 3.16μs 12.7ns 47.4ns 0.0217 0 0 1.53 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 net472 303μs 640ns 2.39μs 0.456 0.152 0 4.33 KB
master EnrichedLog netcoreapp3.1 247μs 1.42μs 10.6μs 0 0 0 4.21 KB
#2405 EnrichedLog net472 305μs 917ns 3.43μs 0.309 0.155 0 4.33 KB
#2405 EnrichedLog netcoreapp3.1 252μs 1.42μs 9.74μs 0 0 0 4.21 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 net472 8.46μs 29.6ns 111ns 0.506 0 0 3.23 KB
master EnrichedLog netcoreapp3.1 6.6μs 32.1ns 128ns 0.0502 0 0 3.6 KB
#2405 EnrichedLog net472 8.56μs 44.1ns 229ns 0.505 0 0 3.23 KB
#2405 EnrichedLog netcoreapp3.1 6.72μs 26.1ns 97.7ns 0.0495 0 0 3.6 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 net472 2.52μs 12.6ns 58ns 0.161 0.00123 0 1.01 KB
master SendReceive netcoreapp3.1 2.11μs 8.37ns 32.4ns 0.0137 0 0 1.01 KB
#2405 SendReceive net472 2.61μs 13.3ns 62.6ns 0.16 0 0 1.01 KB
#2405 SendReceive netcoreapp3.1 2.23μs 12.8ns 104ns 0.014 0 0 1.01 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 net472 6.28μs 25.3ns 98.2ns 0.292 0 0 1.87 KB
master EnrichedLog netcoreapp3.1 5.39μs 17ns 85ns 0.0192 0 0 1.49 KB
#2405 EnrichedLog net472 6.44μs 37.3ns 360ns 0.29 0 0 1.87 KB
#2405 EnrichedLog netcoreapp3.1 5.39μs 21ns 75.7ns 0.019 0 0 1.49 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 net472 931ns 2.92ns 10.9ns 0.0718 0 0 457 B
master StartFinishSpan netcoreapp3.1 955ns 5.53ns 45.6ns 0.00626 0 0 456 B
master StartFinishScope net472 1.15μs 5.06ns 18.9ns 0.0843 0 0 538 B
master StartFinishScope netcoreapp3.1 1.11μs 5.94ns 43.2ns 0.00802 0 0 576 B
#2405 StartFinishSpan net472 963ns 3.89ns 15.1ns 0.0718 0 0 457 B
#2405 StartFinishSpan netcoreapp3.1 917ns 3.71ns 14.4ns 0.00628 0 0 456 B
#2405 StartFinishScope net472 1.24μs 6.82ns 45.3ns 0.0845 0 0 538 B
#2405 StartFinishScope netcoreapp3.1 1.12μs 4.41ns 17.1ns 0.00815 0 0 576 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 net472 1.34μs 6.1ns 23.6ns 0.084 0 0 538 B
master RunOnMethodBegin netcoreapp3.1 1.24μs 5.82ns 22.5ns 0.00747 0 0 576 B
#2405 RunOnMethodBegin net472 1.37μs 4.67ns 16.8ns 0.0838 0 0 538 B
#2405 RunOnMethodBegin netcoreapp3.1 1.27μs 6.72ns 34.9ns 0.00788 0 0 576 B

@andrewlock
andrewlock merged commit ba49b8a into master Apr 8, 2022
@andrewlock
andrewlock deleted the colin/add-net6-target branch April 8, 2022 16:12
@github-actions github-actions Bot added this to the vNext milestone Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:builds project files, build scripts, pipelines, versioning, releases, packages area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants