[Dynamic Instrumentation] Rate limit condition evaluation error snapshots#8725
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Dynamic Instrumentation’s probe processing so that condition evaluation errors emit diagnostic snapshots that bypass normal per-probe/global sampling, while being rate-limited to once per probe per 5 minutes to avoid flooding.
Changes:
- Added a dedicated 5-minute, per-probe rate limiter for condition evaluation-error snapshots (Stopwatch timestamp + Interlocked gate).
- Modified condition error handling so evaluation-error snapshots bypass the normal sampler/global limiter path.
- Updated and expanded
ProbeProcessorTeststo reflect sampler bypass and to cover rate limiting + probe updates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tracer/src/Datadog.Trace/Debugger/Expressions/ProbeProcessor.cs | Adds eval-error rate limiting and reroutes conditional eval-error handling to bypass standard sampling/limiting. |
| tracer/test/Datadog.Trace.Tests/Debugger/ProbeProcessorTests.cs | Updates existing assertions for sampler bypass and adds tests for eval-error rate limiting and probe updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
BenchmarksBenchmark execution time: 2026-06-02 15:55:39 Comparing candidate commit 71e1fcd in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 59 known flaky benchmarks, 67 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8725) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-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:
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 chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8725) - mean (75ms) : 70, 81
master - mean (74ms) : 70, 78
section Bailout
This PR (8725) - mean (79ms) : 76, 83
master - mean (77ms) : 75, 80
section CallTarget+Inlining+NGEN
This PR (8725) - mean (1,116ms) : 1052, 1181
master - mean (1,114ms) : 1056, 1172
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 (8725) - mean (118ms) : 111, 125
master - mean (115ms) : 110, 121
section Bailout
This PR (8725) - mean (115ms) : 112, 118
master - mean (116ms) : 113, 119
section CallTarget+Inlining+NGEN
This PR (8725) - mean (797ms) : 770, 823
master - mean (794ms) : 765, 823
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8725) - mean (102ms) : 98, 106
master - mean (104ms) : 97, 111
section Bailout
This PR (8725) - mean (104ms) : 100, 108
master - mean (105ms) : 101, 109
section CallTarget+Inlining+NGEN
This PR (8725) - mean (952ms) : 919, 985
master - mean (949ms) : 908, 990
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8725) - mean (104ms) : 98, 109
master - mean (100ms) : 96, 103
section Bailout
This PR (8725) - mean (101ms) : 98, 104
master - mean (104ms) : 98, 111
section CallTarget+Inlining+NGEN
This PR (8725) - mean (828ms) : 795, 860
master - mean (822ms) : 789, 856
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 (8725) - mean (200ms) : 194, 206
master - mean (199ms) : 192, 206
section Bailout
This PR (8725) - mean (204ms) : 201, 206
master - mean (203ms) : 198, 207
section CallTarget+Inlining+NGEN
This PR (8725) - mean (1,201ms) : 1158, 1244
master - mean (1,193ms) : 1151, 1235
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 (8725) - mean (286ms) : 279, 293
master - mean (286ms) : 279, 292
section Bailout
This PR (8725) - mean (287ms) : 281, 293
master - mean (286ms) : 280, 292
section CallTarget+Inlining+NGEN
This PR (8725) - mean (958ms) : 939, 976
master - mean (958ms) : 936, 981
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8725) - mean (279ms) : 274, 284
master - mean (276ms) : 271, 282
section Bailout
This PR (8725) - mean (279ms) : 275, 283
master - mean (276ms) : 270, 281
section CallTarget+Inlining+NGEN
This PR (8725) - mean (1,155ms) : 1119, 1192
master - mean (1,153ms) : 1109, 1197
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8725) - mean (277ms) : 271, 283
master - mean (273ms) : 264, 281
section Bailout
This PR (8725) - mean (277ms) : 273, 282
master - mean (273ms) : 263, 284
section CallTarget+Inlining+NGEN
This PR (8725) - mean (1,034ms) : 992, 1076
master - mean (1,032ms) : 994, 1071
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
a3d2eae to
fedcbe3
Compare
| return false; | ||
| } | ||
|
|
||
| return Interlocked.CompareExchange(ref _lastEvaluationErrorSnapshotTimestamp, timestamp, lastTimestamp) == lastTimestamp; |
There was a problem hiding this comment.
I am not familiar with the probe lifcycle in dotnet, but here if the probe condition is changed do we have to wait 5 minutes to get a new eval error?
scenario:
- probe A created with a condition 1
- probe generate an eval error (NPE because in
a.b.cbis null) - user change the probe A with condition 2 (
d.e.f) - is the
_lastEvaluationerroSnapshotTimestampis reset or is the same than probe A condition 1?
There was a problem hiding this comment.
Thanks for pointing that out!
Fixed 71e1fcd
Summary of changes
Reason for change
Implementation details
Stopwatch.GetTimestamp()with an atomicInterlocked.CompareExchangegate.Test coverage
ProbeProcessorTests