Add smoke test for config builder instrumentation issue#6224
Conversation
| <add key="webpages:Enabled" value="false" /> | ||
| </appSettings> | ||
| <system.web> | ||
| <customErrors mode="Off" /> |
Check failure
Code scanning / CodeQL
Missing global error handler
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we need to change the customErrors mode in the Web.config file to either On or RemoteOnly. This will prevent the default error page from being displayed to users, thereby protecting sensitive information. The On mode will always show a custom error page, while the RemoteOnly mode will show the custom error page only to remote users, allowing local users to see detailed error information for debugging purposes.
The best way to fix the problem without changing existing functionality is to set the customErrors mode to RemoteOnly. This provides a balance between security and usability by allowing developers to see detailed error information when accessing the application locally, while protecting remote users from seeing sensitive information.
| @@ -21,3 +21,3 @@ | ||
| <system.web> | ||
| <customErrors mode="Off" /> | ||
| <customErrors mode="RemoteOnly" /> | ||
| <compilation debug="true" targetFramework="4.7.2" /> |
Datadog ReportBranch report: ✅ 0 Failed, 369352 Passed, 2100 Skipped, 14h 53m 45.83s Total Time |
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 (6224) - mean (70ms) : 68, 73
. : milestone, 70,
master - mean (70ms) : 68, 72
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6224) - mean (1,118ms) : 1095, 1141
. : milestone, 1118,
master - mean (1,119ms) : 1098, 1141
. : milestone, 1119,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6224) - mean (110ms) : 106, 114
. : milestone, 110,
master - mean (110ms) : 107, 114
. : milestone, 110,
section CallTarget+Inlining+NGEN
This PR (6224) - mean (780ms) : 764, 795
. : milestone, 780,
master - mean (782ms) : 763, 801
. : milestone, 782,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6224) - mean (93ms) : 90, 96
. : milestone, 93,
master - mean (93ms) : 90, 96
. : milestone, 93,
section CallTarget+Inlining+NGEN
This PR (6224) - mean (733ms) : 714, 752
. : milestone, 733,
master - mean (738ms) : 722, 753
. : milestone, 738,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6224) - mean (196ms) : 193, 199
. : milestone, 196,
master - mean (190ms) : 188, 193
. : milestone, 190,
section CallTarget+Inlining+NGEN
This PR (6224) - mean (1,260ms) : 1235, 1286
. : milestone, 1260,
master - mean (1,225ms) : 1202, 1248
. : milestone, 1225,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6224) - mean (285ms) : 280, 290
. : milestone, 285,
master - mean (287ms) : 257, 317
. : milestone, 287,
section CallTarget+Inlining+NGEN
This PR (6224) - mean (983ms) : 967, 1000
. : milestone, 983,
master - mean (952ms) : 931, 973
. : milestone, 952,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6224) - mean (272ms) : 267, 277
. : milestone, 272,
master - mean (265ms) : 261, 269
. : milestone, 265,
section CallTarget+Inlining+NGEN
This PR (6224) - mean (965ms) : 945, 984
. : milestone, 965,
master - mean (953ms) : 917, 990
. : milestone, 953,
|
Benchmarks Report for tracer 🐌Benchmarks for #6224 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 - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️Raw results
|
kevingosse
left a comment
There was a problem hiding this comment.
You could have simplified the config builder, but whatever
| #pragma warning disable CS1591 // No xml comments for tag literals. | ||
| #pragma warning restore CS1591 // No xml comments for tag literals. |
There was a problem hiding this comment.
I wanted a "faithful reproduction" of the issue. This seemed critical 😉
| // Also, this is a synchronous method. And in single-threaded contexts like ASP.Net | ||
| // it can be bad/dangerous to block on async calls. So lets work some TPL voodoo | ||
| // to avoid potential deadlocks. | ||
| return Task.Run(async () => { return await GetValueAsync(key, string.Empty); }).Result?.Value; |
There was a problem hiding this comment.
Wow you decided to keep this
There was a problem hiding this comment.
I won't hide their shame
Co-authored-by: Kevin Gosse <[email protected]>
Summary of changes
Adds a smoke test for the issue fixed in #6147
Reason for change
The issue in #6147 is complex and subtle, with a high risk of regression, so we want to have smoke tests to catch it`
Implementation details
Add a sample app very similar to the one tested with in #6147. Without the fix, the test fails with
After the fix (now merged) the tests pass
Test coverage
This is primarily a smoke test, so we confirm
Other details
For some reason, I had massive issues getting the app to "recognize" the
DD_TRACE_AGENT_URL=http://test-agent.windows:8126env var setting that's required to talk to the test agent. I have no idea why, and the only resolution I could find was to use powershell to set the variables inside the docker image