Skip to content

Commit 0efb312

Browse files
committed
Remove retries from stats send Api
1 parent d549eb7 commit 0efb312

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • tracer/src/Datadog.Trace/Agent

tracer/src/Datadog.Trace/Agent/Api.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ public Task<bool> SendStatsAsync(StatsBuffer stats, long bucketDuration, int tra
104104

105105
var state = new SendStatsState(stats, bucketDuration, tracerObfuscationVersion);
106106

107-
return SendWithRetry(_statsEndpoint, _sendStats, state);
107+
// We are supposed to be fire and forget for these stats, with no retries
108+
return SendWithRetry(_statsEndpoint, _sendStats, state, retryLimit: 0);
108109
}
109110

110111
public Task<bool> SendTracesAsync(ArraySegment<byte> traces, int numberOfTraces, bool statsComputationEnabled, long numberOfDroppedP0Traces, long numberOfDroppedP0Spans, bool apmTracingEnabled = true)
@@ -138,10 +139,9 @@ internal bool LogPartialFlushWarningIfRequired(string agentVersion)
138139
return false;
139140
}
140141

141-
private async Task<bool> SendWithRetry<T>(Uri endpoint, SendCallback<T> callback, T state)
142+
private async Task<bool> SendWithRetry<T>(Uri endpoint, SendCallback<T> callback, T state, int retryLimit = 5)
142143
{
143144
// retry up to 5 times with exponential back-off
144-
var retryLimit = 5;
145145
var retryCount = 1;
146146
var sleepDuration = 100; // in milliseconds
147147

0 commit comments

Comments
 (0)