Skip to content

Commit e75305a

Browse files
- Change the environment variable name to DD_TRACE_DELAY_WCF_INSTRUMENTATION_ENABLED
- Move the DelayWcfInstrumentationEnabled to the FeatureFlags grouping of ConfigurationKeys - Make the DelayWcfInstrumentationEnabled TracerSetting internal
1 parent c5987de commit e75305a

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Wcf/AsyncMethodInvoker_InvokeBegin_Integration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static CallTargetState OnMethodBegin<TTarget>(TTarget instance, object in
4949
//
5050
// context.IncomingMessageProperties contains:
5151
// - ["httpRequest"] key to find distributed tracing headers
52-
if (!Tracer.Instance.Settings.IsIntegrationEnabled(WcfCommon.IntegrationId) || !Tracer.Instance.Settings.WcfEnableNewInstrumentation || WcfCommon.GetCurrentOperationContext is null)
52+
if (!Tracer.Instance.Settings.IsIntegrationEnabled(WcfCommon.IntegrationId) || !Tracer.Instance.Settings.DelayWcfInstrumentationEnabled || WcfCommon.GetCurrentOperationContext is null)
5353
{
5454
return CallTargetState.GetDefault();
5555
}

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Wcf/ChannelHandlerIntegration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class ChannelHandlerIntegration
4242
/// <returns>Calltarget state value</returns>
4343
public static CallTargetState OnMethodBegin<TTarget, TRequestContext, TOperationContext>(TTarget instance, TRequestContext request, TOperationContext currentOperationContext)
4444
{
45-
if (Tracer.Instance.Settings.WcfEnableNewInstrumentation)
45+
if (Tracer.Instance.Settings.DelayWcfInstrumentationEnabled)
4646
{
4747
return CallTargetState.GetDefault();
4848
}

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Wcf/SyncMethodInvokerIntegration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static CallTargetState OnMethodBegin<TTarget>(TTarget instance, object in
4848
//
4949
// context.IncomingMessageProperties contains:
5050
// - ["httpRequest"] key to find distributed tracing headers
51-
if (!Tracer.Instance.Settings.IsIntegrationEnabled(WcfCommon.IntegrationId) || !Tracer.Instance.Settings.WcfEnableNewInstrumentation || WcfCommon.GetCurrentOperationContext is null)
51+
if (!Tracer.Instance.Settings.IsIntegrationEnabled(WcfCommon.IntegrationId) || !Tracer.Instance.Settings.DelayWcfInstrumentationEnabled || WcfCommon.GetCurrentOperationContext is null)
5252
{
5353
return CallTargetState.GetDefault();
5454
}

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Wcf/TaskMethodInvokerIntegration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static CallTargetState OnMethodBegin<TTarget>(TTarget instance, object in
4747
//
4848
// context.IncomingMessageProperties contains:
4949
// - ["httpRequest"] key to find distributed tracing headers
50-
if (!Tracer.Instance.Settings.IsIntegrationEnabled(WcfCommon.IntegrationId) || !Tracer.Instance.Settings.WcfEnableNewInstrumentation || WcfCommon.GetCurrentOperationContext is null)
50+
if (!Tracer.Instance.Settings.IsIntegrationEnabled(WcfCommon.IntegrationId) || !Tracer.Instance.Settings.DelayWcfInstrumentationEnabled || WcfCommon.GetCurrentOperationContext is null)
5151
{
5252
return CallTargetState.GetDefault();
5353
}

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,6 @@ public static class ConfigurationKeys
363363
/// <seealso cref="TracerSettings.KafkaCreateConsumerScopeEnabled"/>
364364
public const string KafkaCreateConsumerScopeEnabled = "DD_TRACE_KAFKA_CREATE_CONSUMER_SCOPE_ENABLED";
365365

366-
/// <summary>
367-
/// Configuration key to enable or disable the updated WCF instrumentation
368-
/// </summary>
369-
/// <seealso cref="TracerSettings.WcfEnableNewInstrumentation"/>
370-
public const string WcfEnableNewInstrumentation = "DD_TRACE_WCF_ENABLE_NEW_INSTRUMENTATION";
371-
372366
/// <summary>
373367
/// Configuration key for enabling or disabling CI Visibility.
374368
/// Default is value is false (disabled).
@@ -426,6 +420,13 @@ internal static class FeatureFlags
426420
/// Feature Flag: enables instrumenting calls to netstandard.dll (only applies to CallSite instrumentation)
427421
/// </summary>
428422
public const string NetStandardEnabled = "DD_TRACE_NETSTANDARD_ENABLED";
423+
424+
/// <summary>
425+
/// Configuration key to enable or disable the updated WCF instrumentation that delays execution
426+
/// until later in the WCF pipeline when the WCF server exception handling is established.
427+
/// </summary>
428+
/// <seealso cref="TracerSettings.DelayWcfInstrumentationEnabled"/>
429+
public const string DelayWcfInstrumentationEnabled = "DD_TRACE_DELAY_WCF_INSTRUMENTATION_ENABLED ";
429430
}
430431
}
431432
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public TracerSettings(IConfigurationSource source)
215215
KafkaCreateConsumerScopeEnabled = source?.GetBool(ConfigurationKeys.KafkaCreateConsumerScopeEnabled)
216216
?? true; // default
217217

218-
WcfEnableNewInstrumentation = source?.GetBool(ConfigurationKeys.WcfEnableNewInstrumentation)
218+
DelayWcfInstrumentationEnabled = source?.GetBool(ConfigurationKeys.FeatureFlags.DelayWcfInstrumentationEnabled)
219219
?? false;
220220
}
221221

@@ -417,9 +417,10 @@ public int PartialFlushMinSpans
417417
public bool KafkaCreateConsumerScopeEnabled { get; set; }
418418

419419
/// <summary>
420-
/// Gets or sets a value indicating whether to use the updated WCF instrumentation
420+
/// Gets or sets a value indicating whether to enable the updated WCF instrumentation that delays execution
421+
/// until later in the WCF pipeline when the WCF server exception handling is established.
421422
/// </summary>
422-
public bool WcfEnableNewInstrumentation { get; set; }
423+
internal bool DelayWcfInstrumentationEnabled { get; set; }
423424

424425
/// <summary>
425426
/// Gets or sets a value indicating whether the diagnostic log at startup is enabled

0 commit comments

Comments
 (0)