Skip telemetry for span sampling rules#8161
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 544c369b90
ℹ️ 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".
| catch (Exception e) | ||
| { | ||
| Log.Error(e, "Unable to parse the span sampling rules."); | ||
| Log.ErrorSkipTelemetry(e, "Unable to parse the span sampling rules."); | ||
| } |
There was a problem hiding this comment.
Keep telemetry for unexpected parsing failures
The new ErrorSkipTelemetry call suppresses telemetry for all exceptions thrown while parsing span sampling rules, not just user input errors. The catch covers the entire parse path, so it will also catch unexpected bugs (e.g., null refs, regex failures, or internal logic errors). The repo’s logging guidelines in AGENTS.md say ErrorSkipTelemetry should be limited to expected environmental/transient errors and should not be used for outer catch blocks that would only catch unexpected exceptions. This change can hide real tracer bugs from telemetry, making production regressions harder to detect. Consider using Log.Error for unexpected exceptions and optionally narrowing the skip to known user-format errors.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Hmmm, that's fair, and we could consider explicitly catching JsonReaderException for example, but basically null values and invalid globs etc are Still all user controlled, so I don't think there's much we can or should consider reporting here.
BenchmarksBenchmark execution time: 2026-02-05 10:25:09 Comparing candidate commit 544c369 in PR branch Found 13 performance improvements and 7 performance regressions! Performance is the same for 159 metrics, 13 unstable metrics. scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0
scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0
scenario:Benchmarks.Trace.NLogBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8161) 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 (8161) - mean (68ms) : 67, 70
master - mean (68ms) : 67, 70
section Bailout
This PR (8161) - mean (72ms) : 71, 73
master - mean (72ms) : 71, 73
section CallTarget+Inlining+NGEN
This PR (8161) - mean (1,034ms) : 968, 1099
master - mean (1,040ms) : 978, 1102
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 (8161) - mean (115ms) : 112, 117
master - mean (115ms) : 112, 118
section Bailout
This PR (8161) - mean (115ms) : 114, 117
master - mean (116ms) : 114, 118
section CallTarget+Inlining+NGEN
This PR (8161) - mean (796ms) : 742, 851
master - mean (799ms) : 743, 855
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8161) - mean (100ms) : 98, 103
master - mean (101ms) : 98, 104
section Bailout
This PR (8161) - mean (101ms) : 100, 102
master - mean (102ms) : 101, 103
section CallTarget+Inlining+NGEN
This PR (8161) - mean (770ms) : 748, 793
master - mean (771ms) : 751, 792
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8161) - mean (99ms) : 97, 102
master - mean (100ms) : 98, 102
section Bailout
This PR (8161) - mean (101ms) : 99, 102
master - mean (101ms) : 100, 102
section CallTarget+Inlining+NGEN
This PR (8161) - mean (684ms) : 665, 703
master - mean (683ms) : 663, 703
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 (8161) - mean (197ms) : 192, 201
master - mean (199ms) : 194, 204
section Bailout
This PR (8161) - mean (200ms) : 197, 202
master - mean (203ms) : 198, 208
section CallTarget+Inlining+NGEN
This PR (8161) - mean (1,155ms) : 1109, 1201
master - mean (1,164ms) : 1109, 1219
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 (8161) - mean (295ms) : 289, 301
master - mean (296ms) : 289, 302
section Bailout
This PR (8161) - mean (296ms) : 290, 302
master - mean (295ms) : 290, 300
section CallTarget+Inlining+NGEN
This PR (8161) - mean (1,007ms) : 964, 1050
master - mean (996ms) : 935, 1057
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8161) - mean (288ms) : 280, 295
master - mean (288ms) : 278, 299
section Bailout
This PR (8161) - mean (288ms) : 280, 297
master - mean (287ms) : 281, 293
section CallTarget+Inlining+NGEN
This PR (8161) - mean (995ms) : 956, 1034
master - mean (990ms) : 945, 1035
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8161) - mean (287ms) : 277, 296
master - mean (288ms) : 279, 297
section Bailout
This PR (8161) - mean (285ms) : 281, 290
master - mean (286ms) : 281, 291
section CallTarget+Inlining+NGEN
This PR (8161) - mean (886ms) : 857, 914
master - mean (887ms) : 861, 913
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
Skip sending errors in span sampling rules to telemetry
Reason for change
These rules come from user input, so can easily be wrong, and there's no action on our part
Implementation details
Error=>ErrorSkipTelemetryTest coverage
N/A
Other details
Error tracking