From 877596981965fc0e25f70166dc500820cc4e8bec Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Mon, 9 Nov 2020 16:31:23 -0800 Subject: [PATCH] Remove RentrantExportProcessor as it is not required by spec (#1496) * Remove RentrantExportProcessor as it is not required by spec * clean up api doc * fix doc * remove deadlinks * remove test * more removals --- docs/logs/extending-the-sdk/README.md | 1 - docs/trace/extending-the-sdk/README.md | 1 - .../.publicApi/net452/PublicAPI.Unshipped.txt | 3 - .../.publicApi/net46/PublicAPI.Unshipped.txt | 3 - .../.publicApi/net461/PublicAPI.Unshipped.txt | 3 - .../netstandard2.0/PublicAPI.Unshipped.txt | 3 - src/OpenTelemetry/CHANGELOG.md | 1 + src/OpenTelemetry/ReentrantExportProcessor.cs | 51 ----------- .../ReentrantExportActivityProcessorTest.cs | 88 ------------------- 9 files changed, 1 insertion(+), 153 deletions(-) delete mode 100644 src/OpenTelemetry/ReentrantExportProcessor.cs delete mode 100644 test/OpenTelemetry.Tests/Trace/ReentrantExportActivityProcessorTest.cs diff --git a/docs/logs/extending-the-sdk/README.md b/docs/logs/extending-the-sdk/README.md index fefe47cb928..e623202ed4e 100644 --- a/docs/logs/extending-the-sdk/README.md +++ b/docs/logs/extending-the-sdk/README.md @@ -59,7 +59,6 @@ OpenTelemetry .NET SDK has provided the following built-in processors: * [BatchExportProcessor<T>](../../../src/OpenTelemetry/BatchExportProcessor.cs) * [CompositeProcessor<T>](../../../src/OpenTelemetry/CompositeProcessor.cs) -* [ReentrantExportProcessor<T>](../../../src/OpenTelemetry/ReentrantExportProcessor.cs) * [SimpleExportProcessor<T>](../../../src/OpenTelemetry/SimpleExportProcessor.cs) Custom processors can be implemented to cover more scenarios: diff --git a/docs/trace/extending-the-sdk/README.md b/docs/trace/extending-the-sdk/README.md index 61835c7bb50..fd1ee95bf5d 100644 --- a/docs/trace/extending-the-sdk/README.md +++ b/docs/trace/extending-the-sdk/README.md @@ -68,7 +68,6 @@ OpenTelemetry .NET SDK has provided the following built-in processors: * [BatchExportProcessor<T>](../../../src/OpenTelemetry/BatchExportProcessor.cs) * [CompositeProcessor<T>](../../../src/OpenTelemetry/CompositeProcessor.cs) -* [ReentrantExportProcessor<T>](../../../src/OpenTelemetry/ReentrantExportProcessor.cs) * [SimpleExportProcessor<T>](../../../src/OpenTelemetry/SimpleExportProcessor.cs) Custom processors can be implemented to cover more scenarios: diff --git a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt index 9161a0e61ec..de3447bd35a 100644 --- a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt @@ -109,8 +109,6 @@ OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Exp OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.ProviderExtensions -OpenTelemetry.ReentrantExportProcessor -OpenTelemetry.ReentrantExportProcessor.ReentrantExportProcessor(OpenTelemetry.BaseExporter exporter) -> void OpenTelemetry.Resources.Resource OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable> OpenTelemetry.Resources.Resource.Merge(OpenTelemetry.Resources.Resource other) -> OpenTelemetry.Resources.Resource @@ -213,7 +211,6 @@ override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator. override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable metrics) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void -override OpenTelemetry.ReentrantExportProcessor.OnEnd(T data) -> void override OpenTelemetry.SimpleExportProcessor.OnEnd(T data) -> void override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult override OpenTelemetry.Trace.AlwaysOnSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult diff --git a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt index 9161a0e61ec..de3447bd35a 100644 --- a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt @@ -109,8 +109,6 @@ OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Exp OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.ProviderExtensions -OpenTelemetry.ReentrantExportProcessor -OpenTelemetry.ReentrantExportProcessor.ReentrantExportProcessor(OpenTelemetry.BaseExporter exporter) -> void OpenTelemetry.Resources.Resource OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable> OpenTelemetry.Resources.Resource.Merge(OpenTelemetry.Resources.Resource other) -> OpenTelemetry.Resources.Resource @@ -213,7 +211,6 @@ override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator. override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable metrics) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void -override OpenTelemetry.ReentrantExportProcessor.OnEnd(T data) -> void override OpenTelemetry.SimpleExportProcessor.OnEnd(T data) -> void override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult override OpenTelemetry.Trace.AlwaysOnSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult diff --git a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt index 028dee03d98..edaf6a43faa 100644 --- a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt @@ -128,8 +128,6 @@ OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Exp OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.ProviderExtensions -OpenTelemetry.ReentrantExportProcessor -OpenTelemetry.ReentrantExportProcessor.ReentrantExportProcessor(OpenTelemetry.BaseExporter exporter) -> void OpenTelemetry.Resources.Resource OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable> OpenTelemetry.Resources.Resource.Merge(OpenTelemetry.Resources.Resource other) -> OpenTelemetry.Resources.Resource @@ -232,7 +230,6 @@ override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator. override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable metrics) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void -override OpenTelemetry.ReentrantExportProcessor.OnEnd(T data) -> void override OpenTelemetry.SimpleExportProcessor.OnEnd(T data) -> void override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult override OpenTelemetry.Trace.AlwaysOnSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult diff --git a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index 028dee03d98..edaf6a43faa 100644 --- a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -128,8 +128,6 @@ OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Exp OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder OpenTelemetry.ProviderExtensions -OpenTelemetry.ReentrantExportProcessor -OpenTelemetry.ReentrantExportProcessor.ReentrantExportProcessor(OpenTelemetry.BaseExporter exporter) -> void OpenTelemetry.Resources.Resource OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable> OpenTelemetry.Resources.Resource.Merge(OpenTelemetry.Resources.Resource other) -> OpenTelemetry.Resources.Resource @@ -232,7 +230,6 @@ override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator. override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable metrics) -> void override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void -override OpenTelemetry.ReentrantExportProcessor.OnEnd(T data) -> void override OpenTelemetry.SimpleExportProcessor.OnEnd(T data) -> void override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult override OpenTelemetry.Trace.AlwaysOnSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 94a57e3c9c1..e5a9475bbeb 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -10,6 +10,7 @@ * `Resource` is no longer added to observed `Activity` objects as a `CustomProperty`. ([#1463](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1463)) +* Remove RentrantExportProcessor as it is not required by spec. ## 0.8.0-beta.1 diff --git a/src/OpenTelemetry/ReentrantExportProcessor.cs b/src/OpenTelemetry/ReentrantExportProcessor.cs deleted file mode 100644 index c32d1d000d3..00000000000 --- a/src/OpenTelemetry/ReentrantExportProcessor.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using System; -using OpenTelemetry.Internal; - -namespace OpenTelemetry -{ - /// - /// Implements processor that exports telemetry data at each OnEnd call without synchronization. - /// - /// The type of telemetry object to be exported. - public class ReentrantExportProcessor : BaseExportProcessor - where T : class - { - /// - /// Initializes a new instance of the class. - /// - /// Exporter instance. - public ReentrantExportProcessor(BaseExporter exporter) - : base(exporter) - { - } - - /// - public override void OnEnd(T data) - { - try - { - this.exporter.Export(new Batch(data)); - } - catch (Exception ex) - { - OpenTelemetrySdkEventSource.Log.SpanProcessorException(nameof(this.OnEnd), ex); - } - } - } -} diff --git a/test/OpenTelemetry.Tests/Trace/ReentrantExportActivityProcessorTest.cs b/test/OpenTelemetry.Tests/Trace/ReentrantExportActivityProcessorTest.cs deleted file mode 100644 index b0fd4e17449..00000000000 --- a/test/OpenTelemetry.Tests/Trace/ReentrantExportActivityProcessorTest.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using OpenTelemetry.Exporter; -using Xunit; - -namespace OpenTelemetry.Trace.Tests -{ - public class ReentrantExportActivityProcessorTest - { - [Fact] - public void CheckNullExporter() - { - Assert.Throws(() => new ReentrantExportProcessor(null)); - } - - [Fact] - public void CheckExportedOnEnd() - { - var exportedItems = new List(); - using var exporter = new InMemoryExporter(new InMemoryExporterOptions { ExportedItems = exportedItems }); - using var processor = new ReentrantExportProcessor(exporter); - - processor.OnEnd(new Activity("start1")); - Assert.Single(exportedItems); - - processor.OnEnd(new Activity("start2")); - Assert.Equal(2, exportedItems.Count); - } - - [Theory] - [InlineData(Timeout.Infinite)] - [InlineData(0)] - [InlineData(1)] - public void CheckForceFlushExport(int timeout) - { - var exportedItems = new List(); - using var exporter = new InMemoryExporter(new InMemoryExporterOptions { ExportedItems = exportedItems }); - using var processor = new ReentrantExportProcessor(exporter); - - processor.OnEnd(new Activity("start1")); - processor.OnEnd(new Activity("start2")); - - // checking before force flush - Assert.Equal(2, exportedItems.Count); - - // forcing flush - processor.ForceFlush(timeout); - Assert.Equal(2, exportedItems.Count); - } - - [Theory] - [InlineData(Timeout.Infinite)] - [InlineData(0)] - [InlineData(1)] - public void CheckShutdownExport(int timeout) - { - var exportedItems = new List(); - using var exporter = new InMemoryExporter(new InMemoryExporterOptions { ExportedItems = exportedItems }); - using var processor = new ReentrantExportProcessor(exporter); - - processor.OnEnd(new Activity("start")); - - // checking before shutdown - Assert.Single(exportedItems); - - processor.Shutdown(timeout); - Assert.Single(exportedItems); - } - } -}