Skip to content

[Dynamic Instrumentation] DEBUG-2387 Sample evaluation error snapshots#8515

Merged
dudikeleti merged 2 commits into
masterfrom
dudik/el/sample-el-errors
Apr 28, 2026
Merged

[Dynamic Instrumentation] DEBUG-2387 Sample evaluation error snapshots#8515
dudikeleti merged 2 commits into
masterfrom
dudik/el/sample-el-errors

Conversation

@dudikeleti

Copy link
Copy Markdown
Contributor

Summary of changes

  • Make Dynamic Instrumentation evaluation-error snapshots honor the same per-probe sampling path as normal condition-matched snapshots.
  • Populate debugger snapshot message from the first evaluation error when expression evaluation fails.
  • Add focused debugger unit tests covering sampled vs dropped evaluation-error snapshots.
  • Add a snapshot creator test verifying the emitted message is derived from the first evaluation error.

Reason for change

  • Align .NET debugger behavior with Java so evaluation errors are surfaced through normal snapshot output without bypassing rate limiting.
  • Ensure snapshots generated from evaluation failures have a useful message for customers and reviewers.

Test coverage

  • ProbeProcessorTests.ConditionEvaluationErrorsAreDroppedWhenSamplerRejects|ProbeProcessorTests.ConditionEvaluationErrorsAreCapturedWhenSamplerKeeps|DebuggerSnapshotCreatorTests.Message_UsesFirstEvaluationError

@dudikeleti
dudikeleti requested a review from a team as a code owner April 23, 2026 18:08

@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: 3e71944f06

ℹ️ 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 on lines +383 to +385
if (ProbeInfo.HasCondition && !sampler.Sample())
{
shouldStopCapture = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route caught evaluation errors through sampler

For conditional probes where GetOrCreateEvaluator().Evaluate(...) itself throws, the catch above converts the exception into evaluationResult.Errors and returns immediately, so execution never reaches this new sampler check. Those evaluation-error snapshots still bypass rate limiting on every invocation; route the catch-created result through the same HasError sampling path before returning.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pr-commenter

pr-commenter Bot commented Apr 23, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-28 13:07:51

Comparing candidate commit ddd8261 in PR branch dudik/el/sample-el-errors with baseline commit 37b6bcd in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 60 known flaky benchmarks, 27 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 net6.0

  • 🟩 throughput [+8553.678op/s; +10778.047op/s] or [+7.190%; +9.059%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+308.696ms; +314.518ms] or [+153.186%; +156.075%]
  • 🟥 throughput [-43.126op/s; -39.548op/s] or [-7.759%; -7.115%]

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

  • 🟥 execution_time [+378.155ms; +381.922ms] or [+298.766%; +301.742%]
  • 🟩 throughput [+95.609op/s; +99.551op/s] or [+12.606%; +13.125%]

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

  • 🟥 execution_time [+395.463ms; +397.363ms] or [+349.969%; +351.651%]

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

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.620ms; -11.454ms] or [-7.295%; -5.349%]

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

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

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

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-266988.807op/s; -263768.871op/s] or [-27.261%; -26.932%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-25.596ms; -20.754ms] or [-11.415%; -9.255%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-141666.931op/s; -125490.275op/s] or [-20.355%; -18.031%]

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

  • 🟩 throughput [+8662.326op/s; +11637.658op/s] or [+5.512%; +7.405%]

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

  • 🟩 throughput [+6447.878op/s; +9104.687op/s] or [+5.137%; +7.253%]

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

  • 🟩 throughput [+383432.556op/s; +415087.227op/s] or [+12.785%; +13.841%]

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

  • 🟩 execution_time [-18.537ms; -14.171ms] or [-8.545%; -6.532%]
  • 🟩 throughput [+166938.168op/s; +222287.694op/s] or [+6.626%; +8.823%]

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

  • 🟥 execution_time [+299.307ms; +300.008ms] or [+149.553%; +149.904%]

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

  • 🟥 execution_time [+300.117ms; +303.600ms] or [+151.350%; +153.106%]

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

  • 🟥 execution_time [+299.901ms; +302.279ms] or [+151.067%; +152.265%]

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

  • 🟥 execution_time [+296.474ms; +297.372ms] or [+145.617%; +146.058%]

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

  • 🟥 execution_time [+297.249ms; +299.722ms] or [+145.314%; +146.523%]

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

  • 🟥 execution_time [+300.091ms; +301.322ms] or [+149.985%; +150.600%]

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

  • 🟥 execution_time [+21.976µs; +45.602µs] or [+7.016%; +14.558%]
  • 🟥 throughput [-424.861op/s; -226.085op/s] or [-13.244%; -7.048%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.895ms; +300.516ms] or [+149.678%; +149.989%]

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

  • unstable execution_time [+395.197ms; +412.839ms] or [+429.398%; +448.566%]
  • 🟩 throughput [+1108.342op/s; +1259.349op/s] or [+9.107%; +10.348%]

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

  • unstable execution_time [+213.770ms; +259.601ms] or [+162.313%; +197.112%]
  • 🟩 throughput [+643.928op/s; +847.650op/s] or [+6.234%; +8.206%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+306.157ms; +343.305ms] or [+140.768%; +157.848%]
  • 🟥 throughput [-511.527op/s; -476.218op/s] or [-46.349%; -43.150%]

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

  • unstable execution_time [+177.694ms; +314.651ms] or [+75.726%; +134.091%]
  • 🟥 throughput [-666.033op/s; -582.608op/s] or [-44.425%; -38.860%]

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

  • 🟥 execution_time [+336.350ms; +345.568ms] or [+201.177%; +206.690%]
  • 🟥 throughput [-401.186op/s; -365.136op/s] or [-27.934%; -25.424%]

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

  • 🟩 execution_time [-146.403µs; -120.875µs] or [-7.416%; -6.123%]
  • 🟩 throughput [+34.039op/s; +40.699op/s] or [+6.720%; +8.034%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+301.849ms; +303.246ms] or [+152.005%; +152.709%]

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

  • 🟥 execution_time [+301.630ms; +302.856ms] or [+151.147%; +151.762%]

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

  • 🟥 execution_time [+301.566ms; +304.590ms] or [+151.494%; +153.013%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.429ms; +303.074ms] or [+151.368%; +152.194%]

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

  • 🟥 execution_time [+298.221ms; +300.512ms] or [+147.457%; +148.590%]

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

  • 🟥 execution_time [+302.952ms; +307.158ms] or [+153.549%; +155.681%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.868ms; +301.079ms] or [+150.507%; +151.115%]

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

  • 🟥 execution_time [+299.413ms; +301.642ms] or [+149.230%; +150.341%]
  • 🟩 throughput [+41071.488op/s; +48172.194op/s] or [+8.155%; +9.565%]

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

  • 🟥 execution_time [+299.378ms; +301.733ms] or [+148.938%; +150.110%]

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

  • 🟩 execution_time [-16.210ms; -12.511ms] or [-7.538%; -5.818%]

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

  • unstable execution_time [+7.746µs; +48.497µs] or [+1.913%; +11.979%]

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

  • 🟩 allocated_mem [-25.765KB; -25.745KB] or [-9.398%; -9.391%]
  • unstable execution_time [-51.924µs; -0.171µs] or [-10.263%; -0.034%]

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

  • unstable execution_time [-53.065µs; +5.094µs] or [-9.196%; +0.883%]

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

  • 🟥 execution_time [+5.899µs; +9.633µs] or [+13.945%; +22.770%]
  • 🟥 throughput [-4530.917op/s; -2812.340op/s] or [-19.074%; -11.839%]

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

  • unstable execution_time [-14.256µs; -6.904µs] or [-22.118%; -10.711%]
  • 🟩 throughput [+1855.065op/s; +3409.462op/s] or [+11.381%; +20.918%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+303.869ms; +305.327ms] or [+153.592%; +154.329%]

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

  • 🟥 execution_time [+301.930ms; +304.261ms] or [+153.681%; +154.868%]

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

  • 🟥 execution_time [+300.220ms; +302.243ms] or [+150.297%; +151.310%]

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

  • 🟩 throughput [+28626.196op/s; +34302.629op/s] or [+5.418%; +6.493%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.493ms; +303.339ms] or [+150.267%; +151.187%]

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

  • 🟥 execution_time [+302.030ms; +303.527ms] or [+151.665%; +152.417%]

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

  • 🟥 execution_time [+303.151ms; +305.600ms] or [+153.739%; +154.981%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.683ms; +300.327ms] or [+149.484%; +149.805%]
  • 🟩 throughput [+61435828.482op/s; +61708972.339op/s] or [+44.741%; +44.940%]

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

  • unstable execution_time [+306.716ms; +361.022ms] or [+381.455%; +448.995%]
  • 🟩 throughput [+1040.027op/s; +1237.407op/s] or [+8.040%; +9.566%]

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

  • 🟥 execution_time [+299.271ms; +300.232ms] or [+149.269%; +149.749%]

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

  • 🟩 throughput [+72313.485op/s; +85232.239op/s] or [+6.752%; +7.958%]

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

  • 🟩 throughput [+59667.054op/s; +78869.592op/s] or [+6.906%; +9.129%]

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

  • 🟩 throughput [+86908.669op/s; +117075.582op/s] or [+6.727%; +9.062%]

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

  • 🟩 throughput [+88332.655op/s; +95941.513op/s] or [+8.773%; +9.529%]

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

  • 🟩 throughput [+39857.243op/s; +45129.022op/s] or [+7.237%; +8.195%]

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

  • 🟩 throughput [+26658.314op/s; +36270.937op/s] or [+5.967%; +8.119%]

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

  • 🟩 throughput [+76226.885op/s; +94808.256op/s] or [+8.516%; +10.592%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • 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 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

@tylfin tylfin left a comment

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.

🙌 thanks for addressing this one

@dudikeleti
dudikeleti force-pushed the dudik/el/sample-el-errors branch from 3e71944 to ddd8261 Compare April 28, 2026 11:59
@dudikeleti
dudikeleti merged commit f8b64bf into master Apr 28, 2026
141 of 143 checks passed
@dudikeleti
dudikeleti deleted the dudik/el/sample-el-errors branch April 28, 2026 19:24
@github-actions github-actions Bot added this to the vNext-v3 milestone Apr 28, 2026
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.

2 participants