[EXPERIMENTAL] Trace ASP.NET Core requests on .NET Framework - #8903
[EXPERIMENTAL] Trace ASP.NET Core requests on .NET Framework#8903bouwkast wants to merge 53 commits into
Conversation
|
@codex review |
00d2d19 to
4dd754b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00d2d19bf6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8903) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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 highlighted 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). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (75ms) : 71, 79
master - mean (74ms) : 69, 79
section Bailout
This PR (8903) - mean (78ms) : 73, 82
master - mean (76ms) : 72, 80
section CallTarget+Inlining+NGEN
This PR (8903) - mean (1,103ms) : 1037, 1170
master - mean (1,090ms) : 1036, 1143
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (115ms) : 107, 124
master - mean (112ms) : 105, 119
section Bailout
This PR (8903) - mean (112ms) : 109, 114
master - mean (111ms) : 109, 113
section CallTarget+Inlining+NGEN
This PR (8903) - mean (791ms) : 767, 815
master - mean (786ms) : 759, 813
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (98ms) : 95, 101
master - mean (98ms) : 95, 100
section Bailout
This PR (8903) - mean (102ms) : 96, 108
master - mean (101ms) : 95, 108
section CallTarget+Inlining+NGEN
This PR (8903) - mean (945ms) : 903, 987
master - mean (947ms) : 909, 986
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (98ms) : 93, 103
master - mean (97ms) : 92, 103
section Bailout
This PR (8903) - mean (97ms) : 94, 99
master - mean (97ms) : 95, 99
section CallTarget+Inlining+NGEN
This PR (8903) - mean (826ms) : 780, 872
master - mean (821ms) : 784, 857
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (213ms) : 207, 218
master - mean (217ms) : 212, 221
section Bailout
This PR (8903) - mean (219ms) : 215, 224
master - mean (220ms) : 215, 224
section CallTarget+Inlining+NGEN
This PR (8903) - mean (1,286ms) : 1221, 1351
master - mean (1,294ms) : 1232, 1356
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (307ms) : 301, 312
master - mean (309ms) : 302, 315
section Bailout
This PR (8903) - mean (306ms) : 300, 313
master - mean (310ms) : 302, 317
section CallTarget+Inlining+NGEN
This PR (8903) - mean (1,014ms) : 984, 1043
master - mean (1,027ms) : 996, 1058
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (298ms) : 292, 305
master - mean (303ms) : 296, 310
section Bailout
This PR (8903) - mean (301ms) : 294, 308
master - mean (305ms) : 299, 311
section CallTarget+Inlining+NGEN
This PR (8903) - mean (1,214ms) : 1180, 1247
master - mean (1,210ms) : 1179, 1241
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8903) - mean (301ms) : 292, 310
master - mean (301ms) : 293, 308
section Bailout
This PR (8903) - mean (303ms) : 297, 309
master - mean (303ms) : 298, 309
section CallTarget+Inlining+NGEN
This PR (8903) - mean (1,110ms) : 1007, 1213
master - mean (1,126ms) : 1013, 1240
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-07-29 11:19:09 Comparing candidate commit be91413 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 59 known flaky benchmarks, 67 flaky benchmarks without significant changes.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54f804a434
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
54bbfd2 to
35053af
Compare
c847486 to
5c6a224
Compare
19a2522 to
990cdf4
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5616690c75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This reverts commit 89f53ff.
…onally add the observer
Essentially, the Baggage async local can "leak" between requests, so baggage leaks between requests dotnet/aspnetcore#13991
5616690 to
be91413
Compare
| .WithKeys(ConfigurationKeys.FeatureFlags.SingleSpanAspNetCoreEnabled) | ||
| .AsBool(defaultValue: false); | ||
| #if NETFRAMEWORK | ||
| if (ExperimentalFeaturesEnabled.Contains(ConfigurationKeys.FeatureFlags.AspNetCoreNetFrameworkEnabled)) |
There was a problem hiding this comment.
Should we somehow support "all" "all" => DefaultExperimentalFeatures,
If someone has both "all" and this flag set should this work?
Summary of changes
EXPERIMENTAL / WIP
Adds a new, .NET Framework-compatible
DiagnosticObserverfor ASP.NET Core applications running on .NET Framework.The integration creates
aspnet_core.requestspans in the application process and parents downstream spans beneath the request span - similar to how our currentDiagnosticObserverfunctions for .NET / .NET Core ASP.NET Core applications.Reason for change
ASP.NET Core 2.x applications can run on .NET Framework and without this they get disconnected traces for other instrumentations that would be parented underneath those ASP.NET Core requests.
Previously this was a significant amount of work / effort to attempt to support due to how we rely upon modern assemblies for ASP.NET Core for non-.NET Framework builds (dangerous to use them in .NET Framework due to assembling binding issues). Overtime though we have added infrastructure that has made this reasonably feasible.
However, given ASP.NET Core on .NET Fraemework is already unsupported unless you use version 2.3.0 of the packages, and Microsoft are ending all support for even 2.3.0 in April 2027, any implementation here would be considered experimental and temporary, to provide a stop-gap for customers that have not yet migrated. We would fully intend to remove this integration in 2027, once Microsoft no longer supports the scenario themselves.
Implementation details
DiagnosticListenerobserver.DD_EXPERIMENTAL_ASPNETCORE_NETFRAMEWORK_ENABLED=trueThe feature is disabled by default, and requires specific opt-in via the DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED flag
Note that this implementation does not include feature parity with the .NET Core ASP.NET Core implementation, as discussed below.
Test coverage
Various new tests to attempt to provide accurate coverage to this:
Adds unit and end-to-end coverage for ASP.NET Core 2.1 and 2.2 applications targeting .NET Framework 4.8, including:
Other details
Scope and risk controls
This implementation intentionally uses a separate .NET Framework observer instead of modifying the existing ASP.NET Core observer. This reduces the risk of regressions and avoids loading incompatible modern ASP.NET Core dependencies into .NET Framework applications.
The initial implementation focuses on request tracing and context propagation. It does not provide complete feature parity with the modern ASP.NET Core observer. In particular, integrations with AAP/AppSec, IAST, Dynamic Instrumentation, and other functionality coupled to the existing observer are not included.
The IIS worker process is expected to act only as the out-of-process proxy. The
aspnet_core.requestspan is created in the managed application process.Performance
Preliminary synthetic throughput testing covers baseline, feature-disabled, and feature-enabled configurations. Enabling the feature introduces the expected overhead from request span creation and enrichment.
Detailed results and methodology will be added.