Skip to content

[Debugger] Guard static member capture#8814

Merged
dudikeleti merged 5 commits into
masterfrom
dudik/debugger-static-member-capture-safety
Jun 26, 2026
Merged

[Debugger] Guard static member capture#8814
dudikeleti merged 5 commits into
masterfrom
dudik/debugger-static-member-capture-safety

Conversation

@dudikeleti

Copy link
Copy Markdown
Contributor

Summary of changes

  • Guard debugger snapshot static field/property capture so members on types with static constructors are skipped.
  • Preserve static literal constants via GetRawConstantValue, including enum constants with their enum type.
  • Preserve existing static capture for declaring types without a type initializer.
  • Apply the same safety rules to probe expression member access and expression dump field capture.
  • Add regression coverage for cctor-free statics, risky cctor statics, literals, and enum constants.

Reason for change

Reading static members through reflection can trigger a customer type initializer (.cctor) during debugger snapshot or expression evaluation. This narrows static capture to cases that are metadata-safe while preserving existing behavior for constants and cctor-free types.

Implementation details

Static member safety is centralized in StaticMemberSafety. Static fields/properties are read only when their declaring type has no TypeInitializer; literal constants use metadata-only raw constant reads. Expression dumps filter unsafe static fields before GetValue and use the same literal handling.

Implementation details

Static member safety is centralized in StaticMemberSafety.

A static member is still captured when:

  • it is a literal constant (const / FieldInfo.IsLiteral), read via GetRawConstantValue
  • its declaring type has no TypeInitializer, so there is no .cctor to trigger

A static member is skipped when its declaring type has a TypeInitializer. It can be emitted either from an explicit static TypeName() constructor or from static field/property initializers such as public static string Field = "value" or public static string Property { get; } = "value".

The guard intentionally does not special-case beforefieldinit. beforefieldinit changes when the runtime is allowed to run the type initializer, but it does not give us a public, non-triggering way to know whether the initializer has already run. Because a reflective static read can still be the operation that causes customer code to execute, any member on a type with TypeInitializer != null is treated as unsafe unless it is a literal constant.

Test coverage

  • DebuggerSnapshotCreatorTests|DebuggerExpressionLanguageTests|DebuggerintegrationTests

@dudikeleti
dudikeleti requested a review from a team as a code owner June 22, 2026 14:55
@dudikeleti
dudikeleti requested a review from Copilot June 22, 2026 14:55
@dudikeleti

Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

4 occurrences of :

-                "type": "String",
-                "value": "Static Field"
+                "notCapturedReason": "typeInitializer",
+                "type": "String"
[...]
-                "type": "String",
-                "value": "Static Property"
+                "notCapturedReason": "typeInitializer",
+                "type": "String"

2 occurrences of :

-                  "type": "String",
-                  "value": "Static Field"
+                  "notCapturedReason": "typeInitializer",
+                  "type": "String"
[...]
-                  "type": "String",
-                  "value": "Static Property"
+                  "notCapturedReason": "typeInitializer",
+                  "type": "String"

2 occurrences of :

-                "elements": [
-                  {
-                    "fields": {
-                      "Id": {
-                        "type": "String",
-                        "value": "Foo"
-                      },
-                      "Status": {
-                        "type": "RoomStatus",
-                        "value": "Maintenance"
-                      }
-                    },
-                    "type": "Room"
-                  },
-                  {
-                    "fields": {
-                      "Id": {
-                        "type": "String",
-                        "value": "Bar"
-                      },
-                      "Status": {
-                        "type": "RoomStatus",
-                        "value": "Ready"
-                      }
-                    },
-                    "type": "Room"
-                  }
-                ],
-                "size": 2,
+                "notCapturedReason": "typeInitializer",

2 occurrences of :

-                "elements": [
-                  {
-                    "fields": {
-                      "Id": {
-                        "type": "String",
-                        "value": "Foo"
-                      },
-                      "Status": {
-                        "type": "RoomStatus",
-                        "value": "Ready"
-                      }
-                    },
-                    "type": "Room"
-                  },
-                  {
-                    "fields": {
-                      "Id": {
-                        "type": "String",
-                        "value": "Bar"
-                      },
-                      "Status": {
-                        "type": "RoomStatus",
-                        "value": "Ready"
-                      }
-                    },
-                    "type": "Room"
-                  }
-                ],
-                "size": 2,
+                "notCapturedReason": "typeInitializer",

2 occurrences of :

-                "elements": [
-                  {
-                    "elements": [
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      }
-                    ],
-                    "size": 10,
-                    "type": "State[]"
-                  },
-                  {
-                    "elements": [
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      },
-                      {
-                        "type": "State",
-                        "value": "Error"
-                      }
-                    ],
-                    "size": 10,
-                    "type": "State[]"
-                  }
-                ],
-                "size": 2,
+                "notCapturedReason": "typeInitializer",

2 occurrences of :

-      SpanDecorationError: Instance=Datadog.Trace.Debugger.Expressions.UndefinedValue,
+      SpanDecorationError: UndefinedValue,

2 occurrences of :

-      SpanDecorationSameTagsSecondError: Instance=Datadog.Trace.Debugger.Expressions.UndefinedValue,
+      SpanDecorationSameTagsSecondError: UndefinedValue,

1 occurrences of :

-      SpanDecorationTwoSegments: Instance=Datadog.Trace.Debugger.Expressions.UndefinedValueRun,
+      SpanDecorationTwoSegments: UndefinedValueRun,

Copilot AI 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.

Pull request overview

This PR hardens debugger snapshot serialization and probe expression evaluation to avoid triggering customer type initializers (.cctor) when reading static fields/properties via reflection, while still capturing metadata-only constants safely.

Changes:

  • Introduces StaticMemberSafety to centralize the “safe to read static member” decision and to read literal constants via GetRawConstantValue (including preserving enum types).
  • Updates snapshot serialization and probe expression evaluation/dump paths to skip unsafe statics (types with TypeInitializer != null) and to use the new literal-constant handling.
  • Adds/updates regression tests and approval baselines to cover safe statics, unsafe statics, literals, and enum constants.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tracer/src/Datadog.Trace/Debugger/Helpers/StaticMemberSafety.cs Adds centralized static-member safety checks and raw constant extraction.
tracer/src/Datadog.Trace/Debugger/Snapshots/DebuggerSnapshotSerializer.cs Prevents snapshot static reads from triggering type initializers; preserves literal constants.
tracer/src/Datadog.Trace/Debugger/Expressions/ProbeExpressionParser.General.cs Guards static member access in expressions; emits undefined + error for unsafe statics; preserves literal constants.
tracer/src/Datadog.Trace/Debugger/Expressions/ProbeExpressionParser.Dump.cs Filters unsafe static fields during dumps and safely retrieves literal field values.
tracer/test/Datadog.Trace.Tests/Debugger/DebuggerSnapshotCreatorTests.cs Adds unit coverage for capturing cctor-free statics and skipping unsafe statics while preserving constants.
tracer/test/Datadog.Trace.Tests/Debugger/DebuggerExpressionLanguageTests.cs Adds expression evaluation coverage for safe vs unsafe static access and constant/enum constant handling.
tracer/test/Datadog.Trace.Tests/Debugger/ProbeExpressionsResources/Approvals/DebuggerExpressionLanguageTests.ToStringNotSupported.verified.txt Updates approval baseline to reflect filtered static field dumps.
tracer/test/Datadog.Trace.Tests/Debugger/ProbeExpressionsResources/Approvals/DebuggerExpressionLanguageTests.ParentStaticProtectedMember.verified.txt Updates approval baseline for skipped unsafe static member access (undefined + error).
tracer/test/Datadog.Trace.Tests/Debugger/ProbeExpressionsResources/Approvals/DebuggerExpressionLanguageTests.CustomArrayAtIndex.verified.txt Updates approval baseline to reflect filtered static field dumps.
tracer/test/Datadog.Trace.Tests/Debugger/ProbeExpressionsResources/Approvals/DebuggerExpressionLanguageTests.AccessNullableStructNotNull.verified.txt Updates approval baseline to reflect filtered static field dumps.
tracer/test/Datadog.Trace.Tests/Debugger/ProbeExpressionsResources/Approvals/DebuggerExpressionLanguageTests.AccessNullableStruct.verified.txt Updates approval baseline to reflect filtered static field dumps.
tracer/test/Datadog.Trace.Debugger.IntegrationTests/Approvals/snapshots/ProbeTests.StaticType.verified.txt Updates integration approval baseline for removal of unsafe static captures.
tracer/test/Datadog.Trace.Debugger.IntegrationTests/Approvals/snapshots/ProbeTests.AsyncStaticType.verified.txt Updates integration approval baseline for removal of unsafe static captures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tracer/src/Datadog.Trace/Debugger/Helpers/StaticMemberSafety.cs
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 7dad44a40b

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

@pr-commenter

pr-commenter Bot commented Jun 22, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-25 11:28:46

Comparing candidate commit 5eaf36e in PR branch dudik/debugger-static-member-capture-safety with baseline commit e6d7b7f in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 60 known flaky benchmarks, 66 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 [-7136.176op/s; -6483.007op/s] or [-8.461%; -7.687%]

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

  • 🟥 throughput [-7600.885op/s; -6255.333op/s] or [-7.728%; -6.360%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+297.370ms; +298.910ms] or [+147.565%; +148.330%]
  • 🟥 throughput [-45.248op/s; -41.647op/s] or [-8.141%; -7.493%]

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

  • 🟥 execution_time [+383.155ms; +384.950ms] or [+302.716%; +304.134%]
  • 🟩 throughput [+86.099op/s; +89.092op/s] or [+11.352%; +11.746%]

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

  • 🟥 execution_time [+389.032ms; +390.575ms] or [+344.278%; +345.644%]

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%]

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 [-275562.550op/s; -271311.223op/s] or [-28.136%; -27.702%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.557%; +38.566%]
  • 🟩 execution_time [-26.297ms; -20.160ms] or [-11.727%; -8.990%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.288%; +105.304%]
  • 🟥 throughput [-152333.925op/s; -136229.425op/s] or [-21.887%; -19.574%]

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

  • 🟩 throughput [+8240.728op/s; +11176.353op/s] or [+5.243%; +7.111%]

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

  • 🟩 throughput [+9019.549op/s; +11657.264op/s] or [+7.185%; +9.287%]

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

  • 🟩 throughput [+406450.789op/s; +445951.982op/s] or [+13.553%; +14.870%]

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

  • 🟩 execution_time [-18.662ms; -14.329ms] or [-8.603%; -6.605%]

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

  • 🟥 execution_time [+300.538ms; +301.356ms] or [+150.168%; +150.577%]

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

  • 🟥 execution_time [+299.978ms; +303.483ms] or [+151.280%; +153.047%]
  • 🟩 throughput [+662.021op/s; +874.940op/s] or [+5.063%; +6.692%]

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

  • 🟥 execution_time [+299.691ms; +302.178ms] or [+150.961%; +152.214%]

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

  • 🟥 execution_time [+297.120ms; +298.540ms] or [+145.934%; +146.631%]

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

  • 🟥 execution_time [+296.245ms; +298.589ms] or [+144.823%; +145.969%]

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

  • 🟥 execution_time [+301.684ms; +303.506ms] or [+150.781%; +151.692%]

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

  • 🟥 execution_time [+22.378µs; +45.951µs] or [+7.144%; +14.670%]
  • 🟥 throughput [-428.368op/s; -229.975op/s] or [-13.353%; -7.169%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.936ms; +301.097ms] or [+149.699%; +150.278%]

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

  • 🟥 execution_time [+414.810ms; +422.359ms] or [+450.708%; +458.910%]
  • 🟩 throughput [+670.295op/s; +845.982op/s] or [+5.508%; +6.952%]

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

  • unstable execution_time [+298.012ms; +348.219ms] or [+226.277%; +264.400%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+299.818ms; +339.590ms] or [+137.853%; +156.140%]
  • 🟥 throughput [-534.450op/s; -483.072op/s] or [-48.426%; -43.771%]

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

  • unstable execution_time [+144.194ms; +289.847ms] or [+61.449%; +123.521%]
  • 🟥 throughput [-670.695op/s; -587.124op/s] or [-44.736%; -39.161%]

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

  • 🟥 execution_time [+344.401ms; +355.596ms] or [+205.992%; +212.688%]
  • 🟥 throughput [-409.486op/s; -369.570op/s] or [-28.512%; -25.733%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.762ms; +303.913ms] or [+151.961%; +153.045%]

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

  • 🟥 execution_time [+301.535ms; +303.428ms] or [+151.100%; +152.049%]

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

  • 🟥 execution_time [+302.714ms; +306.096ms] or [+152.071%; +153.769%]
  • 🟩 throughput [+25654.979op/s; +33372.942op/s] or [+5.404%; +7.030%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+303.977ms; +306.520ms] or [+152.647%; +153.924%]

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

  • 🟥 execution_time [+301.810ms; +305.168ms] or [+149.232%; +150.892%]

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

  • 🟥 execution_time [+301.288ms; +305.040ms] or [+152.706%; +154.608%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+302.430ms; +305.292ms] or [+151.793%; +153.229%]

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

  • 🟥 execution_time [+301.520ms; +304.207ms] or [+150.280%; +151.619%]
  • 🟩 throughput [+39920.068op/s; +46397.482op/s] or [+7.927%; +9.213%]

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

  • 🟥 execution_time [+301.975ms; +304.718ms] or [+150.230%; +151.595%]

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

  • unstable execution_time [-17.484ms; +4.098ms] or [-8.130%; +1.906%]

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

  • unstable execution_time [+9.002µs; +53.864µs] or [+2.224%; +13.305%]

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

  • 🟩 allocated_mem [-20.368KB; -20.344KB] or [-7.430%; -7.421%]
  • unstable execution_time [+9.102µs; +128.268µs] or [+1.799%; +25.352%]
  • unstable throughput [-262.124op/s; +42.594op/s] or [-13.080%; +2.125%]

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

  • unstable execution_time [-60.397µs; +0.848µs] or [-10.466%; +0.147%]

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

  • unstable execution_time [+6.879µs; +11.960µs] or [+16.259%; +28.270%]
  • 🟥 throughput [-5151.999op/s; -3232.952op/s] or [-21.688%; -13.610%]

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

  • unstable execution_time [-13.641µs; -4.921µs] or [-21.163%; -7.635%]
  • unstable throughput [+1348.642op/s; +3204.453op/s] or [+8.274%; +19.660%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.784ms; +305.193ms] or [+153.549%; +154.261%]

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

  • 🟥 execution_time [+303.099ms; +305.547ms] or [+154.277%; +155.522%]

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

  • 🟥 execution_time [+300.989ms; +304.168ms] or [+150.682%; +152.274%]

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

  • 🟩 throughput [+29387.236op/s; +33672.637op/s] or [+5.562%; +6.374%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+298.487ms; +300.679ms] or [+148.769%; +149.861%]

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

  • 🟥 execution_time [+301.367ms; +302.710ms] or [+151.332%; +152.007%]
  • 🟩 throughput [+13556.910op/s; +15451.986op/s] or [+5.896%; +6.720%]

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

  • 🟥 execution_time [+301.514ms; +304.214ms] or [+152.908%; +154.278%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.885ms; +301.316ms] or [+149.584%; +150.298%]
  • 🟩 throughput [+66059320.381op/s; +66423009.711op/s] or [+48.108%; +48.373%]

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

  • 🟥 execution_time [+421.123ms; +424.598ms] or [+523.741%; +528.064%]

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

  • 🟥 execution_time [+299.437ms; +300.646ms] or [+149.352%; +149.955%]
  • 🟩 throughput [+18180803.167op/s; +19172379.385op/s] or [+8.053%; +8.492%]

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

  • 🟩 throughput [+89522.713op/s; +101757.237op/s] or [+8.358%; +9.501%]

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

  • 🟩 throughput [+56262.967op/s; +75766.468op/s] or [+6.512%; +8.770%]

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

  • 🟩 throughput [+92896.175op/s; +123933.651op/s] or [+7.190%; +9.593%]

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

  • 🟩 throughput [+90465.561op/s; +99595.300op/s] or [+8.985%; +9.891%]

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

  • 🟩 throughput [+43561.320op/s; +53256.693op/s] or [+7.910%; +9.670%]

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

  • 🟩 throughput [+28948.841op/s; +38610.401op/s] or [+6.480%; +8.642%]

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

  • 🟩 throughput [+77592.504op/s; +95348.797op/s] or [+8.669%; +10.653%]

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.ObjectExtractorMoreComplexBody net472
  • 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.OptimizedCharSlice netcoreapp3.1
  • 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 net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • 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.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • 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 Jun 22, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

⚠️ Potential regressions detected

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration70.52 ± (70.52 - 70.93) ms78.48 ± (78.50 - 79.24) ms+11.3%❌⬆️
Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration70.52 ± (70.52 - 70.93) ms78.48 ± (78.50 - 79.24) ms+11.3%❌⬆️
.NET Framework 4.8 - Bailout
duration77.32 ± (77.19 - 77.64) ms81.85 ± (81.54 - 82.07) ms+5.9%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1078.34 ± (1077.97 - 1083.89) ms1081.66 ± (1093.10 - 1107.58) ms+0.3%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.16 ± (22.12 - 22.20) ms22.35 ± (22.31 - 22.40) ms+0.9%✅⬆️
process.time_to_main_ms81.70 ± (81.43 - 81.97) ms82.55 ± (82.27 - 82.84) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.95 ± (10.95 - 10.95) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.21 ± (22.18 - 22.24) ms22.24 ± (22.20 - 22.27) ms+0.1%✅⬆️
process.time_to_main_ms83.47 ± (83.25 - 83.68) ms83.62 ± (83.42 - 83.83) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.97) MB10.98 ± (10.97 - 10.98) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms208.18 ± (207.20 - 209.17) ms210.33 ± (209.49 - 211.16) ms+1.0%✅⬆️
process.time_to_main_ms527.87 ± (526.80 - 528.95) ms527.89 ± (526.68 - 529.10) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.67 ± (48.63 - 48.71) MB48.68 ± (48.63 - 48.73) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.08 ± (21.04 - 21.12) ms21.15 ± (21.10 - 21.20) ms+0.3%✅⬆️
process.time_to_main_ms71.37 ± (71.15 - 71.59) ms72.82 ± (72.56 - 73.08) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.62) MB10.65 ± (10.65 - 10.65) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.68 ± (20.65 - 20.71) ms20.82 ± (20.79 - 20.84) ms+0.7%✅⬆️
process.time_to_main_ms70.93 ± (70.83 - 71.03) ms71.71 ± (71.57 - 71.85) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.72 - 10.73) MB10.76 ± (10.75 - 10.76) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms370.66 ± (368.47 - 372.85) ms371.18 ± (368.81 - 373.54) ms+0.1%✅⬆️
process.time_to_main_ms533.42 ± (532.22 - 534.61) ms536.85 ± (535.56 - 538.13) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.16 ± (50.14 - 50.19) MB50.16 ± (50.14 - 50.18) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 8 - Baseline
process.internal_duration_ms19.09 ± (19.06 - 19.11) ms19.01 ± (18.98 - 19.03) ms-0.4%
process.time_to_main_ms69.33 ± (69.19 - 69.48) ms68.69 ± (68.57 - 68.81) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.67) MB7.67 ± (7.67 - 7.68) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.28 ± (19.22 - 19.34) ms19.22 ± (19.17 - 19.26) ms-0.3%
process.time_to_main_ms72.96 ± (72.65 - 73.27) ms72.06 ± (71.82 - 72.30) ms-1.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.70 - 7.71) MB7.74 ± (7.73 - 7.74) MB+0.4%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms296.66 ± (294.16 - 299.17) ms299.95 ± (297.58 - 302.33) ms+1.1%✅⬆️
process.time_to_main_ms484.31 ± (483.33 - 485.29) ms483.02 ± (482.07 - 483.98) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.13 ± (37.10 - 37.16) MB37.16 ± (37.13 - 37.19) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.3%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration204.27 ± (204.12 - 205.09) ms202.59 ± (202.34 - 203.35) ms-0.8%
.NET Framework 4.8 - Bailout
duration208.62 ± (208.46 - 209.02) ms207.08 ± (206.64 - 207.31) ms-0.7%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1208.71 ± (1208.11 - 1214.13) ms1208.31 ± (1208.03 - 1213.77) ms-0.0%
.NET Core 3.1 - Baseline
process.internal_duration_ms196.21 ± (195.76 - 196.66) ms196.86 ± (196.49 - 197.24) ms+0.3%✅⬆️
process.time_to_main_ms85.08 ± (84.79 - 85.37) ms85.80 ± (85.53 - 86.07) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed15.96 ± (15.94 - 15.98) MB16.02 ± (16.00 - 16.05) MB+0.4%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+1.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms195.70 ± (195.31 - 196.09) ms196.24 ± (195.82 - 196.66) ms+0.3%✅⬆️
process.time_to_main_ms86.36 ± (86.07 - 86.65) ms86.68 ± (86.43 - 86.92) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.05 ± (16.03 - 16.08) MB16.09 ± (16.07 - 16.12) MB+0.3%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-1.2%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms392.42 ± (391.01 - 393.84) ms390.44 ± (388.94 - 391.94) ms-0.5%
process.time_to_main_ms545.48 ± (543.95 - 547.01) ms543.33 ± (542.27 - 544.39) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.54 ± (58.31 - 58.76) MB58.68 ± (58.45 - 58.90) MB+0.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.2%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms201.78 ± (201.31 - 202.26) ms202.21 ± (201.80 - 202.63) ms+0.2%✅⬆️
process.time_to_main_ms74.34 ± (74.10 - 74.58) ms74.78 ± (74.52 - 75.05) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.32 ± (16.30 - 16.35) MB16.33 ± (16.30 - 16.36) MB+0.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms199.46 ± (199.03 - 199.90) ms201.47 ± (201.09 - 201.85) ms+1.0%✅⬆️
process.time_to_main_ms74.44 ± (74.22 - 74.65) ms75.32 ± (75.16 - 75.49) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.40 ± (16.37 - 16.43) MB16.42 ± (16.39 - 16.44) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.6%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms586.73 ± (584.26 - 589.20) ms585.14 ± (583.00 - 587.27) ms-0.3%
process.time_to_main_ms556.27 ± (555.09 - 557.45) ms555.90 ± (554.64 - 557.16) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.51 ± (61.41 - 61.61) MB61.23 ± (61.15 - 61.30) MB-0.5%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms199.56 ± (199.11 - 200.02) ms198.73 ± (198.35 - 199.11) ms-0.4%
process.time_to_main_ms73.86 ± (73.55 - 74.16) ms73.53 ± (73.25 - 73.81) ms-0.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.74 - 11.79) MB11.67 ± (11.65 - 11.69) MB-0.8%
runtime.dotnet.threads.count19 ± (18 - 19)18 ± (18 - 18)-1.0%
.NET 8 - Bailout
process.internal_duration_ms198.26 ± (197.93 - 198.59) ms197.05 ± (196.74 - 197.37) ms-0.6%
process.time_to_main_ms74.65 ± (74.48 - 74.82) ms73.93 ± (73.76 - 74.09) ms-1.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.79 - 11.83) MB11.77 ± (11.75 - 11.79) MB-0.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms512.05 ± (509.23 - 514.86) ms514.69 ± (511.54 - 517.83) ms+0.5%✅⬆️
process.time_to_main_ms503.01 ± (502.07 - 503.94) ms502.69 ± (501.81 - 503.56) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.85 ± (50.81 - 50.90) MB50.97 ± (50.93 - 51.00) MB+0.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (29 - 30)-1.1%
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 (8814) - mean (79ms)  : 73, 84
    master - mean (71ms)  : 68, 74

    section Bailout
    This PR (8814) - mean (82ms)  : 78, 86
    master - mean (77ms)  : 74, 81

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (1,100ms)  : 996, 1205
    master - mean (1,081ms)  : 1038, 1124

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 (8814) - mean (112ms)  : 106, 118
    master - mean (111ms)  : 105, 116

    section Bailout
    This PR (8814) - mean (113ms)  : 108, 119
    master - mean (113ms)  : 108, 118

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (775ms)  : 755, 796
    master - mean (773ms)  : 752, 794

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

    section Bailout
    This PR (8814) - mean (99ms)  : 95, 102
    master - mean (98ms)  : 96, 99

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (938ms)  : 901, 975
    master - mean (937ms)  : 898, 976

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

    section Bailout
    This PR (8814) - mean (99ms)  : 93, 105
    master - mean (100ms)  : 95, 105

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (813ms)  : 774, 851
    master - mean (811ms)  : 776, 845

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 (8814) - mean (203ms)  : 197, 209
    master - mean (205ms)  : 199, 210

    section Bailout
    This PR (8814) - mean (207ms)  : 204, 210
    master - mean (209ms)  : 206, 211

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (1,211ms)  : 1170, 1252
    master - mean (1,211ms)  : 1167, 1256

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 (8814) - mean (292ms)  : 286, 298
    master - mean (292ms)  : 285, 298

    section Bailout
    This PR (8814) - mean (292ms)  : 287, 298
    master - mean (292ms)  : 287, 297

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (974ms)  : 948, 999
    master - mean (981ms)  : 956, 1006

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8814) - mean (287ms)  : 281, 292
    master - mean (286ms)  : 279, 293

    section Bailout
    This PR (8814) - mean (286ms)  : 282, 290
    master - mean (283ms)  : 277, 290

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (1,172ms)  : 1139, 1204
    master - mean (1,174ms)  : 1131, 1217

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8814) - mean (283ms)  : 276, 289
    master - mean (284ms)  : 277, 290

    section Bailout
    This PR (8814) - mean (281ms)  : 277, 285
    master - mean (283ms)  : 279, 287

    section CallTarget+Inlining+NGEN
    This PR (8814) - mean (1,049ms)  : 993, 1105
    master - mean (1,047ms)  : 1003, 1091

Loading

@dudikeleti
dudikeleti force-pushed the dudik/debugger-static-member-capture-safety branch 2 times, most recently from c4e441b to 3171ba7 Compare June 23, 2026 09:46
@datadog-prod-us1-3

This comment has been minimized.

@dudikeleti
dudikeleti force-pushed the dudik/debugger-static-member-capture-safety branch from 3171ba7 to 5eaf36e Compare June 25, 2026 10:36
@dudikeleti
dudikeleti merged commit 04f43ce into master Jun 26, 2026
143 checks passed
@dudikeleti
dudikeleti deleted the dudik/debugger-static-member-capture-safety branch June 26, 2026 11:20
@github-actions github-actions Bot added this to the vNext-v3 milestone Jun 26, 2026
dudikeleti added a commit that referenced this pull request Jul 1, 2026
## Summary of changes
- Add a single debugger safety boundaries guide covering
reflection/type-loading risks and customer-code execution policy.
- Make the safety guide visible from `AGENTS.md` so future agents and
reviewers check it before changing debugger safety-sensitive paths.
- Add focused snapshot tests for the current policy around default
object getters, selected exception properties, and supported collection
enumeration.

## Reason for change
Define safety boundaries for debugger code running inside customer
processes. Keeping the reflection audit, customer-code execution policy,
and agent-facing guidance in one document gives reviewers one place to
evaluate the current contract and the representative tests that lock it
in.

## Implementation details
This branch intentionally does not change capture behavior. The tests
document that default object capture reads backing fields without
invoking arbitrary getters, exception capture reads selected
`System.Exception` properties, and supported collection serialization
reads `Count` and enumerates under existing limits. The merged safety
guide classifies related debugger reflection paths and defines when code
may invoke getters, enumerators, exception overrides, attributes, or
`ToString()`.

## Test coverage
- `DebuggerSnapshotCreatorTests.Policy_`
- `DebuggerSnapshotCreatorTests`

Related follow-up PRs:
- #8814: static member capture guard
- #8815: metadata-only Exception Replay IL call scanning
- #8816: metadata-only state-machine attribute checks

---------

Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants