Skip to content

Commit deb037f

Browse files
committed
special case for logging factory..
1 parent fc262e2 commit deb037f

File tree

9 files changed

+2917
-14
lines changed

9 files changed

+2917
-14
lines changed

tracer/src/Datadog.Trace.Manual/Datadog.Trace.Manual.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<Compile Include="..\Datadog.Trace\Ci\TestStatus.cs" Link="Ci\%(Filename)%(Extension)" />
2727
<Compile Include="..\Datadog.Trace\ClrProfiler\AutoInstrumentation\ManualInstrumentation\TracerSettingKeyConstants.cs" Link="Configuration\%(Filename)%(Extension)" />
2828
<Compile Include="..\Datadog.Trace\ClrProfiler\AutoInstrumentation\ManualInstrumentation\IntegrationSettingsSerializationHelper.cs" Link="Configuration\%(Filename)%(Extension)" />
29-
<Compile Include="..\Datadog.Trace\Configuration\DeprecationMessages.cs" Link="Configuration\%(Filename)%(Extension)" />
29+
<Compile Include="..\Datadog.Trace\Configuration\DeprecationMessages.cs"
30+
Link="Configuration\%(Filename)%(Extension)" />
3031
<Compile Include="..\Datadog.Trace\DuckTyping\DuckAsClassAttribute.cs" Link="DuckTyping\%(Filename)%(Extension)" />
3132
<Compile Include="..\Datadog.Trace\HttpHeaderNames.cs" />
3233
<Compile Include="..\Datadog.Trace\IDatadogOpenTracingTracer.cs" />

tracer/src/Datadog.Trace.Tools.Runner/ProcessConfiguration.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ internal static class ProcessConfiguration
5454

5555
if (logDirectory == null)
5656
{
57-
#pragma warning disable 618 // ProfilerLogPath is deprecated but still supported
58-
var nativeLogFile = config.WithKeys(ConfigurationKeys.ProfilerLogPath).AsString();
59-
#pragma warning restore 618
57+
// ProfilerLogPath is deprecated but still supported. For now, we bypass the WithKeys analyzer, but later we want to pull deprecations differently as part of centralized file
58+
#pragma warning disable DD0008, 618
59+
var nativeLogFile = config.WithKeys(ConfigurationKeys.TraceLogPath).AsString();
60+
#pragma warning restore DD0008, 618
6061
if (!string.IsNullOrEmpty(nativeLogFile))
6162
{
6263
logDirectory = Path.GetDirectoryName(nativeLogFile);

tracer/src/Datadog.Trace/Configuration/TracerSettings.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ not null when string.Equals(x, "lowmemory", StringComparison.OrdinalIgnoreCase)
278278
validator: null);
279279

280280
OtlpLogsProtocol = config
281-
.WithKeys(ConfigurationKeys.OpenTelemetry.ExporterOtlpLogsProtocol, ConfigurationKeys.OpenTelemetry.ExporterOtlpProtocol)
281+
.WithKeys(ConfigurationKeys.OpenTelemetry.ExporterOtlpLogsProtocol)
282282
.GetAs(
283283
defaultValue: new(OtlpProtocol.Grpc, "grpc"),
284284
converter: x => x switch
@@ -304,14 +304,14 @@ not null when string.Equals(x, "http/protobuf", StringComparison.OrdinalIgnoreCa
304304
converter: uriString => new Uri(uriString));
305305

306306
OtlpLogsHeaders = config
307-
.WithKeys(ConfigurationKeys.OpenTelemetry.ExporterOtlpLogsHeaders, ConfigurationKeys.OpenTelemetry.ExporterOtlpHeaders)
307+
.WithKeys(ConfigurationKeys.OpenTelemetry.ExporterOtlpLogsHeaders)
308308
.AsDictionaryResult(separator: '=')
309309
.WithDefault(new DefaultResult<IDictionary<string, string>>(new Dictionary<string, string>(), "[]"))
310310
.Where(kvp => !string.IsNullOrWhiteSpace(kvp.Key))
311311
.ToDictionary(kvp => kvp.Key.Trim(), kvp => kvp.Value?.Trim() ?? string.Empty);
312312

313313
OtlpLogsTimeoutMs = config
314-
.WithKeys(ConfigurationKeys.OpenTelemetry.ExporterOtlpLogsTimeoutMs, ConfigurationKeys.OpenTelemetry.ExporterOtlpTimeoutMs)
314+
.WithKeys(ConfigurationKeys.OpenTelemetry.ExporterOtlpLogsTimeoutMs)
315315
.AsInt32(defaultValue: 10_000);
316316

317317
var otelLogsExporter = config
@@ -1363,6 +1363,16 @@ internal static string[] TrimSplitString(string? textValues, char[] separators)
13631363
return list.ToArray();
13641364
}
13651365

1366+
internal bool IsErrorStatusCode(int statusCode, bool serverStatusCode)
1367+
=> MutableSettings.IsErrorStatusCode(statusCode, serverStatusCode);
1368+
1369+
internal bool IsIntegrationEnabled(IntegrationId integration, bool defaultValue = true)
1370+
=> MutableSettings.IsIntegrationEnabled(integration, defaultValue);
1371+
1372+
[Obsolete(DeprecationMessages.AppAnalytics)]
1373+
internal double? GetIntegrationAnalyticsSampleRate(IntegrationId integration, bool enabledWithGlobalSetting)
1374+
=> MutableSettings.GetIntegrationAnalyticsSampleRate(integration, enabledWithGlobalSetting);
1375+
13661376
internal string GetDefaultHttpClientExclusions()
13671377
{
13681378
if (IsRunningInAzureAppService)

0 commit comments

Comments
 (0)