Skip to content

Skip OTLP exporter errors from being sent to telemetry#8133

Open
bouwkast wants to merge 4 commits intomasterfrom
steven/mute-otlp
Open

Skip OTLP exporter errors from being sent to telemetry#8133
bouwkast wants to merge 4 commits intomasterfrom
steven/mute-otlp

Conversation

@bouwkast
Copy link
Collaborator

@bouwkast bouwkast commented Feb 2, 2026

Summary of changes

Changes Log.Error to Log.ErrorSkipTelemetry for the OtlpExporter errors as they all seemed to be just standard transient network errors.

Reason for change

Noticed a lot of new errors but they just seem to be transient networking errors.
https://app.datadoghq.com/error-tracking/issue/443da854-fe18-11f0-ae87-da7ad0900002

Implementation details

Changed Log.Error to Log.ErrorSkipTelemetry

Test coverage

Other details

Maybe it is better to keep it as is for the time being since it is so new?
Unsure honestly, fine either way. Easy to just mark the error ignored

They all seem to be network-related
@bouwkast bouwkast requested a review from a team as a code owner February 2, 2026 21:12
@pr-commenter
Copy link

pr-commenter bot commented Feb 2, 2026

Benchmarks

Benchmark execution time: 2026-02-03 20:38:17

Comparing candidate commit efa17bc in PR branch steven/mute-otlp with baseline commit 5cbcfa8 in branch master.

Found 2 performance improvements and 5 performance regressions! Performance is the same for 169 metrics, 16 unstable metrics.

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

  • 🟩 execution_time [-113.185µs; -107.762µs] or [-10.029%; -9.548%]
  • 🟩 throughput [+93.943op/s; +98.311op/s] or [+10.602%; +11.095%]

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

  • 🟥 throughput [-48021.234op/s; -31216.637op/s] or [-7.778%; -5.056%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 throughput [-23273.000op/s; -21097.894op/s] or [-5.714%; -5.180%]

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

  • 🟥 throughput [-35941.590op/s; -26306.957op/s] or [-8.319%; -6.089%]

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

  • 🟥 execution_time [+11.052ms; +14.810ms] or [+5.497%; +7.366%]

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

  • 🟥 execution_time [+10.567ms; +15.045ms] or [+5.153%; +7.337%]

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks, I think most of these Should stay as errors, but mostly because AFAICT, they never occur. And we're missing some logs in some places we should have them I think

Comment on lines +364 to +365
// Seeing network connectivity errors so skipping telemetry
Log.ErrorSkipTelemetry(ex, "Error sending OTLP request (attempt {Attempt})", (attempt + 1).ToString());
Copy link
Member

Choose a reason for hiding this comment

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

Arguably, this shouldn't be an error at all IMO. Transient errors are expected, so this almost certainly shouldn't be logging an error at all. In Api for example, these "intermediate" attempts are Debug. Also nit, AI did the ToString() I assume 🙄

Suggested change
// Seeing network connectivity errors so skipping telemetry
Log.ErrorSkipTelemetry(ex, "Error sending OTLP request (attempt {Attempt})", (attempt + 1).ToString());
Log.Debug<int>(ex, "Error sending OTLP request (attempt {Attempt})", attempt + 1);```

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah yes, I ran my /analyze-error on it, forgot to add the label

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll swap these over thanks!

@bouwkast bouwkast added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Feb 3, 2026
@github-actions github-actions bot added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Feb 3, 2026
bouwkast and others added 2 commits February 3, 2026 14:54
Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
@dd-trace-dotnet-ci-bot
Copy link

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration79.31 ± (79.13 - 79.51) ms80.07 ± (79.94 - 80.27) ms+1.0%✅⬆️
.NET Framework 4.8 - Bailout
duration84.40 ± (84.33 - 84.70) ms84.28 ± (84.48 - 85.33) ms-0.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1121.11 ± (1118.66 - 1126.25) ms1120.38 ± (1120.47 - 1127.96) ms-0.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms24.30 ± (24.23 - 24.36) ms25.03 ± (24.98 - 25.08) ms+3.0%✅⬆️
process.time_to_main_ms94.22 ± (94.02 - 94.42) ms103.80 ± (103.58 - 104.03) ms+10.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.94 ± (10.93 - 10.94) MB15.51 ± (15.50 - 15.51) MB+41.8%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms24.07 ± (24.01 - 24.13) ms25.21 ± (25.14 - 25.28) ms+4.7%✅⬆️
process.time_to_main_ms94.28 ± (94.04 - 94.52) ms105.70 ± (105.48 - 105.93) ms+12.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.97 ± (10.97 - 10.97) MB15.54 ± (15.54 - 15.55) MB+41.7%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms230.48 ± (227.83 - 233.13) ms292.90 ± (289.62 - 296.18) ms+27.1%✅⬆️
process.time_to_main_ms535.49 ± (534.59 - 536.39) ms571.85 ± (571.03 - 572.68) ms+6.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.57 ± (48.55 - 48.60) MB53.19 ± (53.17 - 53.21) MB+9.5%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+1.3%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms22.79 ± (22.75 - 22.84) ms23.06 ± (23.00 - 23.13) ms+1.2%✅⬆️
process.time_to_main_ms81.11 ± (80.93 - 81.29) ms82.20 ± (82.01 - 82.39) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.64 ± (10.64 - 10.64) MB10.67 ± (10.67 - 10.67) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms22.70 ± (22.65 - 22.76) ms23.25 ± (23.19 - 23.30) ms+2.4%✅⬆️
process.time_to_main_ms82.45 ± (82.32 - 82.58) ms84.46 ± (84.25 - 84.67) ms+2.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.72 - 10.73) MB10.78 ± (10.77 - 10.78) MB+0.5%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms234.06 ± (229.89 - 238.23) ms235.28 ± (231.20 - 239.36) ms+0.5%✅⬆️
process.time_to_main_ms507.09 ± (506.08 - 508.09) ms512.31 ± (511.58 - 513.05) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.17 ± (49.15 - 49.20) MB49.30 ± (49.28 - 49.32) MB+0.3%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.2%
.NET 8 - Baseline
process.internal_duration_ms20.51 ± (20.47 - 20.55) ms21.48 ± (21.42 - 21.53) ms+4.7%✅⬆️
process.time_to_main_ms78.03 ± (77.84 - 78.23) ms87.02 ± (86.83 - 87.21) ms+11.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.68 - 7.69) MB12.26 ± (12.26 - 12.27) MB+59.6%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms20.47 ± (20.42 - 20.52) ms21.47 ± (21.41 - 21.53) ms+4.9%✅⬆️
process.time_to_main_ms79.01 ± (78.80 - 79.22) ms89.00 ± (88.78 - 89.22) ms+12.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.74 ± (7.73 - 7.75) MB12.35 ± (12.34 - 12.36) MB+59.6%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms196.85 ± (196.07 - 197.62) ms208.03 ± (207.27 - 208.79) ms+5.7%✅⬆️
process.time_to_main_ms484.07 ± (483.12 - 485.03) ms523.75 ± (522.74 - 524.75) ms+8.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.02 ± (36.98 - 37.05) MB41.72 ± (41.70 - 41.75) MB+12.7%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.2%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration203.83 ± (203.44 - 204.53) ms211.21 ± (210.93 - 212.40) ms+3.6%✅⬆️
.NET Framework 4.8 - Bailout
duration206.62 ± (206.50 - 207.47) ms210.87 ± (210.64 - 211.63) ms+2.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1188.00 ± (1187.93 - 1194.72) ms1201.05 ± (1202.55 - 1211.50) ms+1.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms199.68 ± (199.16 - 200.20) ms206.89 ± (205.97 - 207.80) ms+3.6%✅⬆️
process.time_to_main_ms86.45 ± (86.20 - 86.70) ms88.85 ± (88.42 - 89.28) ms+2.8%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.09 ± (16.07 - 16.10) MB16.07 ± (16.05 - 16.09) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms198.70 ± (198.19 - 199.22) ms203.70 ± (202.90 - 204.50) ms+2.5%✅⬆️
process.time_to_main_ms87.86 ± (87.59 - 88.14) ms89.59 ± (89.22 - 89.95) ms+2.0%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.17 ± (16.15 - 16.18) MB16.04 ± (16.03 - 16.06) MB-0.8%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms424.41 ± (420.95 - 427.87) ms443.04 ± (439.67 - 446.41) ms+4.4%✅⬆️
process.time_to_main_ms504.42 ± (503.42 - 505.43) ms517.19 ± (515.81 - 518.56) ms+2.5%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed59.27 ± (59.17 - 59.38) MB58.99 ± (58.86 - 59.12) MB-0.5%
runtime.dotnet.threads.count29 ± (29 - 30)30 ± (29 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms205.14 ± (204.55 - 205.74) ms215.77 ± (214.91 - 216.63) ms+5.2%✅⬆️
process.time_to_main_ms75.66 ± (75.43 - 75.90) ms84.35 ± (84.02 - 84.69) ms+11.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.29 ± (16.27 - 16.31) MB20.70 ± (20.69 - 20.72) MB+27.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)20 ± (20 - 20)+2.8%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms207.27 ± (206.73 - 207.81) ms217.34 ± (216.32 - 218.37) ms+4.9%✅⬆️
process.time_to_main_ms77.70 ± (77.48 - 77.91) ms85.64 ± (85.33 - 85.96) ms+10.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.34 ± (16.32 - 16.36) MB20.81 ± (20.79 - 20.82) MB+27.4%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)21 ± (21 - 21)+1.5%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms449.99 ± (445.76 - 454.23) ms490.90 ± (488.63 - 493.16) ms+9.1%✅⬆️
process.time_to_main_ms486.90 ± (485.85 - 487.96) ms521.52 ± (520.21 - 522.82) ms+7.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed59.30 ± (59.12 - 59.48) MB62.44 ± (62.35 - 62.54) MB+5.3%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+1.3%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms204.67 ± (204.16 - 205.18) ms208.64 ± (207.99 - 209.29) ms+1.9%✅⬆️
process.time_to_main_ms74.84 ± (74.63 - 75.04) ms81.69 ± (81.41 - 81.98) ms+9.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.65 ± (11.63 - 11.66) MB16.16 ± (16.15 - 16.17) MB+38.7%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+2.0%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms204.92 ± (204.36 - 205.49) ms211.39 ± (210.54 - 212.24) ms+3.2%✅⬆️
process.time_to_main_ms76.42 ± (76.22 - 76.63) ms83.76 ± (83.45 - 84.07) ms+9.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.68 ± (11.67 - 11.69) MB16.20 ± (16.19 - 16.22) MB+38.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+2.0%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms471.39 ± (464.37 - 478.40) ms438.54 ± (430.94 - 446.15) ms-7.0%
process.time_to_main_ms481.53 ± (480.09 - 482.96) ms493.63 ± (492.70 - 494.57) ms+2.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.53 ± (50.49 - 50.57) MB54.66 ± (54.52 - 54.80) MB+8.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+1.2%✅⬆️
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 (8133) - mean (80ms)  : 78, 82
    master - mean (79ms)  : 77, 82

    section Bailout
    This PR (8133) - mean (85ms)  : 79, 91
    master - mean (85ms)  : 83, 86

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (1,124ms)  : 1068, 1181
    master - mean (1,122ms)  : 1067, 1178

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 (8133) - mean (137ms)  : 133, 141
    master - mean (126ms)  : 123, 129

    section Bailout
    This PR (8133) - mean (139ms)  : crit, 137, 142
    master - mean (126ms)  : 122, 130

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (904ms)  : crit, 855, 953
    master - mean (808ms)  : 755, 860

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8133) - mean (112ms)  : 109, 116
    master - mean (111ms)  : 108, 114

    section Bailout
    This PR (8133) - mean (115ms)  : 112, 117
    master - mean (112ms)  : 110, 114

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (790ms)  : 731, 849
    master - mean (784ms)  : 717, 851

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8133) - mean (118ms)  : 113, 122
    master - mean (107ms)  : 103, 111

    section Bailout
    This PR (8133) - mean (119ms)  : crit, 115, 123
    master - mean (108ms)  : 105, 111

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (776ms)  : crit, 752, 800
    master - mean (723ms)  : 698, 749

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 (8133) - mean (212ms)  : 201, 222
    master - mean (204ms)  : 196, 212

    section Bailout
    This PR (8133) - mean (211ms)  : 205, 217
    master - mean (207ms)  : 200, 213

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (1,207ms)  : 1139, 1275
    master - mean (1,191ms)  : 1143, 1239

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 (8133) - mean (305ms)  : 284, 326
    master - mean (296ms)  : 283, 309

    section Bailout
    This PR (8133) - mean (303ms)  : 283, 324
    master - mean (296ms)  : 288, 305

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (1,003ms)  : 952, 1054
    master - mean (972ms)  : 910, 1033

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8133) - mean (310ms)  : 292, 327
    master - mean (290ms)  : 276, 304

    section Bailout
    This PR (8133) - mean (313ms)  : crit, 293, 333
    master - mean (294ms)  : 284, 305

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (1,050ms)  : crit, 997, 1104
    master - mean (979ms)  : 906, 1053

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8133) - mean (302ms)  : 289, 314
    master - mean (291ms)  : 281, 300

    section Bailout
    This PR (8133) - mean (307ms)  : 286, 329
    master - mean (292ms)  : 281, 302

    section CallTarget+Inlining+NGEN
    This PR (8133) - mean (972ms)  : 862, 1083
    master - mean (993ms)  : 877, 1108

Loading

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks!

bouwkast added a commit that referenced this pull request Feb 4, 2026
## 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
<!-- Fixes #{issue} -->

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
diff --git
a/tracer/src/Datadog.Trace/OpenTelemetry/Metrics/OtlpExporter.cs
  b/tracer/src/Datadog.Trace/OpenTelemetry/Metrics/OtlpExporter.cs
  index e90bee8..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;
                   }
               }
  ```

<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->

---------

Co-authored-by: Andrew Lock <andrew.lock@datadoghq.com>
Copy link
Contributor

@link04 link04 left a comment

Choose a reason for hiding this comment

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

TY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) identified-by:telemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants