Skip to content

Update /analyze-error and AGENTS.md#8152

Merged
bouwkast merged 3 commits into
masterfrom
steven/update-claude-comands
Feb 4, 2026
Merged

Update /analyze-error and AGENTS.md#8152
bouwkast merged 3 commits into
masterfrom
steven/update-claude-comands

Conversation

@bouwkast

@bouwkast bouwkast commented Feb 3, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Updates /analyze-error to not update all Log.Error calls in the to Log.ErrorSkipTelemetry as it did in #8133

Added some more generic logging considerations to AGENTS.md

Reason for change

The /analyze-error command was instructing to update all instances of Log.Error instead of just the correct / expected one.

AGENTS.md had some logging information but I think it lacked some specificity, so updating very basically with some "best practices"

Implementation details

Test coverage

Other details

I reran the /analyze-error command with these changes again on the same error I did with #8133 and with both of these it changed to this following diff. It isn't perfect but at least it isn't super wrong, it also changed the ToString used to a generic call. Note that the initial change was 5ab5b10

diff --git a/tracer/src/Datadog.Trace/OpenTelemetry/Metrics/OtlpExporter.cs
b/tracer/src/Datadog.Trace/OpenTelemetry/Metrics/OtlpExporter.cs
index e90bee808..8c2acd3c2 100644
--- a/tracer/src/Datadog.Trace/OpenTelemetry/Metrics/OtlpExporter.cs
+++ b/tracer/src/Datadog.Trace/OpenTelemetry/Metrics/OtlpExporter.cs
@@ -353,21 +353,27 @@ namespace Datadog.Trace.OpenTelemetry.Metrics
                 }
                 catch (TaskCanceledException) when (attempt < maxRetries)
                 {
+                    Log.Debug<int>("OTLP request timed out (attempt {Attempt}), retrying...", attempt + 1);
+                    retryDelay = TimeSpan.FromMilliseconds((long)(retryDelay.TotalMilliseconds * 2));
+                    await Task.Delay(retryDelay).ConfigureAwait(false);
+                }
+                catch (TaskCanceledException ex)
+                {
+                    // Final timeout after all retries exhausted
+                    Log.ErrorSkipTelemetry<Uri, int>(ex, "OTLP request to {Endpoint} timed out after {Attempt}
attempts. See https://docs.datadoghq.com/tracing/troubleshooting/ for troubleshooting.", _endpoint, attempt + 1);
+                    return false;
+                }
+                catch (Exception ex) when (attempt < maxRetries)
+                {
+                    Log.Debug<int>(ex, "Error sending OTLP request (attempt {Attempt}), retrying...", attempt + 1);
                     retryDelay = TimeSpan.FromMilliseconds((long)(retryDelay.TotalMilliseconds * 2));
                     await Task.Delay(retryDelay).ConfigureAwait(false);
                 }
                 catch (Exception ex)
                 {
-                    Log.Error(ex, "Error sending OTLP request (attempt {Attempt})", (attempt + 1).ToString());
-                    if (attempt < maxRetries)
-                    {
-                        retryDelay = TimeSpan.FromMilliseconds((long)(retryDelay.TotalMilliseconds * 2));
-                        await Task.Delay(retryDelay).ConfigureAwait(false);
-                    }
-                    else
-                    {
-                        return false;
-                    }
+                    // Final failure after all retries exhausted
+                    Log.ErrorSkipTelemetry<Uri, int>(ex, "Failed to send OTLP request to {Endpoint} after {Attempt}
attempts. See https://docs.datadoghq.com/tracing/troubleshooting/ for troubleshooting.", _endpoint, attempt + 1);
+                    return false;
                 }
             }

@bouwkast
bouwkast requested a review from a team as a code owner February 3, 2026 20:34
@pr-commenter

pr-commenter Bot commented Feb 3, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-02-04 14:06:23

Comparing candidate commit 297b279 in PR branch steven/update-claude-comands with baseline commit 4b0d645 in branch master.

Found 17 performance improvements and 13 performance regressions! Performance is the same for 151 metrics, 11 unstable metrics.

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

  • 🟩 execution_time [-18.031ms; -17.851ms] or [-14.900%; -14.751%]

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

  • 🟥 execution_time [+15.804ms; +22.115ms] or [+7.961%; +11.140%]

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

  • 🟥 execution_time [+14.975ms; +19.506ms] or [+7.453%; +9.708%]

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

  • 🟥 throughput [-624.075op/s; -615.720op/s] or [-6.836%; -6.744%]

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

  • 🟥 execution_time [+25.555ms; +25.902ms] or [+14.339%; +14.534%]

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

  • 🟥 execution_time [+20.571ms; +21.403ms] or [+11.350%; +11.809%]

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

  • 🟩 execution_time [-52.289µs; -33.522µs] or [-11.359%; -7.282%]
  • 🟩 throughput [+176.786op/s; +271.453op/s] or [+8.130%; +12.483%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+11.607ms; +17.036ms] or [+5.785%; +8.490%]
  • 🟥 throughput [-89.963op/s; -60.607op/s] or [-8.050%; -5.423%]

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

  • 🟥 throughput [-89.451op/s; -73.667op/s] or [-6.551%; -5.395%]
  • 🟩 execution_time [-60.565ms; -57.767ms] or [-24.609%; -23.472%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472

  • 🟩 execution_time [-128.653µs; -123.507µs] or [-6.337%; -6.084%]
  • 🟩 throughput [+31.961op/s; +33.267op/s] or [+6.489%; +6.754%]

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

  • 🟩 throughput [+34.947op/s; +37.262op/s] or [+5.170%; +5.513%]

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

  • 🟩 execution_time [-127.400µs; -121.347µs] or [-11.236%; -10.702%]
  • 🟩 throughput [+105.936op/s; +111.402op/s] or [+12.011%; +12.631%]

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

  • 🟥 execution_time [+10.467ms; +13.203ms] or [+5.287%; +6.669%]

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

  • 🟥 execution_time [+11.469ms; +13.516ms] or [+5.774%; +6.804%]

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

  • 🟩 execution_time [-15.799ms; -10.542ms] or [-7.523%; -5.020%]

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

  • 🟩 throughput [+1881.151op/s; +3856.728op/s] or [+9.069%; +18.592%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+12.468ms; +12.650ms] or [+6.630%; +6.727%]

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

  • 🟥 execution_time [+30.062ms; +31.219ms] or [+17.621%; +18.299%]

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

  • 🟥 throughput [-14596.727op/s; -13511.223op/s] or [-7.091%; -6.564%]

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

  • 🟩 execution_time [-92.118ms; -91.208ms] or [-49.145%; -48.659%]

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

  • 🟩 throughput [+18909233.433op/s; +20205461.014op/s] or [+8.413%; +8.990%]

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

  • 🟩 execution_time [-17.266ms; -11.754ms] or [-8.190%; -5.576%]

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

  • 🟩 throughput [+51565.443op/s; +81810.556op/s] or [+5.134%; +8.145%]

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

  • 🟩 execution_time [-21.817ms; -16.319ms] or [-10.034%; -7.506%]

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

  • 🟩 execution_time [-18.348ms; -13.184ms] or [-8.567%; -6.156%]

@lucaspimentel

Copy link
Copy Markdown
Member

@codex Hello, AI. Please review that changes made by another AI in a file used by AI to AI all the things.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

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

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

Nice, thanks

Comment thread .claude/commands/analyze-error.md Outdated
@bouwkast
bouwkast enabled auto-merge (squash) February 4, 2026 13:22
@bouwkast
bouwkast merged commit 6717993 into master Feb 4, 2026
98 of 101 checks passed
@bouwkast
bouwkast deleted the steven/update-claude-comands branch February 4, 2026 14:08
@github-actions github-actions Bot added this to the vNext-v3 milestone Feb 4, 2026
@lucaspimentel lucaspimentel added the for-ai-agents 🤖 files used by AI agents, not humans label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs for-ai-agents 🤖 files used by AI agents, not humans

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants