Skip to content

Commit 2f40474

Browse files
authored
Set default timeout for Trace Exporter to 15s. (#7252)
## Summary of changes Add new binding to set the trace exporter connection timeout. ## Reason for change Trace exporter was setting a 3s connection timeout which probably was insufficient for some test cases. This version use the new bindings to increase the time up to 15 seconds.
1 parent 05a370e commit 2f40474

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

tracer/src/Datadog.Trace/LibDatadog/NativeInterop.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ internal static class Config
9393

9494
[DllImport(DllName, EntryPoint = "ddog_trace_exporter_config_set_client_computed_stats")]
9595
internal static extern TraceExporterErrorHandle SetClientComputedStats(SafeHandle config, bool clientComputedStats);
96+
97+
[DllImport(DllName, EntryPoint = "ddog_trace_exporter_config_set_connection_timeout")]
98+
internal static extern TraceExporterErrorHandle SetConnectionTimeout(SafeHandle config, ulong timeout_ms);
9699
}
97100

98101
internal static class Logger

tracer/src/Datadog.Trace/LibDatadog/TraceExporterConfiguration.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ public bool ClientComputedStats
151151
}
152152
}
153153

154+
public ulong ConnectionTimeoutMs
155+
{
156+
init
157+
{
158+
using var error = NativeInterop.Config.SetConnectionTimeout(this, value);
159+
error.ThrowIfError();
160+
}
161+
}
162+
154163
protected override bool ReleaseHandle()
155164
{
156165
if (_telemetryConfigPtr != IntPtr.Zero)

tracer/src/Datadog.Trace/TracerManagerFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ internal static IApi GetApi(TracerSettings settings, IDogStatsd statsd, Action<D
415415
LanguageInterpreter = frameworkDescription.Name,
416416
ComputeStats = settings.StatsComputationEnabled,
417417
TelemetryClientConfiguration = telemetryClientConfiguration,
418-
ClientComputedStats = clientComputedStats
418+
ClientComputedStats = clientComputedStats,
419+
ConnectionTimeoutMs = 15_000
419420
};
420421

421422
return new TraceExporter(configuration, updateSampleRates);

0 commit comments

Comments
 (0)