Skip to content

Commit

Permalink
Temporarily disable the tracer flare functionality (#5036)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock authored Jan 9, 2024
1 parent ebfdcb0 commit 02650cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ internal class TracerFlareManager : ITracerFlareManager
private readonly IDiscoveryService _discoveryService;
private readonly IRcmSubscriptionManager _subscriptionManager;
private readonly TracerFlareApi _flareApi;
private readonly bool _enableFlare;
private ISubscription? _subscription;
private Timer? _resetTimer = null;

Expand All @@ -39,17 +40,24 @@ internal class TracerFlareManager : ITracerFlareManager
public TracerFlareManager(
IDiscoveryService discoveryService,
IRcmSubscriptionManager subscriptionManager,
TracerFlareApi flareApi)
TracerFlareApi flareApi,
bool enableFlare = true)
{
_subscriptionManager = subscriptionManager;
_flareApi = flareApi;
_discoveryService = discoveryService;
_enableFlare = enableFlare;
}

public bool? CanSendTracerFlare { get; private set; } = null;

public void Start()
{
if (!_enableFlare)
{
return;
}

if (Interlocked.Exchange(ref _subscription, new Subscription(RcmProductReceived, RcmProducts.TracerFlareInitiated, RcmProducts.TracerFlareRequested)) == null)
{
_discoveryService.SubscribeToChanges(HandleConfigUpdate);
Expand All @@ -60,6 +68,11 @@ public void Start()

public void Dispose()
{
if (!_enableFlare)
{
return;
}

if (_resetTimer is not null)
{
// If we have a timer, we should reset debugging now
Expand Down
2 changes: 1 addition & 1 deletion tracer/src/Datadog.Trace/TracerManagerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ internal TracerManager CreateTracerManager(
}

dynamicConfigurationManager ??= new DynamicConfigurationManager(RcmSubscriptionManager.Instance);
tracerFlareManager ??= new TracerFlareManager(discoveryService, RcmSubscriptionManager.Instance, TracerFlareApi.Create(settings.ExporterInternal));
tracerFlareManager ??= new TracerFlareManager(discoveryService, RcmSubscriptionManager.Instance, TracerFlareApi.Create(settings.ExporterInternal), enableFlare: false);

return CreateTracerManagerFrom(
settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public TracerFlareTests(ITestOutputHelper output)
SetEnvironmentVariable(ConfigurationKeys.Rcm.PollInterval, "5");
}

[SkippableFact]
[SkippableFact(Skip = "Temporarily disabled for release")]
[Trait("RunOnWindows", "True")]
public async Task SendTracerFlare()
{
Expand Down

0 comments on commit 02650cd

Please sign in to comment.