Skip to content

Add handling of timeouts to ApiWebRequest - #9144

Open
andrewlock wants to merge 5 commits into
andrew/refactor-web-requestfrom
andrew/web-request-timeout
Open

Add handling of timeouts to ApiWebRequest#9144
andrewlock wants to merge 5 commits into
andrew/refactor-web-requestfrom
andrew/web-request-timeout

Conversation

@andrewlock

@andrewlock andrewlock commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary of changes

Fixes timeout handling for ApiWebRequest

Reason for change

Basically, timeouts never worked in our ApiWebRequest, because the APIs we call (GetRequestStreamAsync/GetResponseAsync) simply don't pay attention to it. That means we effectively had no timeout on any http calls for .NET Framework.

Implementation details

Actually handle a timeout in ApiWebRequest. Technically this still isn't quite the same as our HttpClient implementations, because for HttpClient we're using a mode that buffers everything in memory immediately, and applies the timeout including that. That's more effort to do with ApiWebRequest, as you need to explicitly pass the cancellation token through to the response etc, which all becomes kinda different to HttpClient. Ultimately, what this adds is better than what we have today

Note: My assumption is that we will not want to buffer everything in memory soon, seeing as we're always explicitly copying the body or stream decoding it. Today, we are doing more copying than we should. I expect we'll look at using HttpCompletionOption.ResponseHeadersRead instead soon, in which case, we will need to unify our handling of timeouts in any case. A follow up process.

Test coverage

Added unit tests for the timeouts (which hopefully are not flaky), given I'm cheating by passing in a deterministic cancellation token instead of trying to "wait for it to fail". There's a bunch of edge cases around exactly when the timeout is cancelled which we handle. There's the occasional additional edge case that we can't test without a lot more work, so left that to manual testing instead

Other details

Stacked on:

Discovered as part of:

@andrewlock
andrewlock force-pushed the andrew/web-request-timeout branch from ca71479 to 89b5894 Compare August 27, 2026 15:43
@andrewlock
andrewlock changed the base branch from master to andrew/refactor-web-request August 27, 2026 15:44
@andrewlock andrewlock changed the title Refactor ApiWebRequest Add handling of timeouts to ApiWebRequest Aug 27, 2026
@andrewlock andrewlock added type:bug area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) labels Aug 27, 2026
@andrewlock

Copy link
Copy Markdown
Member Author

@codex review

@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: 89b58945db

ℹ️ 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".

Comment thread tracer/src/Datadog.Trace/Agent/Transports/ApiWebRequest.cs Outdated
Comment thread tracer/src/Datadog.Trace/Agent/Transports/ApiWebRequest.cs Outdated
@pr-commenter

pr-commenter Bot commented Aug 27, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-28 16:21:03

Comparing candidate commit 01a2e42 in PR branch andrew/web-request-timeout with baseline commit 4a2cf7e in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 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 ----------------------------------'

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.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-8459.972op/s; -7607.790op/s] or [-10.031%; -9.021%]

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

  • 🟥 throughput [-9041.607op/s; -6957.712op/s] or [-9.193%; -7.074%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+1.541KB; +1.541KB] or [+46.817%; +46.831%]
  • 🟥 execution_time [+314.410ms; +317.712ms] or [+156.021%; +157.660%]
  • 🟥 throughput [-63.414op/s; -58.861op/s] or [-11.409%; -10.590%]

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

  • 🟥 allocated_mem [+993 bytes; +993 bytes] or [+36.856%; +36.868%]
  • 🟥 execution_time [+372.244ms; +374.374ms] or [+294.096%; +295.779%]
  • 🟩 throughput [+71.991op/s; +75.582op/s] or [+9.492%; +9.965%]

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

  • 🟥 allocated_mem [+1.072KB; +1.072KB] or [+39.745%; +39.756%]
  • 🟥 execution_time [+398.308ms; +400.579ms] or [+352.487%; +354.498%]

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

  • 🟥 allocated_mem [+4.725KB; +4.726KB] or [+99.482%; +99.497%]
  • 🟥 throughput [-60487.251op/s; -60088.781op/s] or [-47.062%; -46.752%]

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

  • 🟥 allocated_mem [+3.848KB; +3.848KB] or [+81.379%; +81.391%]
  • 🟩 execution_time [-15.907ms; -11.740ms] or [-7.429%; -5.483%]
  • 🟥 throughput [-60391.048op/s; -57631.164op/s] or [-44.082%; -42.067%]

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

  • 🟥 allocated_mem [+4.576KB; +4.576KB] or [+98.954%; +98.966%]
  • 🟥 throughput [-49053.964op/s; -46805.863op/s] or [-44.350%; -42.318%]

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

  • 🟥 allocated_mem [+1.348KB; +1.348KB] or [+109.063%; +109.078%]
  • 🟥 throughput [-294591.444op/s; -290920.863op/s] or [-30.079%; -29.704%]

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

  • 🟥 allocated_mem [+511 bytes; +512 bytes] or [+41.822%; +41.834%]
  • 🟩 execution_time [-25.873ms; -20.757ms] or [-11.538%; -9.257%]
  • 🟥 throughput [-124316.460op/s; -100783.235op/s] or [-13.281%; -10.767%]

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

  • 🟥 allocated_mem [+1.312KB; +1.312KB] or [+108.600%; +108.616%]
  • 🟥 throughput [-167364.482op/s; -151525.068op/s] or [-24.047%; -21.771%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-73238.529op/s; -72212.814op/s] or [-49.289%; -48.598%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-72834.032op/s; -69955.221op/s] or [-46.343%; -44.511%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-55761.558op/s; -53138.527op/s] or [-44.421%; -42.332%]

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

  • 🟩 throughput [+331209.098op/s; +347869.451op/s] or [+11.044%; +11.599%]

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

  • 🟩 execution_time [-18.967ms; -14.637ms] or [-8.743%; -6.747%]

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

  • 🟩 allocated_mem [-13.759KB; -13.757KB] or [-42.326%; -42.318%]
  • 🟥 execution_time [+299.955ms; +300.560ms] or [+149.878%; +150.180%]
  • 🟩 throughput [+965.074op/s; +994.586op/s] or [+10.659%; +10.985%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+299.982ms; +303.081ms] or [+151.282%; +152.845%]
  • 🟩 throughput [+2280.046op/s; +2506.605op/s] or [+17.439%; +19.172%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+301.016ms; +303.476ms] or [+151.628%; +152.868%]
  • 🟩 throughput [+1796.362op/s; +1924.120op/s] or [+17.343%; +18.576%]

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

  • 🟥 execution_time [+296.070ms; +296.817ms] or [+145.418%; +145.785%]
  • 🟩 throughput [+583.157op/s; +588.683op/s] or [+15.460%; +15.606%]

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

  • 🟥 execution_time [+295.200ms; +297.217ms] or [+144.312%; +145.298%]
  • 🟩 throughput [+2663.189op/s; +2714.420op/s] or [+38.691%; +39.435%]

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

  • 🟥 execution_time [+299.738ms; +300.618ms] or [+149.808%; +150.248%]
  • 🟩 throughput [+1441.400op/s; +1467.893op/s] or [+28.611%; +29.136%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472

  • 🟩 execution_time [-142.524µs; -135.340µs] or [-29.262%; -27.787%]
  • 🟩 throughput [+796.461op/s; +848.247op/s] or [+38.791%; +41.313%]

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

  • 🟩 execution_time [-136.110µs; -109.452µs] or [-31.217%; -25.103%]
  • 🟩 throughput [+832.043op/s; +954.087op/s] or [+36.174%; +41.480%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1

  • 🟩 execution_time [-141.696µs; -119.716µs] or [-30.359%; -25.650%]
  • 🟩 throughput [+768.754op/s; +851.248op/s] or [+35.487%; +39.295%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472

  • 🟩 execution_time [-127.503µs; -122.877µs] or [-34.425%; -33.176%]
  • 🟩 throughput [+1351.833op/s; +1409.240op/s] or [+50.066%; +52.192%]

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

  • 🟩 execution_time [-102.206µs; -78.541µs] or [-32.629%; -25.074%]
  • 🟩 throughput [+1178.907op/s; +1383.369op/s] or [+36.750%; +43.124%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1

  • 🟩 execution_time [-136.495µs; -114.117µs] or [-37.340%; -31.218%]
  • 🟩 throughput [+1308.366op/s; +1444.770op/s] or [+46.952%; +51.847%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+300.113ms; +300.842ms] or [+149.787%; +150.151%]

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

  • 🟥 execution_time [+416.206ms; +422.294ms] or [+452.225%; +458.840%]
  • 🟩 throughput [+805.926op/s; +973.546op/s] or [+6.622%; +8.000%]

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

  • unstable execution_time [+296.697ms; +348.111ms] or [+225.279%; +264.317%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 allocated_mem [+2.824KB; +2.829KB] or [+5.017%; +5.027%]
  • unstable execution_time [+301.076ms; +349.219ms] or [+138.432%; +160.568%]
  • 🟥 throughput [-495.388op/s; -457.314op/s] or [-44.887%; -41.437%]

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

  • unstable execution_time [+203.240ms; +336.537ms] or [+86.612%; +143.418%]
  • 🟥 throughput [-672.047op/s; -588.541op/s] or [-44.826%; -39.256%]

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

  • 🟥 execution_time [+340.860ms; +347.982ms] or [+203.874%; +208.134%]
  • 🟥 throughput [-396.603op/s; -361.244op/s] or [-27.615%; -25.153%]

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

  • unstable throughput [-3.191op/s; +96.897op/s] or [-0.596%; +18.087%]

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

  • 🟩 execution_time [-178.976µs; -138.774µs] or [-9.066%; -7.030%]
  • 🟩 throughput [+39.666op/s; +50.527op/s] or [+7.830%; +9.974%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.731ms; +303.405ms] or [+151.946%; +152.789%]

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

  • 🟥 execution_time [+302.126ms; +303.426ms] or [+151.396%; +152.047%]

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

  • 🟥 execution_time [+302.196ms; +305.798ms] or [+151.811%; +153.620%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.396ms; +303.635ms] or [+151.853%; +152.475%]
  • 🟩 throughput [+19671.306op/s; +21435.679op/s] or [+6.590%; +7.181%]

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

  • 🟥 execution_time [+298.801ms; +301.564ms] or [+147.744%; +149.110%]

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

  • 🟥 execution_time [+303.267ms; +306.759ms] or [+153.709%; +155.479%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+307.352ms; +309.476ms] or [+154.263%; +155.329%]

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

  • 🟥 execution_time [+300.571ms; +303.719ms] or [+149.807%; +151.376%]
  • 🟩 throughput [+36278.205op/s; +51503.189op/s] or [+7.204%; +10.227%]

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

  • 🟥 execution_time [+300.497ms; +303.849ms] or [+149.495%; +151.162%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472

  • 🟥 throughput [-17087.225op/s; -15967.211op/s] or [-6.871%; -6.421%]

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

  • 🟩 execution_time [-16.681ms; -13.035ms] or [-7.757%; -6.061%]

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

  • unstable execution_time [+15.028µs; +60.995µs] or [+3.712%; +15.066%]

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

  • 🟩 allocated_mem [-19.415KB; -19.391KB] or [-7.082%; -7.074%]
  • unstable execution_time [-31.863µs; +25.822µs] or [-6.298%; +5.104%]

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

  • unstable execution_time [-69.494µs; -6.651µs] or [-12.043%; -1.153%]
  • unstable throughput [+40.042op/s; +218.796op/s] or [+2.288%; +12.500%]

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

  • unstable execution_time [+8.267µs; +12.919µs] or [+19.542%; +30.537%]
  • 🟥 throughput [-5612.717op/s; -3727.411op/s] or [-23.628%; -15.691%]

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

  • unstable execution_time [-14.464µs; -6.950µs] or [-22.440%; -10.783%]
  • unstable throughput [+1719.570op/s; +3359.279op/s] or [+10.550%; +20.610%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+302.586ms; +303.973ms] or [+152.944%; +153.645%]

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

  • 🟥 execution_time [+304.212ms; +306.411ms] or [+154.843%; +155.962%]

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

  • 🟥 execution_time [+301.247ms; +303.876ms] or [+150.812%; +152.127%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.017ms; +301.991ms] or [+149.532%; +150.515%]

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

  • 🟥 execution_time [+301.616ms; +302.605ms] or [+151.457%; +151.954%]

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

  • 🟥 execution_time [+302.755ms; +305.874ms] or [+153.538%; +155.120%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.924ms; +300.745ms] or [+149.604%; +150.013%]
  • 🟩 throughput [+61018734.005op/s; +61389821.131op/s] or [+44.438%; +44.708%]

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

  • 🟥 execution_time [+418.975ms; +425.301ms] or [+521.070%; +528.938%]

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

  • 🟥 execution_time [+298.942ms; +300.057ms] or [+149.106%; +149.661%]

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

  • 🟩 throughput [+77232.907op/s; +85995.787op/s] or [+7.211%; +8.029%]

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

  • 🟩 throughput [+52704.101op/s; +65333.157op/s] or [+5.234%; +6.489%]

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

  • 🟩 throughput [+55729.074op/s; +60355.917op/s] or [+10.119%; +10.960%]

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

  • 🟩 throughput [+81368.371op/s; +98911.887op/s] or [+9.091%; +11.051%]

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 net472
  • 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 net472
  • 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.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@andrewlock
andrewlock force-pushed the andrew/refactor-web-request branch from 8c9cb73 to 388d2f2 Compare August 27, 2026 17:16
@andrewlock
andrewlock force-pushed the andrew/web-request-timeout branch from 89b5894 to c221aa9 Compare August 27, 2026 17:16
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected

📄 View the full report (charts + all metrics) →

@andrewlock
andrewlock force-pushed the andrew/refactor-web-request branch from 388d2f2 to db88bf0 Compare August 27, 2026 19:21
@andrewlock
andrewlock force-pushed the andrew/web-request-timeout branch from c221aa9 to 0e63bc8 Compare August 27, 2026 19:21
There was a race where the Abort() callback could file shortly after returning a "success" response
…eadline

Without this, you can cause a request to hang forever if the write body hangs, and can also fail to unblock a hanging GetResponseAsync(). Make it safe.
@andrewlock

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 29ebf0396c

ℹ️ 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".

@andrewlock
andrewlock marked this pull request as ready for review August 28, 2026 15:35
@andrewlock
andrewlock requested a review from a team as a code owner August 28, 2026 15:35
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) type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant