diff --git a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt index e69de29bb2d..b626ad90d2b 100644 --- a/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/Stable/PublicAPI.Unshipped.txt @@ -0,0 +1,7 @@ +OpenTelemetry.DelegatingProcessor +OpenTelemetry.DelegatingProcessor.DelegatingProcessor(OpenTelemetry.BaseProcessor! innerProcessor) -> void +override OpenTelemetry.DelegatingProcessor.Dispose(bool disposing) -> void +override OpenTelemetry.DelegatingProcessor.OnEnd(T data) -> void +override OpenTelemetry.DelegatingProcessor.OnForceFlush(int timeoutMilliseconds) -> bool +override OpenTelemetry.DelegatingProcessor.OnShutdown(int timeoutMilliseconds) -> bool +override OpenTelemetry.DelegatingProcessor.OnStart(T data) -> void diff --git a/src/OpenTelemetry/DelegatingProcessor.cs b/src/OpenTelemetry/DelegatingProcessor.cs new file mode 100644 index 00000000000..4131427ea9d --- /dev/null +++ b/src/OpenTelemetry/DelegatingProcessor.cs @@ -0,0 +1,74 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +using OpenTelemetry.Internal; + +namespace OpenTelemetry; + +/// +/// A implementation which will forward calls to +/// an inner . +/// +/// The type of object to be processed. +public abstract class DelegatingProcessor : BaseProcessor +{ + internal readonly BaseProcessor InnerProcessor; + private bool disposed; + + /// + /// Initializes a new instance of the class. + /// + /// . + protected DelegatingProcessor(BaseProcessor innerProcessor) + { + Guard.ThrowIfNull(innerProcessor); + + this.InnerProcessor = innerProcessor; + } + + /// + public override void OnStart(T data) + { + this.InnerProcessor.OnStart(data); + } + + /// + public override void OnEnd(T data) + { + this.InnerProcessor.OnEnd(data); + } + + /// + internal override void SetParentProvider(BaseProvider parentProvider) + { + this.InnerProcessor.SetParentProvider(parentProvider); + } + + /// + protected override bool OnForceFlush(int timeoutMilliseconds) + { + return this.InnerProcessor.ForceFlush(timeoutMilliseconds); + } + + /// + protected override bool OnShutdown(int timeoutMilliseconds) + { + return this.InnerProcessor.Shutdown(timeoutMilliseconds); + } + + /// + protected override void Dispose(bool disposing) + { + if (!this.disposed) + { + if (disposing) + { + this.InnerProcessor.Dispose(); + } + + this.disposed = true; + } + + base.Dispose(disposing); + } +} diff --git a/src/OpenTelemetry/Logs/LoggerProviderSdk.cs b/src/OpenTelemetry/Logs/LoggerProviderSdk.cs index f23308680e7..ef080f231fe 100644 --- a/src/OpenTelemetry/Logs/LoggerProviderSdk.cs +++ b/src/OpenTelemetry/Logs/LoggerProviderSdk.cs @@ -188,6 +188,10 @@ public bool ContainsBatchProcessor(BaseProcessor processor) current = current.Next; } } + else if (processor is DelegatingProcessor delegatingProcessor) + { + return this.ContainsBatchProcessor(delegatingProcessor.InnerProcessor); + } return false; } diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj index ad60a2385a2..3fad3e34ed8 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj @@ -29,8 +29,8 @@ - + diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs index 95f61d41297..06558c87a13 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs @@ -593,18 +593,18 @@ public void UseOpenTelemetryProtocolActivityExporterWithCustomActivityProcessor( } const string ActivitySourceName = "otlp.test"; - TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { endCalled = true; diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj b/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj index d277eb4d15e..dbd6482f92d 100644 --- a/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj +++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/OpenTelemetry.Exporter.Zipkin.Tests.csproj @@ -9,8 +9,8 @@ - + diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs index 9ed6a4d3dfc..0fcc0b1e068 100644 --- a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs +++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs @@ -103,11 +103,11 @@ public void SuppressesInstrumentation() { const string ActivitySourceName = "zipkin.test"; Guid requestId = Guid.NewGuid(); - TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + var testActivityProcessor = new TestProcessor(); int endCalledCount = 0; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { endCalledCount++; diff --git a/test/OpenTelemetry.Tests/BaseProcessorTest.cs b/test/OpenTelemetry.Tests/BaseProcessorTest.cs index 61516290135..cfdbc36756d 100644 --- a/test/OpenTelemetry.Tests/BaseProcessorTest.cs +++ b/test/OpenTelemetry.Tests/BaseProcessorTest.cs @@ -11,7 +11,7 @@ public class BaseProcessorTest public void Verify_ForceFlush_HandlesException() { // By default, ForceFlush should return true. - var testProcessor = new DelegatingProcessor(); + var testProcessor = new TestProcessor(); Assert.True(testProcessor.ForceFlush()); // BaseExporter should catch any exceptions and return false. @@ -23,7 +23,7 @@ public void Verify_ForceFlush_HandlesException() public void Verify_Shutdown_HandlesSecond() { // By default, Shutdown should return true. - var testProcessor = new DelegatingProcessor(); + var testProcessor = new TestProcessor(); Assert.True(testProcessor.Shutdown()); // A second Shutdown should return false. @@ -34,7 +34,7 @@ public void Verify_Shutdown_HandlesSecond() public void Verify_Shutdown_HandlesException() { // BaseExporter should catch any exceptions and return false. - var exceptionTestProcessor = new DelegatingProcessor + var exceptionTestProcessor = new TestProcessor { OnShutdownFunc = (timeout) => throw new Exception("test exception"), }; @@ -44,7 +44,7 @@ public void Verify_Shutdown_HandlesException() [Fact] public void NoOp() { - var testProcessor = new DelegatingProcessor(); + var testProcessor = new TestProcessor(); // These two methods are no-op, but account for 7% of the test coverage. testProcessor.OnStart(new object()); diff --git a/test/OpenTelemetry.Tests/Shared/DelegatingProcessor.cs b/test/OpenTelemetry.Tests/Shared/DelegatingProcessor.cs deleted file mode 100644 index db5148a5ab6..00000000000 --- a/test/OpenTelemetry.Tests/Shared/DelegatingProcessor.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -namespace OpenTelemetry.Tests; - -public class DelegatingProcessor : BaseProcessor - where T : class -{ - public Func OnForceFlushFunc { get; set; } = (timeout) => true; - - public Func OnShutdownFunc { get; set; } = (timeout) => true; - - protected override bool OnForceFlush(int timeoutMilliseconds) => this.OnForceFlushFunc(timeoutMilliseconds); - - protected override bool OnShutdown(int timeoutMilliseconds) => this.OnShutdownFunc(timeoutMilliseconds); -} diff --git a/test/OpenTelemetry.Tests/Shared/TestActivityProcessor.cs b/test/OpenTelemetry.Tests/Shared/TestProcessor.cs similarity index 51% rename from test/OpenTelemetry.Tests/Shared/TestActivityProcessor.cs rename to test/OpenTelemetry.Tests/Shared/TestProcessor.cs index 36d47b7b8fa..b07554f8b99 100644 --- a/test/OpenTelemetry.Tests/Shared/TestActivityProcessor.cs +++ b/test/OpenTelemetry.Tests/Shared/TestProcessor.cs @@ -1,24 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -using System.Diagnostics; - namespace OpenTelemetry.Tests; -internal class TestActivityProcessor : BaseProcessor +public class TestProcessor : BaseProcessor + where T : class { - public Action StartAction; - public Action EndAction; + public Action OnStartAction { get; set; } = (T data) => { }; - public TestActivityProcessor() - { - } + public Action OnEndAction { get; set; } = (T data) => { }; - public TestActivityProcessor(Action onStart, Action onEnd) - { - this.StartAction = onStart; - this.EndAction = onEnd; - } + public Func OnForceFlushFunc { get; set; } = (timeout) => true; + + public Func OnShutdownFunc { get; set; } = (timeout) => true; public bool ShutdownCalled { get; private set; } = false; @@ -26,26 +20,28 @@ public TestActivityProcessor(Action onStart, Action onEnd) public bool DisposedCalled { get; private set; } = false; - public override void OnStart(Activity span) + public override void OnStart(T data) { - this.StartAction?.Invoke(span); + this.OnStartAction(data); } - public override void OnEnd(Activity span) + public override void OnEnd(T data) { - this.EndAction?.Invoke(span); + this.OnEndAction(data); } protected override bool OnForceFlush(int timeoutMilliseconds) { this.ForceFlushCalled = true; - return true; + + return this.OnForceFlushFunc(timeoutMilliseconds); } protected override bool OnShutdown(int timeoutMilliseconds) { this.ShutdownCalled = true; - return true; + + return this.OnShutdownFunc(timeoutMilliseconds); } protected override void Dispose(bool disposing) diff --git a/test/OpenTelemetry.Tests/Trace/CompositeActivityProcessorTests.cs b/test/OpenTelemetry.Tests/Trace/CompositeActivityProcessorTests.cs index 8f8bccb8e29..885285f9b1d 100644 --- a/test/OpenTelemetry.Tests/Trace/CompositeActivityProcessorTests.cs +++ b/test/OpenTelemetry.Tests/Trace/CompositeActivityProcessorTests.cs @@ -15,7 +15,7 @@ public void CompositeActivityProcessor_BadArgs() Assert.Throws(() => new CompositeProcessor(null)); Assert.Throws(() => new CompositeProcessor(Array.Empty>())); - using var p1 = new TestActivityProcessor(null, null); + using var p1 = new TestProcessor(); using var processor = new CompositeProcessor(new[] { p1 }); Assert.Throws(() => processor.AddProcessor(null)); } @@ -25,12 +25,16 @@ public void CompositeActivityProcessor_CallsAllProcessorSequentially() { var result = string.Empty; - using var p1 = new TestActivityProcessor( - activity => { result += "1"; }, - activity => { result += "3"; }); - using var p2 = new TestActivityProcessor( - activity => { result += "2"; }, - activity => { result += "4"; }); + using var p1 = new TestProcessor() + { + OnStartAction = (_) => { result += "1"; }, + OnEndAction = (_) => { result += "3"; }, + }; + using var p2 = new TestProcessor() + { + OnStartAction = (_) => { result += "2"; }, + OnEndAction = (_) => { result += "4"; }, + }; using var activity = new Activity("test"); @@ -46,9 +50,11 @@ public void CompositeActivityProcessor_CallsAllProcessorSequentially() [Fact] public void CompositeActivityProcessor_ProcessorThrows() { - using var p1 = new TestActivityProcessor( - activity => { throw new Exception("Start exception"); }, - activity => { throw new Exception("End exception"); }); + using var p1 = new TestProcessor() + { + OnStartAction = (_) => { throw new Exception("Start exception"); }, + OnEndAction = (_) => { throw new Exception("End exception"); }, + }; using var activity = new Activity("test"); @@ -60,8 +66,8 @@ public void CompositeActivityProcessor_ProcessorThrows() [Fact] public void CompositeActivityProcessor_ShutsDownAll() { - using var p1 = new TestActivityProcessor(null, null); - using var p2 = new TestActivityProcessor(null, null); + using var p1 = new TestProcessor(); + using var p2 = new TestProcessor(); using var processor = new CompositeProcessor(new[] { p1, p2 }); processor.Shutdown(); @@ -75,8 +81,8 @@ public void CompositeActivityProcessor_ShutsDownAll() [InlineData(1)] public void CompositeActivityProcessor_ForceFlush(int timeout) { - using var p1 = new TestActivityProcessor(null, null); - using var p2 = new TestActivityProcessor(null, null); + using var p1 = new TestProcessor(); + using var p2 = new TestProcessor(); using var processor = new CompositeProcessor(new[] { p1, p2 }); processor.ForceFlush(timeout); @@ -90,8 +96,8 @@ public void CompositeActivityProcessor_ForwardsParentProvider() { using TracerProvider provider = new TestProvider(); - using var p1 = new TestActivityProcessor(null, null); - using var p2 = new TestActivityProcessor(null, null); + using var p1 = new TestProcessor(); + using var p2 = new TestProcessor(); using var processor = new CompositeProcessor(new[] { p1, p2 }); diff --git a/test/OpenTelemetry.Tests/Trace/TracerProviderExtensionsTest.cs b/test/OpenTelemetry.Tests/Trace/TracerProviderExtensionsTest.cs index 5722284db99..e301f0d1323 100644 --- a/test/OpenTelemetry.Tests/Trace/TracerProviderExtensionsTest.cs +++ b/test/OpenTelemetry.Tests/Trace/TracerProviderExtensionsTest.cs @@ -13,7 +13,7 @@ public class TracerProviderExtensionsTest [Fact] public void Verify_ForceFlush_HandlesException() { - using var testProcessor = new DelegatingProcessor(); + using var testProcessor = new TestProcessor(); using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(testProcessor) @@ -29,7 +29,7 @@ public void Verify_ForceFlush_HandlesException() [Fact] public void Verify_Shutdown_HandlesSecond() { - using var testProcessor = new DelegatingProcessor(); + using var testProcessor = new TestProcessor(); using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(testProcessor) @@ -42,7 +42,7 @@ public void Verify_Shutdown_HandlesSecond() [Fact] public void Verify_Shutdown_HandlesException() { - using var testProcessor = new DelegatingProcessor + using var testProcessor = new TestProcessor { OnShutdownFunc = (timeout) => throw new Exception("test exception"), }; diff --git a/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs b/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs index b78744b49b5..5a0e0bd7900 100644 --- a/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs +++ b/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs @@ -348,18 +348,18 @@ public void TracerSdkSetsActivitySamplingResultToNoneWhenSuppressInstrumentation [Fact] public void TracerSdkSetsActivityDataRequestedToFalseWhenSuppressInstrumentationIsTrueForLegacyActivity() { - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { endCalled = true; @@ -388,18 +388,18 @@ public void ProcessorDoesNotReceiveNotRecordDecisionSpan() { var activitySourceName = Utils.GetCurrentMethodName(); var testSampler = new TestSampler(); - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { endCalled = true; @@ -432,12 +432,12 @@ public void ProcessorDoesNotReceiveNotRecordDecisionSpan() [Fact] public void SdkDoesNotProcessLegacyActivityWithNoAdditionalConfig() { - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -445,7 +445,7 @@ public void SdkDoesNotProcessLegacyActivityWithNoAdditionalConfig() startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -488,12 +488,12 @@ public void SdkSamplesAndProcessesLegacyActivityWithRightConfig() }, }; - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.True(samplerCalled); @@ -502,7 +502,7 @@ public void SdkSamplesAndProcessesLegacyActivityWithRightConfig() startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -549,12 +549,12 @@ public void SdkSamplesAndProcessesLegacyActivityWithRightConfigOnWildCardMode() }, }; - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.True(samplerCalled); @@ -563,7 +563,7 @@ public void SdkSamplesAndProcessesLegacyActivityWithRightConfigOnWildCardMode() startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -599,12 +599,12 @@ public void SdkSamplesAndProcessesLegacyActivityWithRightConfigOnWildCardMode() [Fact] public void SdkCallsOnlyProcessorOnStartForLegacyActivityWhenActivitySourceIsUpdatedWithoutAddSource() { - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -612,7 +612,7 @@ public void SdkCallsOnlyProcessorOnStartForLegacyActivityWhenActivitySourceIsUpd startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -649,12 +649,12 @@ public void SdkCallsOnlyProcessorOnStartForLegacyActivityWhenActivitySourceIsUpd [Fact] public void SdkProcessesLegacyActivityWhenActivitySourceIsUpdatedWithAddSource() { - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -662,7 +662,7 @@ public void SdkProcessesLegacyActivityWhenActivitySourceIsUpdatedWithAddSource() startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -699,12 +699,12 @@ public void SdkProcessesLegacyActivityWhenActivitySourceIsUpdatedWithAddSource() [Fact] public void SdkProcessesLegacyActivityEvenAfterAddingNewProcessor() { - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); bool startCalled = false; bool endCalled = false; - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -712,7 +712,7 @@ public void SdkProcessesLegacyActivityEvenAfterAddingNewProcessor() startCalled = true; }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -739,12 +739,12 @@ public void SdkProcessesLegacyActivityEvenAfterAddingNewProcessor() // As Processors can be added anytime after Provider construction, the following validates // the following validates that updated processors are processing the legacy activities created from here on. - using var testActivityProcessorNew = new TestActivityProcessor(); + using var testActivityProcessorNew = new TestProcessor(); bool startCalledNew = false; bool endCalledNew = false; - testActivityProcessorNew.StartAction = + testActivityProcessorNew.OnStartAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -752,7 +752,7 @@ public void SdkProcessesLegacyActivityEvenAfterAddingNewProcessor() startCalledNew = true; }; - testActivityProcessorNew.EndAction = + testActivityProcessorNew.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation); @@ -1117,7 +1117,7 @@ public void TracerProviderSdkBuildsWithSDKResource(bool useConfigure) [Fact] public void TracerProviderSdkFlushesProcessorForcibly() { - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(testActivityProcessor) @@ -1143,11 +1143,11 @@ public void SdkSamplesAndProcessesLegacySourceWhenAddLegacySourceIsCalledWithWil }, }; - using TestActivityProcessor testActivityProcessor = new TestActivityProcessor(); + using var testActivityProcessor = new TestProcessor(); var onStartProcessedActivities = new List(); var onStopProcessedActivities = new List(); - testActivityProcessor.StartAction = + testActivityProcessor.OnStartAction = (a) => { Assert.Contains(a.OperationName, sampledActivities); @@ -1156,7 +1156,7 @@ public void SdkSamplesAndProcessesLegacySourceWhenAddLegacySourceIsCalledWithWil onStartProcessedActivities.Add(a.OperationName); }; - testActivityProcessor.EndAction = + testActivityProcessor.OnEndAction = (a) => { Assert.False(Sdk.SuppressInstrumentation);