Skip to content

[AAP] Collect DataContract JSON response body schemas - #8706

Merged
dromanol merged 36 commits into
masterfrom
flavien.darche/aap/response-body-outputstream
Jul 29, 2026
Merged

[AAP] Collect DataContract JSON response body schemas#8706
dromanol merged 36 commits into
masterfrom
flavien.darche/aap/response-body-outputstream

Conversation

@e-n-0

@e-n-0 e-n-0 commented May 28, 2026

Copy link
Copy Markdown
Member

Summary of changes

Adds API Security response body schema collection for ASP.NET MVC/Web API responses serialized with DataContractJsonSerializer.WriteObject(response.OutputStream, data) (doc).

This adds a .NET Framework AppSec instrumentation for DataContractJsonSerializer.WriteObject(Stream, object). The hook only reports when the serializer writes to the current ASP.NET response stream, AppSec is enabled, response body parsing is enabled, and an ASP.NET MVC/Web API scope is active.

It also adds a DataContractObjectExtractor for this path. For [DataContract] types, it reports only [DataMember] members, uses DataMember(Name = ...), and skips ignored or unmarked members.

Reason for change

A case seen writes the response with DataContractJsonSerializer directly to HttpResponse.OutputStream, which bypasses the existing JsonResult.Data response body extraction.

Without this instrumentation, those endpoints skipped AAP API Security traces.

Implementation details

  • Instruments System.Runtime.Serialization.Json.DataContractJsonSerializer.WriteObject(Stream, object)
  • Captures after successful serialization, using the original graph object instead of buffering response bytes.
  • Requires the stream to be the current HttpContext.Response.OutputStream, so serializing to MemoryStream, files, or other streams are ignored.

Test coverage

  • Added unit coverage for DataContract member naming and over-capture prevention.
  • Added an MVC5 sample endpoint that returns a custom ActionResult and calls DataContractJsonSerializer.WriteObject(response.OutputStream, data).
  • Added API Security snapshots for the new MVC5 scenario with API Security enabled and disabled.

Other details

https://datadoghq.atlassian.net/browse/APPSEC-68123

@datadog-prod-us1-4

This comment has been minimized.

@e-n-0 e-n-0 changed the title [AppSec] Collect DataContract JSON response body schemas [AAP] Collect DataContract JSON response body schemas May 28, 2026
@e-n-0 e-n-0 added the area:asm label May 28, 2026
@pr-commenter

pr-commenter Bot commented May 28, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-28 21:31:46

Comparing candidate commit 97b46ca in PR branch flavien.darche/aap/response-body-outputstream with baseline commit 4937b53 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 62 known flaky benchmarks, 64 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.Trace.HttpClientBenchmark.SendAsync net472

  • 🟥 throughput [-5093.385op/s; -4832.496op/s] or [-5.814%; -5.517%]

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.ActivityBenchmark.StartSpan net6.0

  • 🟩 throughput [+14914.200op/s; +20244.156op/s] or [+5.354%; +7.267%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-9737.272op/s; -9235.158op/s] or [-11.546%; -10.950%]

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

  • 🟥 throughput [-8797.217op/s; -7337.541op/s] or [-8.945%; -7.461%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+319.258ms; +323.478ms] or [+158.427%; +160.521%]
  • 🟥 throughput [-44.243op/s; -39.349op/s] or [-7.960%; -7.080%]

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

  • 🟥 execution_time [+382.473ms; +384.154ms] or [+302.177%; +303.505%]
  • 🟩 throughput [+87.403op/s; +90.235op/s] or [+11.524%; +11.897%]

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

  • 🟥 execution_time [+394.922ms; +399.000ms] or [+349.491%; +353.100%]

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

  • 🟥 allocated_mem [+4.686KB; +4.686KB] or [+98.642%; +98.655%]
  • 🟥 throughput [-60804.509op/s; -60438.604op/s] or [-47.309%; -47.024%]

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

  • 🟥 allocated_mem [+3.808KB; +3.808KB] or [+80.535%; +80.548%]
  • 🟩 execution_time [-15.779ms; -11.584ms] or [-7.369%; -5.410%]
  • 🟥 throughput [-59935.719op/s; -57175.730op/s] or [-43.750%; -41.735%]

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

  • 🟥 allocated_mem [+4.536KB; +4.536KB] or [+98.084%; +98.099%]
  • 🟥 throughput [-48828.009op/s; -46557.019op/s] or [-44.146%; -42.093%]

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.743%; +105.758%]
  • 🟥 throughput [-260719.195op/s; -257513.547op/s] or [-26.621%; -26.293%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.582ms; -21.694ms] or [-11.854%; -9.675%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-162531.986op/s; -145541.361op/s] or [-23.353%; -20.911%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-72634.257op/s; -71877.324op/s] or [-48.882%; -48.373%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-72906.773op/s; -70009.268op/s] or [-46.389%; -44.546%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-56242.980op/s; -53620.401op/s] or [-44.805%; -42.716%]

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

  • 🟩 throughput [+306765.570op/s; +335325.761op/s] or [+10.229%; +11.181%]

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

  • 🟩 execution_time [-19.149ms; -14.818ms] or [-8.827%; -6.831%]

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

  • 🟥 execution_time [+299.269ms; +300.126ms] or [+149.534%; +149.963%]

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

  • 🟥 execution_time [+300.342ms; +304.307ms] or [+151.463%; +153.463%]

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

  • 🟥 execution_time [+300.352ms; +302.775ms] or [+151.294%; +152.514%]

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

  • 🟥 execution_time [+298.304ms; +299.364ms] or [+146.515%; +147.036%]

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

  • 🟥 execution_time [+297.324ms; +300.119ms] or [+145.351%; +146.717%]

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

  • 🟥 execution_time [+303.791ms; +306.250ms] or [+151.834%; +153.064%]

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

  • 🟥 execution_time [+24.781µs; +48.681µs] or [+7.911%; +15.541%]
  • 🟥 throughput [-449.575op/s; -248.740op/s] or [-14.015%; -7.754%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.232ms; +300.094ms] or [+149.347%; +149.778%]

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

  • 🟥 execution_time [+410.222ms; +416.438ms] or [+445.724%; +452.476%]

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

  • unstable execution_time [+299.727ms; +350.896ms] or [+227.580%; +266.432%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+290.589ms; +349.539ms] or [+133.610%; +160.714%]
  • 🟥 throughput [-525.004op/s; -481.235op/s] or [-47.570%; -43.605%]

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

  • unstable execution_time [+202.569ms; +335.814ms] or [+86.326%; +143.110%]
  • 🟥 throughput [-670.918op/s; -587.415op/s] or [-44.750%; -39.181%]

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

  • 🟥 execution_time [+345.696ms; +356.813ms] or [+206.766%; +213.416%]
  • 🟥 throughput [-404.398op/s; -368.523op/s] or [-28.158%; -25.660%]

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

  • unstable throughput [+18.615op/s; +64.384op/s] or [+5.351%; +18.507%]

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

  • 🟩 execution_time [-194.211µs; -144.886µs] or [-9.838%; -7.339%]
  • 🟩 throughput [+41.999op/s; +55.536op/s] or [+8.291%; +10.963%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+302.410ms; +304.619ms] or [+152.288%; +153.400%]

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

  • 🟥 execution_time [+299.502ms; +303.126ms] or [+150.081%; +151.897%]

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

  • 🟥 execution_time [+299.983ms; +303.083ms] or [+150.699%; +152.256%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.578ms; +303.355ms] or [+151.442%; +152.335%]

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

  • 🟥 execution_time [+297.909ms; +299.833ms] or [+147.303%; +148.254%]

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

  • 🟥 execution_time [+303.761ms; +307.977ms] or [+153.959%; +156.096%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+297.401ms; +301.196ms] or [+149.268%; +151.173%]

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

  • 🟥 execution_time [+300.978ms; +302.978ms] or [+150.010%; +151.007%]
  • 🟩 throughput [+46709.859op/s; +56945.790op/s] or [+9.275%; +11.308%]

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

  • 🟥 execution_time [+299.368ms; +301.828ms] or [+148.933%; +150.157%]

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

  • unstable execution_time [-221.221µs; +839.040µs] or [-54.643%; +207.249%]
  • unstable throughput [-392.198op/s; -115.592op/s] or [-15.782%; -4.652%]

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

  • 🟩 allocated_mem [-17.914KB; -17.891KB] or [-6.535%; -6.526%]
  • unstable execution_time [+12.500µs; +115.203µs] or [+2.471%; +22.769%]
  • unstable throughput [-273.921op/s; +8.213op/s] or [-13.669%; +0.410%]

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

  • 🟩 allocated_mem [-19.214KB; -19.196KB] or [-7.004%; -6.998%]
  • unstable execution_time [-63.562µs; -1.283µs] or [-11.015%; -0.222%]
  • unstable throughput [+20.340op/s; +196.242op/s] or [+1.162%; +11.212%]

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

  • unstable execution_time [+6.485µs; +10.746µs] or [+15.328%; +25.400%]
  • 🟥 throughput [-4894.981op/s; -3080.255op/s] or [-20.606%; -12.967%]

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

  • unstable execution_time [-15.113µs; -7.785µs] or [-23.448%; -12.078%]
  • 🟩 throughput [+1970.911op/s; +3547.333op/s] or [+12.092%; +21.764%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.403ms; +302.897ms] or [+152.346%; +153.101%]

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

  • 🟥 execution_time [+303.149ms; +305.215ms] or [+154.302%; +155.354%]

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

  • 🟥 execution_time [+298.834ms; +301.114ms] or [+149.603%; +150.745%]

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

  • 🟩 throughput [+36673.504op/s; +40555.692op/s] or [+6.942%; +7.676%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+298.339ms; +300.700ms] or [+148.695%; +149.872%]

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

  • 🟥 execution_time [+302.267ms; +304.774ms] or [+151.784%; +153.043%]

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

  • 🟥 execution_time [+303.807ms; +306.600ms] or [+154.071%; +155.488%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.685ms; +300.876ms] or [+149.485%; +150.079%]
  • 🟩 throughput [+61154522.943op/s; +61486511.680op/s] or [+44.537%; +44.778%]

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

  • 🟥 execution_time [+421.686ms; +425.946ms] or [+524.442%; +529.739%]

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

  • 🟥 execution_time [+299.261ms; +300.351ms] or [+149.265%; +149.808%]

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

  • 🟩 throughput [+83689.171op/s; +95730.104op/s] or [+7.814%; +8.938%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472

  • 🟥 throughput [-68493.047op/s; -60664.443op/s] or [-6.270%; -5.553%]

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

  • 🟩 throughput [+78136.432op/s; +108595.787op/s] or [+6.048%; +8.406%]

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

  • 🟩 throughput [+71644.955op/s; +82769.149op/s] or [+7.115%; +8.220%]

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

  • 🟩 throughput [+30701.638op/s; +40217.936op/s] or [+5.575%; +7.303%]

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

  • 🟩 throughput [+67849.761op/s; +84605.668op/s] or [+7.581%; +9.453%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • 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.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • 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 net6.0
  • 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 netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • 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

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented May 28, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

⚠️ Potential regressions detected

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Bailout
duration74.24 ± (74.04 - 74.41) ms79.90 ± (79.44 - 79.91) ms+7.6%❌⬆️
Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration70.69 ± (70.74 - 71.08) ms71.04 ± (71.17 - 71.54) ms+0.5%✅⬆️
.NET Framework 4.8 - Bailout
duration74.24 ± (74.04 - 74.41) ms79.90 ± (79.44 - 79.91) ms+7.6%❌⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1086.20 ± (1088.36 - 1096.51) ms1088.22 ± (1088.35 - 1094.71) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.06 ± (22.03 - 22.09) ms22.24 ± (22.19 - 22.29) ms+0.8%✅⬆️
process.time_to_main_ms81.03 ± (80.85 - 81.21) ms83.30 ± (83.00 - 83.60) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed11.01 ± (11.00 - 11.01) MB11.00 ± (11.00 - 11.00) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.91 ± (21.88 - 21.94) ms22.24 ± (22.20 - 22.28) ms+1.5%✅⬆️
process.time_to_main_ms82.26 ± (82.07 - 82.44) ms85.42 ± (85.15 - 85.69) ms+3.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed11.04 ± (11.04 - 11.04) MB11.03 ± (11.02 - 11.03) MB-0.1%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms210.37 ± (209.58 - 211.16) ms209.47 ± (208.46 - 210.48) ms-0.4%
process.time_to_main_ms538.41 ± (537.37 - 539.46) ms537.29 ± (536.02 - 538.56) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.61 ± (49.59 - 49.64) MB49.47 ± (49.43 - 49.50) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms20.94 ± (20.91 - 20.98) ms21.09 ± (21.04 - 21.14) ms+0.7%✅⬆️
process.time_to_main_ms72.02 ± (71.75 - 72.30) ms73.78 ± (73.50 - 74.05) ms+2.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.71 ± (10.70 - 10.71) MB10.72 ± (10.72 - 10.73) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.12 ± (21.07 - 21.16) ms20.82 ± (20.79 - 20.85) ms-1.4%
process.time_to_main_ms75.60 ± (75.37 - 75.84) ms72.53 ± (72.41 - 72.66) ms-4.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.83 ± (10.83 - 10.83) MB10.84 ± (10.83 - 10.84) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.92 ± (367.51 - 372.34) ms374.90 ± (372.77 - 377.03) ms+1.3%✅⬆️
process.time_to_main_ms545.20 ± (544.11 - 546.29) ms547.26 ± (545.91 - 548.62) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.60 ± (50.58 - 50.62) MB50.61 ± (50.59 - 50.64) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.03 ± (19.01 - 19.06) ms19.34 ± (19.29 - 19.39) ms+1.6%✅⬆️
process.time_to_main_ms69.96 ± (69.83 - 70.09) ms72.74 ± (72.44 - 73.05) ms+4.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.72 - 7.73) MB7.77 ± (7.77 - 7.78) MB+0.6%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.01 ± (18.98 - 19.04) ms18.96 ± (18.93 - 19.00) ms-0.3%
process.time_to_main_ms70.86 ± (70.74 - 70.98) ms71.30 ± (71.17 - 71.44) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.78 ± (7.78 - 7.79) MB7.82 ± (7.82 - 7.83) MB+0.5%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms296.05 ± (293.85 - 298.25) ms303.01 ± (300.44 - 305.59) ms+2.4%✅⬆️
process.time_to_main_ms494.31 ± (493.14 - 495.48) ms495.36 ± (494.13 - 496.58) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.03 ± (38.01 - 38.06) MB38.05 ± (38.02 - 38.08) MB+0.0%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.9%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration213.64 ± (213.36 - 214.30) ms211.04 ± (211.50 - 212.42) ms-1.2%
.NET Framework 4.8 - Bailout
duration218.31 ± (217.91 - 218.69) ms215.32 ± (214.80 - 215.73) ms-1.4%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1276.30 ± (1276.14 - 1283.47) ms1262.40 ± (1262.15 - 1268.27) ms-1.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms204.33 ± (203.92 - 204.75) ms202.35 ± (202.03 - 202.67) ms-1.0%
process.time_to_main_ms90.44 ± (90.18 - 90.71) ms89.23 ± (88.94 - 89.51) ms-1.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.06 - 16.10) MB16.20 ± (16.18 - 16.22) MB+0.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms203.60 ± (203.14 - 204.05) ms202.50 ± (202.11 - 202.88) ms-0.5%
process.time_to_main_ms91.22 ± (90.99 - 91.45) ms90.88 ± (90.67 - 91.10) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.08 - 16.12) MB16.21 ± (16.19 - 16.22) MB+0.7%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+1.6%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms400.82 ± (399.43 - 402.20) ms395.69 ± (394.25 - 397.13) ms-1.3%
process.time_to_main_ms573.44 ± (571.97 - 574.91) ms560.54 ± (559.27 - 561.81) ms-2.3%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed59.84 ± (59.75 - 59.93) MB59.65 ± (59.50 - 59.81) MB-0.3%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.3%
.NET 6 - Baseline
process.internal_duration_ms209.66 ± (209.16 - 210.16) ms206.99 ± (206.52 - 207.45) ms-1.3%
process.time_to_main_ms79.51 ± (79.27 - 79.75) ms78.27 ± (78.01 - 78.53) ms-1.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.50 ± (16.48 - 16.52) MB16.37 ± (16.34 - 16.39) MB-0.8%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.3%
.NET 6 - Bailout
process.internal_duration_ms208.81 ± (208.33 - 209.28) ms206.42 ± (206.00 - 206.84) ms-1.1%
process.time_to_main_ms80.56 ± (80.34 - 80.79) ms79.38 ± (79.16 - 79.60) ms-1.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.47 ± (16.45 - 16.49) MB16.46 ± (16.43 - 16.49) MB-0.0%
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)+0.1%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms577.15 ± (575.09 - 579.21) ms579.92 ± (577.39 - 582.44) ms+0.5%✅⬆️
process.time_to_main_ms589.68 ± (587.82 - 591.54) ms577.73 ± (576.40 - 579.05) ms-2.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.44 ± (61.35 - 61.53) MB61.50 ± (61.42 - 61.58) MB+0.1%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms209.25 ± (208.84 - 209.66) ms206.84 ± (206.44 - 207.24) ms-1.2%
process.time_to_main_ms78.64 ± (78.32 - 78.96) ms77.99 ± (77.73 - 78.24) ms-0.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.70 ± (11.67 - 11.72) MB11.76 ± (11.74 - 11.78) MB+0.5%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.4%
.NET 8 - Bailout
process.internal_duration_ms208.70 ± (208.19 - 209.20) ms207.56 ± (207.10 - 208.03) ms-0.5%
process.time_to_main_ms80.55 ± (80.32 - 80.78) ms79.74 ± (79.48 - 80.00) ms-1.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.73 - 11.78) MB11.79 ± (11.77 - 11.81) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.3%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms534.92 ± (527.53 - 542.31) ms511.93 ± (506.93 - 516.92) ms-4.3%
process.time_to_main_ms540.81 ± (539.68 - 541.94) ms529.20 ± (528.22 - 530.18) ms-2.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.55 ± (51.47 - 51.63) MB51.42 ± (51.36 - 51.48) MB-0.3%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.2%
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 (8706) - mean (71ms)  : 69, 74
    master - mean (71ms)  : 68, 73

    section Bailout
    This PR (8706) - mean (80ms)  : crit, 76, 83
    master - mean (74ms)  : 72, 76

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (1,092ms)  : 1046, 1137
    master - mean (1,092ms)  : 1035, 1150

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 (8706) - mean (113ms)  : 106, 120
    master - mean (109ms)  : 105, 113

    section Bailout
    This PR (8706) - mean (115ms)  : 109, 121
    master - mean (110ms)  : 108, 112

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (783ms)  : 763, 804
    master - mean (786ms)  : 764, 808

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

    section Bailout
    This PR (8706) - mean (99ms)  : 97, 101
    master - mean (103ms)  : 98, 108

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (955ms)  : 912, 998
    master - mean (945ms)  : 902, 989

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8706) - mean (100ms)  : 92, 107
    master - mean (96ms)  : 93, 99

    section Bailout
    This PR (8706) - mean (97ms)  : 95, 100
    master - mean (97ms)  : 95, 98

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (829ms)  : 784, 875
    master - mean (819ms)  : 783, 855

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 (8706) - mean (212ms)  : 205, 218
    master - mean (214ms)  : 209, 219

    section Bailout
    This PR (8706) - mean (215ms)  : 210, 220
    master - mean (218ms)  : 215, 222

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (1,265ms)  : 1222, 1309
    master - mean (1,280ms)  : 1227, 1333

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 (8706) - mean (302ms)  : 295, 308
    master - mean (304ms)  : 296, 313

    section Bailout
    This PR (8706) - mean (304ms)  : 298, 309
    master - mean (304ms)  : 299, 310

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (1,000ms)  : 978, 1021
    master - mean (1,016ms)  : 995, 1037

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8706) - mean (295ms)  : 288, 302
    master - mean (299ms)  : 290, 307

    section Bailout
    This PR (8706) - mean (296ms)  : 290, 302
    master - mean (298ms)  : 291, 306

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (1,193ms)  : 1160, 1226
    master - mean (1,208ms)  : 1175, 1240

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8706) - mean (295ms)  : 288, 302
    master - mean (299ms)  : 292, 306

    section Bailout
    This PR (8706) - mean (298ms)  : 290, 307
    master - mean (300ms)  : 292, 309

    section CallTarget+Inlining+NGEN
    This PR (8706) - mean (1,086ms)  : 985, 1187
    master - mean (1,123ms)  : 1000, 1245

Loading

@e-n-0
e-n-0 force-pushed the flavien.darche/aap/response-body-outputstream branch from 81bc156 to c3a6ff6 Compare May 28, 2026 19:26
@dromanol
dromanol force-pushed the flavien.darche/aap/response-body-outputstream branch from 59fdcb0 to 4676412 Compare June 5, 2026 11:48
@dromanol
dromanol marked this pull request as ready for review June 8, 2026 13:52
@dromanol
dromanol requested review from a team as code owners June 8, 2026 13:52
@dromanol
dromanol requested review from vandonr and removed request for a team June 8, 2026 13:52

@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: 02fc0bb751

ℹ️ 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/AppSec/ObjectExtractor.cs Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs Outdated
@e-n-0

e-n-0 commented Jun 9, 2026

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: 489c3e4b95

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

Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
@dromanol

dromanol commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@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: 603961b556

ℹ️ 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/AppSec/ObjectExtractor.cs Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs Outdated
@dromanol
dromanol marked this pull request as draft June 15, 2026 08:36
@dromanol
dromanol force-pushed the flavien.darche/aap/response-body-outputstream branch 2 times, most recently from 6d83061 to 8f12fa9 Compare July 21, 2026 09:27
@dromanol
dromanol marked this pull request as ready for review July 21, 2026 13:55

@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: 8f12fa936e

ℹ️ 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/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs

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

Finally, it looks good.

e-n-0 and others added 20 commits July 28, 2026 13:25
Resolve open codex P2 review comments on ObjectExtractor:
- emit Uri as a scalar string
- omit public readonly fields on non-[DataContract] POCOs
- include get-only collection properties (populated via Add)
- use the field contract for [Serializable] types (raw field names, honor [NonSerialized])
- treat non-generic IDictionary (e.g. Hashtable) as a dictionary
- track visited collection instances to avoid cyclic stack overflow
- extract DateTimeOffset as the serializer's {DateTime, OffsetMinutes} object

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…extraction

foreach (DictionaryEntry entry in source) over a non-generic IDictionary
unboxed the enumerator's object? Current into DictionaryEntry, triggering
CS8605 (unboxing a possibly null value) under #nullable. Iterate via
IDictionaryEnumerator.Entry (a non-null DictionaryEntry) instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread tracer/build/_build/Honeypot/IntegrationGroups.cs
Comment thread tracer/build/supported_versions.json Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs

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 have not fully reviewed this file, I just don't have the capacity to grok it unfortunately, so I'm going to defer to trusting you 😄

Comment thread tracer/src/Datadog.Tracer.Native/cor_profiler.cpp
@dromanol
dromanol force-pushed the flavien.darche/aap/response-body-outputstream branch from 7e8aa14 to bb07ba9 Compare July 28, 2026 14:11
…tion

- Wrap DataContract-only extraction code and tests in #if NETFRAMEWORK so
  the .NET Core Datadog.Trace assembly no longer carries the unused paths
- Invert OnMethodBegin guard for readability and annotate TryGetCaptureContext
  graph with [NotNullWhen(true)], removing the null-forgiving operator

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@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: 39f4ae1ad9

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

Comment thread tracer/build/supported_versions.json Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/ObjectExtractor.cs
The System.Runtime.Serialization support entry was listed under AspNetMvc,
but the InstrumentMethod attributes gate the calltargets under IntegrationId.AspNet.
Align the entry to AspNet and move it to its sorted position.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dromanol
dromanol merged commit efe1444 into master Jul 29, 2026
141 checks passed
@dromanol
dromanol deleted the flavien.darche/aap/response-body-outputstream branch July 29, 2026 06:55
@github-actions github-actions Bot added this to the vNext-v3 milestone Jul 29, 2026
dromanol added a commit that referenced this pull request Jul 30, 2026
…8958)

## Summary

An internal codex security review found that `ObjectExtractor`'s
object-property extraction (`ExtractProperties`) enforces
`WafConstants.MaxContainerDepth`, but the list/dictionary recursion
paths (`ExtractListOrArray`, `ExtractDictionary`,
`ExtractDictionaryAsKeyValuePairs`, `ExtractNonGenericDictionary`)
increment depth on recursion without ever checking it against the limit.
A deeply nested (acyclic) enumerable or dictionary graph can therefore
recurse until `StackOverflowException`, which is process-fatal in .NET.

This became more reachable after #8706 broadened the `IEnumerable`
routing to any enumerable type (not just arrays/`List<T>`), widening
what data can reach the unbounded recursion (e.g. `HashSet<T>`, custom
`IEnumerable` wrappers, JSON-like collection types) via AAP
request/response extraction.

- Adds the same depth-cap check used by `ExtractProperties` to all four
container-recursion paths.
- Confirmed the vulnerability directly: reverting the fix and running a
new regression test with 100k nested lists reliably crashed the test
host process with a genuine stack overflow.

## Test plan
- [x] Added `TestDeeplyNestedAcyclicListDoesNotStackOverflow` — 100k
nested lists, asserts no crash (crashes the process without the fix).
- [x] Added `TestNestedListRespectsMaxContainerDepth` — asserts the list
is truncated to empty exactly at `MaxContainerDepth`, mirroring the
existing `TestNestedObjectsAboveLimit` object-property test.
- [x] Ran full `ObjectExtractorTests` suite across all target frameworks
— all passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants