Skip to content

Commit 153f5fe

Browse files
committed
Update debugger ExporterSettings - this only uses the initial settings though, and doesn't respond to changes
1 parent b57dea3 commit 153f5fe

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

tracer/src/Datadog.Trace/Debugger/DebuggerFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static IDogStatsd GetDogStatsd(TracerSettings tracerSettings, string ser
6060
{
6161
IDogStatsd statsd;
6262
if (FrameworkDescription.Instance.IsWindows()
63-
&& tracerSettings.Exporter.MetricsTransport == TransportType.UDS)
63+
&& tracerSettings.Manager.InitialExporterSettings.MetricsTransport == TransportType.UDS)
6464
{
6565
Log.Information("Metric probes are not supported on Windows when transport type is UDS");
6666
statsd = NoOpStatsd.Instance;
@@ -70,7 +70,7 @@ private static IDogStatsd GetDogStatsd(TracerSettings tracerSettings, string ser
7070
// TODO: use StatsdManager to get automatic updating on exporter and other setting changes
7171
statsd = StatsdFactory.CreateDogStatsdClient(
7272
tracerSettings.Manager.InitialMutableSettings,
73-
tracerSettings.Exporter,
73+
tracerSettings.Manager.InitialExporterSettings,
7474
includeDefaultTags: false,
7575
prefix: DebuggerSettings.DebuggerMetricPrefix);
7676
}
@@ -119,7 +119,7 @@ private static IApiRequestFactory GetApiFactory(TracerSettings tracerSettings, b
119119
{
120120
// TODO: we need to be able to update the tracer settings dynamically
121121
return AgentTransportStrategy.Get(
122-
tracerSettings.Exporter,
122+
tracerSettings.Manager.InitialExporterSettings,
123123
productName: "debugger",
124124
tcpTimeout: TimeSpan.FromSeconds(15),
125125
AgentHttpHeaderNames.MinimalHeaders,

tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionReplay.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ private void InitSnapshotsSink()
6565
// Set up the snapshots sink.
6666
var snapshotSlicer = SnapshotSlicer.Create(debuggerSettings);
6767
_snapshotSink = SnapshotSink.Create(debuggerSettings, snapshotSlicer);
68+
// TODO: respond to changes in exporter settings
6869
var apiFactory = AgentTransportStrategy.Get(
69-
tracer.Settings.Exporter,
70+
tracer.Settings.Manager.InitialExporterSettings,
7071
productName: "debugger",
7172
tcpTimeout: TimeSpan.FromSeconds(15),
7273
AgentHttpHeaderNames.MinimalHeaders,

tracer/src/Datadog.Trace/TracerManager.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ private static async Task WriteDiagnosticLog(TracerManager instance)
324324
string agentError = null;
325325
var instanceSettings = instance.Settings;
326326
var mutableSettings = instance.PerTraceSettings.Settings;
327+
// TODO: this only writes the initial settings - we should make sure to record an "update" log on reconfiguration
328+
var exporterSettings = instanceSettings.Manager.InitialExporterSettings;
327329

328330
// In AAS, the trace agent is deployed alongside the tracer and managed by the tracer
329331
// Disable this check as it may hit the trace agent before it is ready to receive requests and give false negatives
@@ -401,10 +403,10 @@ void WriteDictionary(IReadOnlyDictionary<string, string> dictionary)
401403
writer.WriteValue(mutableSettings.DefaultServiceName);
402404

403405
writer.WritePropertyName("agent_url");
404-
writer.WriteValue(instanceSettings.Exporter.TraceAgentUriBase);
406+
writer.WriteValue(exporterSettings.TraceAgentUriBase);
405407

406408
writer.WritePropertyName("agent_transport");
407-
writer.WriteValue(instanceSettings.Exporter.TracesTransport.ToString());
409+
writer.WriteValue(exporterSettings.TracesTransport.ToString());
408410

409411
writer.WritePropertyName("debug");
410412
writer.WriteValue(GlobalSettings.Instance.DebugEnabledInternal);
@@ -518,7 +520,7 @@ void WriteDictionary(IReadOnlyDictionary<string, string> dictionary)
518520
writer.WritePropertyName("exporter_settings_warning");
519521
writer.WriteStartArray();
520522

521-
foreach (var warning in instanceSettings.Exporter.ValidationWarnings)
523+
foreach (var warning in exporterSettings.ValidationWarnings)
522524
{
523525
writer.WriteValue(warning);
524526
}

0 commit comments

Comments
 (0)