Skip to content

[ASP.NET] Handle PlatformNotSupportedException when injecting headers into the request#8829

Open
NachoEchevarria wants to merge 3 commits into
masterfrom
nacho/FixPlatformNotSupportedException
Open

[ASP.NET] Handle PlatformNotSupportedException when injecting headers into the request#8829
NachoEchevarria wants to merge 3 commits into
masterfrom
nacho/FixPlatformNotSupportedException

Conversation

@NachoEchevarria

@NachoEchevarria NachoEchevarria commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Guard the distributed-tracing header injection into the incoming request in TracingHttpModule.OnBeginRequest against PlatformNotSupportedException.

Error tracking.

Reason for change

On .NET Framework ASP.NET, the module writes tracing headers back into the request header collection (so downstream processors like IIS-hosted WCF can read the context). In some hosting configurations (e.g. Sitefinity), HttpHeaderCollection.Set throws PlatformNotSupportedException ("This operation requires IIS integrated pipeline mode") even though HttpRuntime.UsingIntegratedPipeline reports true.

Because the injection ran before shouldDisposeScope = false, the exception bubbled to the outer catch, the scope was disposed, and the entire aspnet.request span was lost — and an error was logged/telemetered on every request.

Implementation details

Wrap the injection in a targeted try/catch and add a static _canInjectContextIntoRequestHeaders flag, mirroring the existing _canReadHttpResponseHeaders pattern. On PlatformNotSupportedException, log once, disable injection for the rest of the application lifetime, and continue the request instrumentation so the span is still created. Other exceptions still propagate as before.

Test coverage

Other details

@NachoEchevarria NachoEchevarria changed the title Fix [ASP.NET] Handle PlatformNotSupportedException when injecting headers into the request Jun 25, 2026
@github-actions github-actions Bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Jun 25, 2026
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8829) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration69.63 ± (69.73 - 69.99) ms72.55 ± (72.37 - 72.93) ms+4.2%✅⬆️
.NET Framework 4.8 - Bailout
duration74.02 ± (73.91 - 74.25) ms76.48 ± (76.39 - 76.89) ms+3.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1086.75 ± (1083.62 - 1089.70) ms1079.30 ± (1078.13 - 1084.53) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.01 ± (21.98 - 22.04) ms22.31 ± (22.26 - 22.36) ms+1.4%✅⬆️
process.time_to_main_ms80.51 ± (80.31 - 80.70) ms83.07 ± (82.80 - 83.33) ms+3.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.92 - 10.93) MB10.93 ± (10.92 - 10.93) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.88 ± (21.85 - 21.91) ms22.10 ± (22.07 - 22.13) ms+1.0%✅⬆️
process.time_to_main_ms81.53 ± (81.38 - 81.68) ms82.32 ± (82.14 - 82.50) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.96 ± (10.96 - 10.96) MB-0.0%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms211.68 ± (210.92 - 212.44) ms210.10 ± (209.26 - 210.94) ms-0.7%
process.time_to_main_ms533.28 ± (532.22 - 534.33) ms530.89 ± (529.47 - 532.31) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.21 ± (49.18 - 49.24) MB49.08 ± (49.04 - 49.12) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.2%
.NET 6 - Baseline
process.internal_duration_ms21.35 ± (21.30 - 21.40) ms20.96 ± (20.94 - 20.99) ms-1.8%
process.time_to_main_ms72.66 ± (72.39 - 72.93) ms69.79 ± (69.65 - 69.92) ms-4.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.63 - 10.64) MB10.63 ± (10.63 - 10.64) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.99 ± (20.95 - 21.02) ms20.77 ± (20.74 - 20.80) ms-1.0%
process.time_to_main_ms71.41 ± (71.23 - 71.60) ms70.75 ± (70.63 - 70.88) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.74 ± (10.74 - 10.74) MB10.74 ± (10.74 - 10.74) MB-0.0%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.85 ± (367.14 - 372.56) ms370.30 ± (368.20 - 372.40) ms+0.1%✅⬆️
process.time_to_main_ms533.57 ± (532.39 - 534.74) ms537.55 ± (536.34 - 538.76) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.08 ± (50.05 - 50.10) MB50.09 ± (50.06 - 50.11) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.06 ± (19.02 - 19.10) ms19.39 ± (19.35 - 19.43) ms+1.7%✅⬆️
process.time_to_main_ms68.39 ± (68.28 - 68.51) ms71.75 ± (71.53 - 71.97) ms+4.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.67 ± (7.66 - 7.67) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.33 ± (19.28 - 19.37) ms19.11 ± (19.08 - 19.13) ms-1.1%
process.time_to_main_ms71.76 ± (71.51 - 72.02) ms70.51 ± (70.36 - 70.67) ms-1.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.72 ± (7.71 - 7.72) MB7.71 ± (7.70 - 7.71) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms300.37 ± (298.16 - 302.58) ms299.80 ± (297.49 - 302.11) ms-0.2%
process.time_to_main_ms484.19 ± (483.15 - 485.23) ms485.02 ± (483.97 - 486.06) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.48 ± (37.46 - 37.51) MB37.50 ± (37.48 - 37.53) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.1%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration204.13 ± (203.69 - 204.42) ms200.90 ± (200.74 - 201.82) ms-1.6%
.NET Framework 4.8 - Bailout
duration208.59 ± (208.33 - 209.16) ms205.64 ± (205.14 - 206.15) ms-1.4%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1222.09 ± (1220.38 - 1226.77) ms1212.96 ± (1213.05 - 1220.52) ms-0.7%
.NET Core 3.1 - Baseline
process.internal_duration_ms198.30 ± (197.84 - 198.77) ms194.55 ± (194.09 - 195.01) ms-1.9%
process.time_to_main_ms86.64 ± (86.33 - 86.95) ms84.62 ± (84.32 - 84.91) ms-2.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.01 ± (15.98 - 16.03) MB16.04 ± (16.01 - 16.07) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms197.80 ± (197.38 - 198.22) ms194.42 ± (194.00 - 194.84) ms-1.7%
process.time_to_main_ms87.56 ± (87.35 - 87.78) ms86.17 ± (85.91 - 86.44) ms-1.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.05 ± (16.03 - 16.07) MB16.07 ± (16.05 - 16.10) MB+0.1%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms391.00 ± (389.63 - 392.37) ms387.13 ± (385.85 - 388.40) ms-1.0%
process.time_to_main_ms549.96 ± (548.83 - 551.10) ms543.75 ± (542.54 - 544.97) ms-1.1%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.87 ± (58.66 - 59.08) MB58.06 ± (57.84 - 58.28) MB-1.4%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.8%
.NET 6 - Baseline
process.internal_duration_ms202.80 ± (202.33 - 203.27) ms200.76 ± (200.34 - 201.18) ms-1.0%
process.time_to_main_ms74.90 ± (74.62 - 75.18) ms74.38 ± (74.12 - 74.65) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.35 ± (16.33 - 16.37) MB16.35 ± (16.32 - 16.38) MB-0.0%
runtime.dotnet.threads.count19 ± (19 - 20)19 ± (19 - 19)-0.3%
.NET 6 - Bailout
process.internal_duration_ms201.17 ± (200.79 - 201.56) ms199.76 ± (199.38 - 200.15) ms-0.7%
process.time_to_main_ms75.65 ± (75.45 - 75.85) ms75.68 ± (75.39 - 75.97) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.37 ± (16.34 - 16.39) MB16.44 ± (16.41 - 16.46) MB+0.4%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.8%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms584.93 ± (582.50 - 587.36) ms582.07 ± (579.58 - 584.56) ms-0.5%
process.time_to_main_ms560.31 ± (558.92 - 561.70) ms554.61 ± (553.43 - 555.80) ms-1.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.28 ± (61.19 - 61.36) MB61.19 ± (61.11 - 61.27) MB-0.1%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.3%
.NET 8 - Baseline
process.internal_duration_ms199.23 ± (198.72 - 199.74) ms197.36 ± (196.93 - 197.79) ms-0.9%
process.time_to_main_ms73.68 ± (73.42 - 73.93) ms73.16 ± (72.94 - 73.38) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.72 ± (11.71 - 11.74) MB11.77 ± (11.75 - 11.79) MB+0.4%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.6%
.NET 8 - Bailout
process.internal_duration_ms197.84 ± (197.42 - 198.26) ms196.13 ± (195.76 - 196.51) ms-0.9%
process.time_to_main_ms74.63 ± (74.42 - 74.84) ms73.95 ± (73.73 - 74.17) ms-0.9%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.75 - 11.79) MB11.82 ± (11.80 - 11.84) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.2%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms514.71 ± (512.06 - 517.37) ms512.19 ± (509.52 - 514.86) ms-0.5%
process.time_to_main_ms502.43 ± (501.61 - 503.25) ms502.82 ± (502.00 - 503.63) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.07 ± (51.04 - 51.11) MB51.03 ± (50.99 - 51.08) MB-0.1%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.5%✅⬆️
Comparison explanation

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 highlighted 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).

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8829) - mean (73ms)  : 68, 77
    master - mean (70ms)  : 68, 72

    section Bailout
    This PR (8829) - mean (77ms)  : 73, 81
    master - mean (74ms)  : 72, 76

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (1,081ms)  : 1034, 1129
    master - mean (1,087ms)  : 1042, 1132

Loading
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 (8829) - mean (113ms)  : 108, 118
    master - mean (109ms)  : 106, 111

    section Bailout
    This PR (8829) - mean (111ms)  : 107, 115
    master - mean (110ms)  : 107, 112

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (778ms)  : 750, 805
    master - mean (782ms)  : 756, 808

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8829) - mean (96ms)  : 94, 99
    master - mean (101ms)  : 96, 106

    section Bailout
    This PR (8829) - mean (98ms)  : 96, 100
    master - mean (99ms)  : 94, 103

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (937ms)  : 894, 980
    master - mean (938ms)  : 896, 980

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8829) - mean (100ms)  : 95, 104
    master - mean (95ms)  : 92, 97

    section Bailout
    This PR (8829) - mean (97ms)  : 94, 100
    master - mean (99ms)  : 93, 104

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (815ms)  : 775, 855
    master - mean (815ms)  : 776, 854

Loading
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 (8829) - mean (201ms)  : 193, 209
    master - mean (204ms)  : 200, 208

    section Bailout
    This PR (8829) - mean (206ms)  : 199, 212
    master - mean (209ms)  : 205, 213

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (1,217ms)  : 1162, 1272
    master - mean (1,224ms)  : 1178, 1270

Loading
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 (8829) - mean (289ms)  : 283, 295
    master - mean (295ms)  : 289, 302

    section Bailout
    This PR (8829) - mean (290ms)  : 285, 296
    master - mean (295ms)  : 291, 300

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (973ms)  : 953, 993
    master - mean (984ms)  : 954, 1014

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8829) - mean (285ms)  : 278, 292
    master - mean (286ms)  : 280, 293

    section Bailout
    This PR (8829) - mean (285ms)  : 279, 291
    master - mean (286ms)  : 281, 290

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (1,167ms)  : 1125, 1209
    master - mean (1,175ms)  : 1143, 1208

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8829) - mean (281ms)  : 274, 288
    master - mean (283ms)  : 276, 291

    section Bailout
    This PR (8829) - mean (280ms)  : 274, 285
    master - mean (283ms)  : 277, 288

    section CallTarget+Inlining+NGEN
    This PR (8829) - mean (1,046ms)  : 999, 1092
    master - mean (1,049ms)  : 1008, 1089

Loading

@pr-commenter

pr-commenter Bot commented Jun 25, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-02 12:35:28

Comparing candidate commit fca8192 in PR branch nacho/FixPlatformNotSupportedException with baseline commit dcedc21 in branch master.

📊 Benchmarking dashboard

Found 2 performance improvements and 0 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 65 known flaky benchmarks, 61 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net472

  • 🟩 throughput [+11861.882op/s; +15288.261op/s] or [+6.469%; +8.337%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartRootSpan net472

  • 🟩 throughput [+12064.157op/s; +13683.324op/s] or [+6.851%; +7.770%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472

  • 🟩 throughput [+12984.654op/s; +14215.699op/s] or [+7.156%; +7.835%]

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472

  • 🟥 throughput [-9232.293op/s; -7898.578op/s] or [-6.072%; -5.195%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-6644.698op/s; -6214.095op/s] or [-7.879%; -7.368%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟥 throughput [-7383.799op/s; -5926.574op/s] or [-7.508%; -6.026%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+307.952ms; +315.998ms] or [+152.817%; +156.809%]
  • 🟥 throughput [-46.863op/s; -42.759op/s] or [-8.432%; -7.693%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 execution_time [+380.419ms; +382.740ms] or [+300.554%; +302.388%]
  • 🟩 throughput [+89.777op/s; +93.697op/s] or [+11.837%; +12.354%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+396.254ms; +400.143ms] or [+350.670%; +354.111%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.528%; +27.540%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.976%; +9.987%]
  • 🟩 execution_time [-15.341ms; -11.166ms] or [-7.165%; -5.215%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.500%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-272015.851op/s; -267611.492op/s] or [-27.774%; -27.324%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.127ms; -21.267ms] or [-11.652%; -9.484%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-156089.084op/s; -139408.731op/s] or [-22.427%; -20.030%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟩 throughput [+8078.395op/s; +11030.722op/s] or [+5.140%; +7.019%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 throughput [+7261.129op/s; +10030.452op/s] or [+5.784%; +7.991%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+437390.013op/s; +460363.354op/s] or [+14.584%; +15.350%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-19.577ms; -15.001ms] or [-9.024%; -6.915%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+301.159ms; +304.120ms] or [+150.479%; +151.958%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+300.756ms; +304.090ms] or [+151.672%; +153.353%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟥 execution_time [+299.403ms; +303.126ms] or [+150.816%; +152.691%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+297.210ms; +298.497ms] or [+145.978%; +146.610%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+292.211ms; +295.106ms] or [+142.851%; +144.266%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+298.940ms; +302.482ms] or [+149.410%; +151.180%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0

  • 🟥 execution_time [+33.524µs; +60.437µs] or [+7.689%; +13.861%]
  • 🟥 throughput [-289.573op/s; -168.705op/s] or [-12.589%; -7.335%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+37.093µs; +61.109µs] or [+11.842%; +19.509%]
  • 🟥 throughput [-547.145op/s; -345.711op/s] or [-17.056%; -10.777%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.742ms; +300.473ms] or [+149.602%; +149.967%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • unstable execution_time [+312.096ms; +381.286ms] or [+339.105%; +414.283%]
  • 🟩 throughput [+666.393op/s; +950.412op/s] or [+5.476%; +7.810%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+292.979ms; +347.358ms] or [+222.456%; +263.746%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+309.198ms; +376.862ms] or [+142.166%; +173.277%]
  • 🟥 throughput [-554.653op/s; -496.513op/s] or [-50.257%; -44.989%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+205.168ms; +338.448ms] or [+87.434%; +144.232%]
  • 🟥 throughput [-669.037op/s; -585.571op/s] or [-44.625%; -39.058%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+341.741ms; +352.146ms] or [+204.400%; +210.624%]
  • 🟥 throughput [-433.590op/s; -396.088op/s] or [-30.190%; -27.579%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1

  • unstable throughput [+16.579op/s; +59.332op/s] or [+4.766%; +17.055%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-176.243µs; -145.046µs] or [-8.928%; -7.348%]
  • 🟩 throughput [+40.723op/s; +50.040op/s] or [+8.039%; +9.878%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+305.046ms; +307.375ms] or [+153.615%; +154.788%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+301.943ms; +304.228ms] or [+151.304%; +152.449%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+301.552ms; +305.187ms] or [+151.487%; +153.313%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+300.456ms; +302.410ms] or [+150.879%; +151.860%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+297.214ms; +312.052ms] or [+146.959%; +154.296%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+301.902ms; +305.798ms] or [+153.017%; +154.992%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.693ms; +305.400ms] or [+151.925%; +153.283%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+297.926ms; +315.348ms] or [+148.489%; +157.172%]
  • 🟩 throughput [+26681.554op/s; +44059.468op/s] or [+5.298%; +8.749%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+301.159ms; +304.609ms] or [+149.824%; +151.540%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-15.944ms; -12.292ms] or [-7.414%; -5.716%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+8.066µs; +52.996µs] or [+1.992%; +13.090%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-26.999KB; -26.977KB] or [-9.849%; -9.841%]
  • unstable execution_time [-53.602µs; +2.749µs] or [-10.594%; +0.543%]
  • unstable throughput [+0.384op/s; +202.554op/s] or [+0.019%; +10.108%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟩 allocated_mem [-28.239KB; -28.222KB] or [-10.295%; -10.288%]
  • unstable execution_time [+41.747µs; +235.920µs] or [+7.234%; +40.883%]
  • unstable throughput [-285.980op/s; +13.846op/s] or [-16.338%; +0.791%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472

  • 🟥 allocated_mem [+4.589KB; +4.595KB] or [+9.336%; +9.348%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • unstable execution_time [+7.411µs; +12.812µs] or [+17.516%; +30.284%]
  • 🟥 throughput [-5385.525op/s; -3361.978op/s] or [-22.671%; -14.153%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-14.250µs; -6.760µs] or [-22.108%; -10.489%]
  • 🟩 throughput [+1652.062op/s; +3252.330op/s] or [+10.136%; +19.954%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.299ms; +304.769ms] or [+153.304%; +154.047%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+300.271ms; +303.277ms] or [+152.837%; +154.367%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+301.955ms; +304.504ms] or [+151.166%; +152.442%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+31899.426op/s; +36365.056op/s] or [+6.038%; +6.883%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+299.521ms; +301.471ms] or [+149.284%; +150.256%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.630ms; +302.752ms] or [+151.464%; +152.028%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+304.154ms; +306.324ms] or [+154.248%; +155.348%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.445ms; +301.426ms] or [+149.863%; +150.353%]
  • 🟩 throughput [+61185158.420op/s; +61498850.855op/s] or [+44.559%; +44.787%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • unstable execution_time [+339.809ms; +395.921ms] or [+422.613%; +492.398%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.353ms; +300.460ms] or [+149.311%; +149.862%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+81393.022op/s; +89672.140op/s] or [+7.599%; +8.372%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1

  • 🟩 throughput [+62288.033op/s; +81177.149op/s] or [+7.210%; +9.396%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+83592.829op/s; +91790.796op/s] or [+8.302%; +9.116%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+40701.004op/s; +46359.675op/s] or [+7.391%; +8.418%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1

  • 🟩 throughput [+27504.705op/s; +37254.672op/s] or [+6.156%; +8.339%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+79979.658op/s; +98823.766op/s] or [+8.936%; +11.041%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@NachoEchevarria NachoEchevarria marked this pull request as ready for review June 25, 2026 15:05
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner June 25, 2026 15:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d14fb35380

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// Despite the HttpRuntime.UsingIntegratedPipeline check, writing to the request headers
// can still fail in some hosting configurations (e.g. Sitefinity): "This operation requires IIS integrated pipeline mode".
// This must not abort the rest of the request instrumentation, so swallow it and disable for the rest of the application lifetime.
Log.Error(ex, "Unable to inject distributed tracing headers into the request. Disabling for the rest of the application lifetime.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use skip-telemetry logging for host limitations

In the Sitefinity/non-integrated-hosting scenario this catch is explicitly handling, the failure is an expected environmental limitation and the code disables only a best-effort header injection path. AGENTS.md:198-202 says expected environmental errors should use Log.ErrorSkipTelemetry; using Log.Error here still emits tracer telemetry once per process for affected apps, so this change doesn't fully avoid telemetry noise from the known host limitation.

Useful? React with 👍 / 👎.

// in case the next processor cannot access the stored Scope
// (e.g. WCF being hosted in IIS)
if (HttpRuntime.UsingIntegratedPipeline)
if (HttpRuntime.UsingIntegratedPipeline && _canInjectContextIntoRequestHeaders)

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.

If I understand correctly, the _canInjectContextIntoRequestHeaders and _canReadHttpResponseHeaders variables are actually just two halves of the same thing... If one doesn't work, the other won't, because fundamentally the problem is that even when we have an integrated pipeline, what matters is whether the current request is backed by a real IIS7 worker request, IIS7WorkerRequest. That's not the case in Sitefinity’s Project Manager mode. So if one fails, the other will too.

tl;dr; I think you can/should rename _canReadHttpResponseHeaders to _canAccessHttpResponseHeaders, and use that in both places instead of storing the extra _canInjectContextIntoRequestHeaders 🙂

That said, it's a very minor difference, so approving anyway 😃

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You are right, thanks! Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:telemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants