@@ -17,6 +17,12 @@ namespace Datadog.Trace.ClrProfiler
 
         private ICommonTracer _child;
 
+        IScope IDistributedTracer.GetActiveScope()
+        {
+            // The automatic tracer doesn't need to get the manual active trace
+            return null;
+        }
+
         SpanContext IDistributedTracer.GetSpanContext()
         {
             if (_child is null)
// <copyright file="AutomaticTracer.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

using System.Collections.Generic;
using System.Threading;
using Datadog.Trace.DuckTyping;
using Datadog.Trace.Logging;

namespace Datadog.Trace.ClrProfiler
{
    internal class AutomaticTracer : CommonTracer, IAutomaticTracer, IDistributedTracer
    {
        private static readonly AsyncLocal<IReadOnlyDictionary<string, string>> DistributedTrace = new();
        private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(AutomaticTracer));

        private ICommonTracer _child;

        SpanContext IDistributedTracer.GetSpanContext()
        {
            if (_child is null)
            {
                return null;
            }
            else if (DistributedTrace.Value is SpanContext spanContext)
            {
                return spanContext;
            }
            else
            {
                return SpanContextPropagator.Instance.Extract(DistributedTrace.Value);
            }
        }

        void IDistributedTracer.SetSpanContext(SpanContext value)
        {
            DistributedTrace.Value = value;
        }

        void IDistributedTracer.LockSamplingPriority()
        {
            _child?.LockSamplingPriority();
        }

        SamplingPriority? IDistributedTracer.TrySetSamplingPriority(SamplingPriority? samplingPriority)
        {
            if (_child == null)
            {
                return samplingPriority;
            }

            return (SamplingPriority?)_child.TrySetSamplingPriority((int?)samplingPriority);
        }

        /// <summary>
        /// Gets the internal distributed trace object
        /// </summary>
        /// <returns>Shared distributed trace object instance</returns>
        public IReadOnlyDictionary<string, string> GetDistributedTrace()
        {
            return DistributedTrace.Value;
        }

        /// <summary>
        /// Sets the internal distributed trace object
        /// </summary>
        /// <param name="value">Shared distributed trace object instance</param>
        public void SetDistributedTrace(IReadOnlyDictionary<string, string> value)
        {
            if (_child != null)
            {
                DistributedTrace.Value = value;
            }
        }

        public void Register(object manualTracer)
        {
            Log.Information("Registering {child} as child tracer", manualTracer.GetType());
            _child = manualTracer.DuckCast<ICommonTracer>();
        }
    }
}

Maybe this can be done in a separate PR, but there are several instances where the automatic side needs to know if there is an Active scope, even if it was created on the manual side: - Getting the active trace_id/span_id for logs injection - Places where `ActiveScope == null` checks are made to determine if the there is a root span or not These places could currently use the `GetSpanContext` API to get this, but it's rather costly to create a new object when all we need is to check that it's not null or to get a trace_id/span_id. Maybe we add another interface method to get the `IReadOnlyDictionary<string,string>` object as-is