From af3a52ece43f219306696a081df7e84f5ae40c22 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Tue, 10 Nov 2020 20:33:52 -0800 Subject: [PATCH 01/12] Added Exporter type to Zipkin exporter options --- .../.publicApi/net452/PublicAPI.Unshipped.txt | 13 ++++++++++ .../.publicApi/net461/PublicAPI.Unshipped.txt | 13 ++++++++++ .../netstandard2.0/PublicAPI.Unshipped.txt | 13 ++++++++++ .../ZipkinExporterHelperExtensions.cs | 15 +++++++++-- .../ZipkinExporterOptions.cs | 25 +++++++++++++++++++ .../ZipkinExporterType.cs | 24 ++++++++++++++++++ 6 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt index 5bcb106cefa..b000a3abd48 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt @@ -2,11 +2,24 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ZipkinExporterOptions() -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.BatchExportProcessor = 1 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.Zipkin.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt index aa6959fed0a..35ed101022d 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt @@ -2,6 +2,16 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.get -> int? OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string @@ -9,6 +19,9 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ZipkinExporterOptions() -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.BatchExportProcessor = 1 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.Zipkin.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index aa6959fed0a..35ed101022d 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -2,6 +2,16 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.get -> int? OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string @@ -9,6 +19,9 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ZipkinExporterOptions() -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.BatchExportProcessor = 1 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.Zipkin.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs index 19ad7df3e81..f6bcf88c7ca 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs @@ -43,8 +43,19 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder configure?.Invoke(exporterOptions); var zipkinExporter = new ZipkinExporter(exporterOptions); - // TODO: Pick Simple vs Batching based on ZipkinExporterOptions - return builder.AddProcessor(new BatchExportProcessor(zipkinExporter)); + if (exporterOptions.ExporterType == ZipkinExporterType.SimpleExportProcessor) + { + return builder.AddProcessor(new SimpleExportProcessor(zipkinExporter)); + } + else + { + return builder.AddProcessor(new BatchExportProcessor( + zipkinExporter, + exporterOptions.MaxQueueSize, + exporterOptions.ScheduledDelayMilliseconds, + exporterOptions.ExporterTimeoutMilliseconds, + exporterOptions.MaxExportBatchSize)); + } } } } diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index 900bf43f6ec..f9109ae9634 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -51,5 +51,30 @@ public sealed class ZipkinExporterOptions /// public int? MaxPayloadSizeInBytes { get; set; } = DefaultMaxPayloadSizeInBytes; #endif + + /// + /// Gets or sets the exporter type for Zipkin Exporter. + /// + public ZipkinExporterType ExporterType { get; set; } = ZipkinExporterType.SimpleExportProcessor; + + /// + /// Gets or sets the maxQueueSize for BatchExport. + /// + public int MaxQueueSize { get; set; } = 2048; + + /// + /// Gets or sets the scheduledDelayMilliseconds for BatchExport. + /// + public int ScheduledDelayMilliseconds { get; set; } = 5000; + + /// + /// Gets or sets the exporterTimeoutMilliseconds for BatchExport. + /// + public int ExporterTimeoutMilliseconds { get; set; } = 30000; + + /// + /// Gets or sets the maxExportBatchSize for BatchExport. + /// + public int MaxExportBatchSize { get; set; } = 512; } } diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs new file mode 100644 index 00000000000..08fdc576511 --- /dev/null +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OpenTelemetry.Exporter.Zipkin +{ + /// + /// Type of exporter to be used. + /// + public enum ZipkinExporterType + { + /// + /// Use SimpleExportProcessor + /// + SimpleExportProcessor, + + /// + /// Use BatchExportProcessor + /// + BatchExportProcessor, + } +} From 860357e6ae9eb2979331ec1380d73f3bc5fc33db Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Tue, 10 Nov 2020 21:12:42 -0800 Subject: [PATCH 02/12] Removed unnecessary using statements --- src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs index 08fdc576511..ec784d303a7 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace OpenTelemetry.Exporter.Zipkin { /// From a656c3391cadb83e78b8e7478164002b1d50f66a Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Tue, 10 Nov 2020 21:25:39 -0800 Subject: [PATCH 03/12] Added header to the ZipkinExporterType.cs file --- .../ZipkinExporterType.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs index ec784d303a7..6aef38b09ec 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs @@ -1,3 +1,19 @@ +// +// 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. +// + namespace OpenTelemetry.Exporter.Zipkin { /// From e625a8630c5dbc549dc4a90d609accfccd866df8 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Wed, 11 Nov 2020 01:07:32 -0800 Subject: [PATCH 04/12] Addressing PR changes --- .../.publicApi/net452/PublicAPI.Unshipped.txt | 15 ++------ .../.publicApi/net461/PublicAPI.Unshipped.txt | 15 ++------ .../netstandard2.0/PublicAPI.Unshipped.txt | 15 ++------ .../ZipkinExporterHelperExtensions.cs | 10 +++--- .../ZipkinExporterOptions.cs | 21 ++---------- .../.publicApi/net452/PublicAPI.Unshipped.txt | 13 +++++++ .../.publicApi/net46/PublicAPI.Unshipped.txt | 13 +++++++ .../.publicApi/net461/PublicAPI.Unshipped.txt | 13 +++++++ .../netstandard2.0/PublicAPI.Unshipped.txt | 13 +++++++ src/OpenTelemetry/BatchExportProcessor.cs | 8 ++--- .../BatchExportProcessorDefaultOptions.cs | 32 +++++++++++++++++ .../BatchExportProcessorOptions.cs | 34 +++++++++++++++++++ .../ExporterType.cs} | 4 +-- 13 files changed, 141 insertions(+), 65 deletions(-) create mode 100644 src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs create mode 100644 src/OpenTelemetry/BatchExportProcessorOptions.cs rename src/{OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs => OpenTelemetry/ExporterType.cs} (93%) diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt index b000a3abd48..36383b067e7 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt @@ -1,25 +1,16 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.ExporterType OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ZipkinExporterOptions() -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.BatchExportProcessor = 1 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.Zipkin.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt index 35ed101022d..39c663f6d86 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt @@ -1,17 +1,11 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.ExporterType OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.get -> int? OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string @@ -19,9 +13,6 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ZipkinExporterOptions() -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.BatchExportProcessor = 1 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.Zipkin.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index 35ed101022d..39c663f6d86 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,17 +1,11 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.ExporterType OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxExportBatchSize.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxQueueSize.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.get -> int? OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string @@ -19,9 +13,6 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ZipkinExporterOptions() -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.BatchExportProcessor = 1 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.Exporter.Zipkin.ZipkinExporterType OpenTelemetry.Trace.ZipkinExporterHelperExtensions override OpenTelemetry.Exporter.Zipkin.ZipkinExporter.Export(in OpenTelemetry.Batch batch) -> OpenTelemetry.ExportResult static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs index f6bcf88c7ca..640da5cd8b7 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs @@ -43,7 +43,7 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder configure?.Invoke(exporterOptions); var zipkinExporter = new ZipkinExporter(exporterOptions); - if (exporterOptions.ExporterType == ZipkinExporterType.SimpleExportProcessor) + if (exporterOptions.ExporterType == ExporterType.SimpleExportProcessor) { return builder.AddProcessor(new SimpleExportProcessor(zipkinExporter)); } @@ -51,10 +51,10 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder { return builder.AddProcessor(new BatchExportProcessor( zipkinExporter, - exporterOptions.MaxQueueSize, - exporterOptions.ScheduledDelayMilliseconds, - exporterOptions.ExporterTimeoutMilliseconds, - exporterOptions.MaxExportBatchSize)); + exporterOptions.BatchExportProcessorOptions.MaxQueueSize, + exporterOptions.BatchExportProcessorOptions.ScheduledDelayMilliseconds, + exporterOptions.BatchExportProcessorOptions.ExporterTimeoutMilliseconds, + exporterOptions.BatchExportProcessorOptions.MaxExportBatchSize)); } } } diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index f9109ae9634..53b113c7875 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -55,26 +55,11 @@ public sealed class ZipkinExporterOptions /// /// Gets or sets the exporter type for Zipkin Exporter. /// - public ZipkinExporterType ExporterType { get; set; } = ZipkinExporterType.SimpleExportProcessor; + public ExporterType ExporterType { get; set; } = ExporterType.BatchExportProcessor; /// - /// Gets or sets the maxQueueSize for BatchExport. + /// Gets or sets get or sets the BatchExportProcessor options. /// - public int MaxQueueSize { get; set; } = 2048; - - /// - /// Gets or sets the scheduledDelayMilliseconds for BatchExport. - /// - public int ScheduledDelayMilliseconds { get; set; } = 5000; - - /// - /// Gets or sets the exporterTimeoutMilliseconds for BatchExport. - /// - public int ExporterTimeoutMilliseconds { get; set; } = 30000; - - /// - /// Gets or sets the maxExportBatchSize for BatchExport. - /// - public int MaxExportBatchSize { get; set; } = 512; + public BatchExportProcessorOptions BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions(); } } diff --git a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt index de3447bd35a..118dfa7e29f 100644 --- a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt @@ -22,9 +22,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void +OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt index de3447bd35a..118dfa7e29f 100644 --- a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt @@ -22,9 +22,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void +OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt index edaf6a43faa..2603f0e056f 100644 --- a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt @@ -23,9 +23,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void +OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index edaf6a43faa..2603f0e056f 100644 --- a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -23,9 +23,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void +OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType +OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/BatchExportProcessor.cs b/src/OpenTelemetry/BatchExportProcessor.cs index 504b0df897f..baa70b47bb0 100644 --- a/src/OpenTelemetry/BatchExportProcessor.cs +++ b/src/OpenTelemetry/BatchExportProcessor.cs @@ -49,10 +49,10 @@ public class BatchExportProcessor : BaseExportProcessor /// The maximum batch size of every export. It must be smaller or equal to maxQueueSize. The default value is 512. public BatchExportProcessor( BaseExporter exporter, - int maxQueueSize = 2048, - int scheduledDelayMilliseconds = 5000, - int exporterTimeoutMilliseconds = 30000, - int maxExportBatchSize = 512) + int maxQueueSize = BatchExportProcessorDefaultOptions.MaxQueueSize, + int scheduledDelayMilliseconds = BatchExportProcessorDefaultOptions.ScheduledDelayMilliseconds, + int exporterTimeoutMilliseconds = BatchExportProcessorDefaultOptions.ExporterTimeoutMilliseconds, + int maxExportBatchSize = BatchExportProcessorDefaultOptions.MaxExportBatchSize) : base(exporter) { if (maxQueueSize <= 0) diff --git a/src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs b/src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs new file mode 100644 index 00000000000..dda7c16f6b0 --- /dev/null +++ b/src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs @@ -0,0 +1,32 @@ +// +// 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.Diagnostics; +using System.Threading; +using OpenTelemetry.Internal; + +namespace OpenTelemetry +{ + + internal static class BatchExportProcessorDefaultOptions + { + public const int MaxQueueSize = 2048; + public const int ScheduledDelayMilliseconds = 5000; + public const int ExporterTimeoutMilliseconds = 30000; + public const int MaxExportBatchSize = 512; + } +} diff --git a/src/OpenTelemetry/BatchExportProcessorOptions.cs b/src/OpenTelemetry/BatchExportProcessorOptions.cs new file mode 100644 index 00000000000..8c1f6b110e6 --- /dev/null +++ b/src/OpenTelemetry/BatchExportProcessorOptions.cs @@ -0,0 +1,34 @@ +// +// 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.Diagnostics; +using System.Threading; +using OpenTelemetry.Internal; + +namespace OpenTelemetry +{ + public class BatchExportProcessorOptions + { + public int MaxQueueSize { get; set; } = BatchExportProcessorDefaultOptions.MaxQueueSize; + + public int ScheduledDelayMilliseconds { get; set; } = BatchExportProcessorDefaultOptions.ScheduledDelayMilliseconds; + + public int ExporterTimeoutMilliseconds { get; set; } = BatchExportProcessorDefaultOptions.ExporterTimeoutMilliseconds; + + public int MaxExportBatchSize { get; set; } = BatchExportProcessorDefaultOptions.MaxExportBatchSize; + } +} diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs b/src/OpenTelemetry/ExporterType.cs similarity index 93% rename from src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs rename to src/OpenTelemetry/ExporterType.cs index 6aef38b09ec..040cc93e7ed 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs +++ b/src/OpenTelemetry/ExporterType.cs @@ -14,12 +14,12 @@ // limitations under the License. // -namespace OpenTelemetry.Exporter.Zipkin +namespace OpenTelemetry { /// /// Type of exporter to be used. /// - public enum ZipkinExporterType + public enum ExporterType { /// /// Use SimpleExportProcessor From 7db380b743fb9937deeefd48c68027660344f75a Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Wed, 11 Nov 2020 13:52:06 -0800 Subject: [PATCH 05/12] Address PR comments --- .../.publicApi/net452/PublicAPI.Unshipped.txt | 6 ++-- .../.publicApi/net461/PublicAPI.Unshipped.txt | 6 ++-- .../netstandard2.0/PublicAPI.Unshipped.txt | 6 ++-- .../ZipkinExporterHelperExtensions.cs | 8 ++--- .../ZipkinExporterOptions.cs | 5 +-- .../.publicApi/net452/PublicAPI.Unshipped.txt | 30 +++++++++-------- .../.publicApi/net46/PublicAPI.Unshipped.txt | 30 +++++++++-------- .../.publicApi/net461/PublicAPI.Unshipped.txt | 30 +++++++++-------- .../netstandard2.0/PublicAPI.Unshipped.txt | 30 +++++++++-------- src/OpenTelemetry/BatchExportProcessor.cs | 13 +++++--- .../BatchExportProcessorDefaultOptions.cs | 32 ------------------- .../BatchExportProcessorOptions.cs | 23 ++++++++++--- ...ExporterType.cs => ExportProcessorType.cs} | 4 +-- 13 files changed, 113 insertions(+), 110 deletions(-) delete mode 100644 src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs rename src/OpenTelemetry/{ExporterType.cs => ExportProcessorType.cs} (89%) diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt index 36383b067e7..aeffcfd41fd 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net452/PublicAPI.Unshipped.txt @@ -1,11 +1,11 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.ExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExportProcessorType.get -> OpenTelemetry.ExportProcessorType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExportProcessorType.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.UseShortTraceIds.get -> bool diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt index 39c663f6d86..cfe22a6e116 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/net461/PublicAPI.Unshipped.txt @@ -1,11 +1,11 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.ExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExportProcessorType.get -> OpenTelemetry.ExportProcessorType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExportProcessorType.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.get -> int? OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string diff --git a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index 39c663f6d86..cfe22a6e116 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.Zipkin/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,11 +1,11 @@ OpenTelemetry.Exporter.Zipkin.ZipkinExporter OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.get -> OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.BatchExportProcessorOptions.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.get -> System.Uri OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.Endpoint.set -> void -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.get -> OpenTelemetry.ExporterType -OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExporterType.set -> void +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExportProcessorType.get -> OpenTelemetry.ExportProcessorType +OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ExportProcessorType.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.get -> int? OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.MaxPayloadSizeInBytes.set -> void OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions.ServiceName.get -> string diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs index 640da5cd8b7..3080afb5f8f 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs @@ -43,7 +43,7 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder configure?.Invoke(exporterOptions); var zipkinExporter = new ZipkinExporter(exporterOptions); - if (exporterOptions.ExporterType == ExporterType.SimpleExportProcessor) + if (exporterOptions.ExportProcessorType == ExportProcessorType.SimpleExportProcessor) { return builder.AddProcessor(new SimpleExportProcessor(zipkinExporter)); } @@ -51,10 +51,10 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder { return builder.AddProcessor(new BatchExportProcessor( zipkinExporter, - exporterOptions.BatchExportProcessorOptions.MaxQueueSize, + exporterOptions.BatchExportProcessorOptions.MaxQueueLength, exporterOptions.BatchExportProcessorOptions.ScheduledDelayMilliseconds, - exporterOptions.BatchExportProcessorOptions.ExporterTimeoutMilliseconds, - exporterOptions.BatchExportProcessorOptions.MaxExportBatchSize)); + exporterOptions.BatchExportProcessorOptions.TimeoutMilliseconds, + exporterOptions.BatchExportProcessorOptions.MaxBatchSize)); } } } diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index 53b113c7875..15e44030d5a 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -15,6 +15,7 @@ // using System; +using System.Diagnostics; namespace OpenTelemetry.Exporter.Zipkin { @@ -55,11 +56,11 @@ public sealed class ZipkinExporterOptions /// /// Gets or sets the exporter type for Zipkin Exporter. /// - public ExporterType ExporterType { get; set; } = ExporterType.BatchExportProcessor; + public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.BatchExportProcessor; /// /// Gets or sets get or sets the BatchExportProcessor options. /// - public BatchExportProcessorOptions BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions(); + public BatchExportProcessorOptions BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions(); } } diff --git a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt index 118dfa7e29f..e1156eeb51e 100644 --- a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt @@ -1,3 +1,7 @@ +const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int +const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int +const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int +const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor OpenTelemetry.BaseExportProcessor.BaseExportProcessor(OpenTelemetry.BaseExporter exporter) -> void @@ -22,22 +26,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void -OpenTelemetry.BatchExportProcessorOptions -OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void -OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType +OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt index 118dfa7e29f..e1156eeb51e 100644 --- a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt @@ -1,3 +1,7 @@ +const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int +const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int +const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int +const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor OpenTelemetry.BaseExportProcessor.BaseExportProcessor(OpenTelemetry.BaseExporter exporter) -> void @@ -22,22 +26,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void -OpenTelemetry.BatchExportProcessorOptions -OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void -OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType +OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt index 2603f0e056f..56dd27c14fe 100644 --- a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt @@ -1,3 +1,7 @@ +const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int +const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int +const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int +const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor @@ -23,22 +27,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void -OpenTelemetry.BatchExportProcessorOptions -OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void -OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType +OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index 2603f0e056f..56dd27c14fe 100644 --- a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,3 +1,7 @@ +const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int +const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int +const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int +const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor @@ -23,22 +27,22 @@ OpenTelemetry.Batch.Enumerator.Reset() -> void OpenTelemetry.Batch.GetEnumerator() -> OpenTelemetry.Batch.Enumerator OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void -OpenTelemetry.BatchExportProcessorOptions -OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions +OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void -OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.BatchExportProcessor = 1 -> OpenTelemetry.ExporterType -OpenTelemetry.ExporterType.SimpleExportProcessor = 0 -> OpenTelemetry.ExporterType +OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/BatchExportProcessor.cs b/src/OpenTelemetry/BatchExportProcessor.cs index baa70b47bb0..929f1d0d4b1 100644 --- a/src/OpenTelemetry/BatchExportProcessor.cs +++ b/src/OpenTelemetry/BatchExportProcessor.cs @@ -28,6 +28,11 @@ namespace OpenTelemetry public class BatchExportProcessor : BaseExportProcessor where T : class { + public const int DefaultMaxQueueLength = 2048; + public const int DefaultScheduledDelayMilliseconds = 5000; + public const int DefaultTimeoutMilliseconds = 30000; + public const int DefaultMaxBatchSize = 512; + private readonly CircularBuffer circularBuffer; private readonly int scheduledDelayMilliseconds; private readonly int exporterTimeoutMilliseconds; @@ -49,10 +54,10 @@ public class BatchExportProcessor : BaseExportProcessor /// The maximum batch size of every export. It must be smaller or equal to maxQueueSize. The default value is 512. public BatchExportProcessor( BaseExporter exporter, - int maxQueueSize = BatchExportProcessorDefaultOptions.MaxQueueSize, - int scheduledDelayMilliseconds = BatchExportProcessorDefaultOptions.ScheduledDelayMilliseconds, - int exporterTimeoutMilliseconds = BatchExportProcessorDefaultOptions.ExporterTimeoutMilliseconds, - int maxExportBatchSize = BatchExportProcessorDefaultOptions.MaxExportBatchSize) + int maxQueueSize = DefaultMaxQueueLength, + int scheduledDelayMilliseconds = DefaultScheduledDelayMilliseconds, + int exporterTimeoutMilliseconds = DefaultTimeoutMilliseconds, + int maxExportBatchSize = DefaultMaxBatchSize) : base(exporter) { if (maxQueueSize <= 0) diff --git a/src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs b/src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs deleted file mode 100644 index dda7c16f6b0..00000000000 --- a/src/OpenTelemetry/BatchExportProcessorDefaultOptions.cs +++ /dev/null @@ -1,32 +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.Diagnostics; -using System.Threading; -using OpenTelemetry.Internal; - -namespace OpenTelemetry -{ - - internal static class BatchExportProcessorDefaultOptions - { - public const int MaxQueueSize = 2048; - public const int ScheduledDelayMilliseconds = 5000; - public const int ExporterTimeoutMilliseconds = 30000; - public const int MaxExportBatchSize = 512; - } -} diff --git a/src/OpenTelemetry/BatchExportProcessorOptions.cs b/src/OpenTelemetry/BatchExportProcessorOptions.cs index 8c1f6b110e6..105eb90665a 100644 --- a/src/OpenTelemetry/BatchExportProcessorOptions.cs +++ b/src/OpenTelemetry/BatchExportProcessorOptions.cs @@ -21,14 +21,27 @@ namespace OpenTelemetry { - public class BatchExportProcessorOptions + public class BatchExportProcessorOptions + where T : class { - public int MaxQueueSize { get; set; } = BatchExportProcessorDefaultOptions.MaxQueueSize; + /// + /// Gets or sets the maximum queue size. The queue drops the data if the maximum size is reached. The default value is 2048. + /// + public int MaxQueueLength { get; set; } = BatchExportProcessor.DefaultMaxQueueLength; - public int ScheduledDelayMilliseconds { get; set; } = BatchExportProcessorDefaultOptions.ScheduledDelayMilliseconds; + /// + /// Gets or sets the delay interval (in milliseconds) between two consecutive exports. The default value is 5000. + /// + public int ScheduledDelayMilliseconds { get; set; } = BatchExportProcessor.DefaultScheduledDelayMilliseconds; - public int ExporterTimeoutMilliseconds { get; set; } = BatchExportProcessorDefaultOptions.ExporterTimeoutMilliseconds; + /// + /// Gets or sets the timeout (in milliseconds) after which the export is cancelled. The default value is 30000. + /// + public int TimeoutMilliseconds { get; set; } = BatchExportProcessor.DefaultTimeoutMilliseconds; - public int MaxExportBatchSize { get; set; } = BatchExportProcessorDefaultOptions.MaxExportBatchSize; + /// + /// Gets or sets the maximum batch size of every export. It must be smaller or equal to MaxQueueLength. The default value is 512. + /// + public int MaxBatchSize { get; set; } = BatchExportProcessor.DefaultMaxBatchSize; } } diff --git a/src/OpenTelemetry/ExporterType.cs b/src/OpenTelemetry/ExportProcessorType.cs similarity index 89% rename from src/OpenTelemetry/ExporterType.cs rename to src/OpenTelemetry/ExportProcessorType.cs index 040cc93e7ed..80dc15ddf21 100644 --- a/src/OpenTelemetry/ExporterType.cs +++ b/src/OpenTelemetry/ExportProcessorType.cs @@ -1,4 +1,4 @@ -// +// // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,7 @@ namespace OpenTelemetry /// /// Type of exporter to be used. /// - public enum ExporterType + public enum ExportProcessorType { /// /// Use SimpleExportProcessor From 657e5f3d2c0255c42421c8fd612af4e5ea99165f Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Wed, 11 Nov 2020 16:39:10 -0800 Subject: [PATCH 06/12] Updated CHANGELOG.md --- src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md index 6fefb484ef2..03b108c33e0 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Added ExportProcessorType to exporter options + ([#1504](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1504)) + ## 0.8.0-beta.1 Released 2020-Nov-5 From 0799d11842bceba74e4befde149127528bcefc7d Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Wed, 11 Nov 2020 23:23:12 -0800 Subject: [PATCH 07/12] Addressed PR comments --- src/OpenTelemetry/ExportProcessorType.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/OpenTelemetry/ExportProcessorType.cs b/src/OpenTelemetry/ExportProcessorType.cs index 80dc15ddf21..11541f69a91 100644 --- a/src/OpenTelemetry/ExportProcessorType.cs +++ b/src/OpenTelemetry/ExportProcessorType.cs @@ -17,17 +17,21 @@ namespace OpenTelemetry { /// - /// Type of exporter to be used. + /// Type of Export Processor to be used. /// public enum ExportProcessorType { /// - /// Use SimpleExportProcessor + /// Use SimpleExportProcessor. + /// Refer to the + /// specifcation for more information. /// SimpleExportProcessor, /// - /// Use BatchExportProcessor + /// Use BatchExportProcessor. + /// Refer to + /// specification for more information. /// BatchExportProcessor, } From 9337d4ebc1f88a1f6ea03f05dd8898e1c2b67911 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Thu, 12 Nov 2020 12:58:28 -0800 Subject: [PATCH 08/12] Update src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs Co-authored-by: Cijo Thomas --- src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index 15e44030d5a..3153da5325d 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -54,7 +54,7 @@ public sealed class ZipkinExporterOptions #endif /// - /// Gets or sets the exporter type for Zipkin Exporter. + /// Gets or sets the export processor type to be used with Zipkin Exporter. /// public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.BatchExportProcessor; From f350cfcefd3aadbd782ace4ea5b484dc55970c21 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Thu, 12 Nov 2020 12:58:51 -0800 Subject: [PATCH 09/12] Update src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs Co-authored-by: Cijo Thomas --- src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index 3153da5325d..6df41719c25 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -59,7 +59,7 @@ public sealed class ZipkinExporterOptions public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.BatchExportProcessor; /// - /// Gets or sets get or sets the BatchExportProcessor options. + /// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is BatchExporter /// public BatchExportProcessorOptions BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions(); } From 6a481726ea8184b3ec128532d24ba8aa02aa1c0f Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Thu, 12 Nov 2020 13:00:56 -0800 Subject: [PATCH 10/12] Addressed PR comments --- .../ZipkinExporterHelperExtensions.cs | 2 +- src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs | 2 +- src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt | 4 ++-- src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt | 4 ++-- src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt | 4 ++-- .../.publicApi/netstandard2.0/PublicAPI.Unshipped.txt | 4 ++-- src/OpenTelemetry/ExportProcessorType.cs | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs index 3080afb5f8f..6b06eaa43d8 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs @@ -43,7 +43,7 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder configure?.Invoke(exporterOptions); var zipkinExporter = new ZipkinExporter(exporterOptions); - if (exporterOptions.ExportProcessorType == ExportProcessorType.SimpleExportProcessor) + if (exporterOptions.ExportProcessorType == ExportProcessorType.Simple) { return builder.AddProcessor(new SimpleExportProcessor(zipkinExporter)); } diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index 15e44030d5a..ccba66e2161 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -56,7 +56,7 @@ public sealed class ZipkinExporterOptions /// /// Gets or sets the exporter type for Zipkin Exporter. /// - public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.BatchExportProcessor; + public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.Batch; /// /// Gets or sets get or sets the BatchExportProcessor options. diff --git a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt index e1156eeb51e..18696012392 100644 --- a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt @@ -40,8 +40,8 @@ OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Batch = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Simple = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt index e1156eeb51e..18696012392 100644 --- a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt @@ -40,8 +40,8 @@ OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Batch = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Simple = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt index 56dd27c14fe..fb5f9482703 100644 --- a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt @@ -41,8 +41,8 @@ OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Batch = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Simple = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index 56dd27c14fe..fb5f9482703 100644 --- a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -41,8 +41,8 @@ OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.BatchExportProcessor = 1 -> OpenTelemetry.ExportProcessorType -OpenTelemetry.ExportProcessorType.SimpleExportProcessor = 0 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Batch = 1 -> OpenTelemetry.ExportProcessorType +OpenTelemetry.ExportProcessorType.Simple = 0 -> OpenTelemetry.ExportProcessorType OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult diff --git a/src/OpenTelemetry/ExportProcessorType.cs b/src/OpenTelemetry/ExportProcessorType.cs index 11541f69a91..77f5739381b 100644 --- a/src/OpenTelemetry/ExportProcessorType.cs +++ b/src/OpenTelemetry/ExportProcessorType.cs @@ -26,13 +26,13 @@ public enum ExportProcessorType /// Refer to the /// specifcation for more information. /// - SimpleExportProcessor, + Simple, /// /// Use BatchExportProcessor. /// Refer to /// specification for more information. /// - BatchExportProcessor, + Batch, } } From 48f726acab6ee8d140199726b8602cba0e12dccd Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Thu, 12 Nov 2020 17:14:04 -0800 Subject: [PATCH 11/12] Addressed PR comments --- .../ZipkinExporterHelperExtensions.cs | 6 +++--- .../ZipkinExporterOptions.cs | 2 +- .../.publicApi/net452/PublicAPI.Unshipped.txt | 16 ++++++---------- .../.publicApi/net46/PublicAPI.Unshipped.txt | 16 ++++++---------- .../.publicApi/net461/PublicAPI.Unshipped.txt | 16 ++++++---------- .../netstandard2.0/PublicAPI.Unshipped.txt | 16 ++++++---------- src/OpenTelemetry/BatchExportProcessor.cs | 14 +++++++------- src/OpenTelemetry/BatchExportProcessorOptions.cs | 6 +++--- 8 files changed, 38 insertions(+), 54 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs index 6b06eaa43d8..251845a0e20 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterHelperExtensions.cs @@ -51,10 +51,10 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder { return builder.AddProcessor(new BatchExportProcessor( zipkinExporter, - exporterOptions.BatchExportProcessorOptions.MaxQueueLength, + exporterOptions.BatchExportProcessorOptions.MaxQueueSize, exporterOptions.BatchExportProcessorOptions.ScheduledDelayMilliseconds, - exporterOptions.BatchExportProcessorOptions.TimeoutMilliseconds, - exporterOptions.BatchExportProcessorOptions.MaxBatchSize)); + exporterOptions.BatchExportProcessorOptions.ExporterTimeoutMilliseconds, + exporterOptions.BatchExportProcessorOptions.MaxExportBatchSize)); } } } diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs index 99b7baaf596..dfe1e82e953 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs @@ -59,7 +59,7 @@ public sealed class ZipkinExporterOptions public ExportProcessorType ExportProcessorType { get; set; } = ExportProcessorType.Batch; /// - /// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is BatchExporter + /// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is BatchExporter. /// public BatchExportProcessorOptions BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions(); } diff --git a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt index 18696012392..5cc0b0c96cd 100644 --- a/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt @@ -1,7 +1,3 @@ -const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int -const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int -const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int -const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor OpenTelemetry.BaseExportProcessor.BaseExportProcessor(OpenTelemetry.BaseExporter exporter) -> void @@ -28,14 +24,14 @@ OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void diff --git a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt index 18696012392..5cc0b0c96cd 100644 --- a/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt @@ -1,7 +1,3 @@ -const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int -const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int -const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int -const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor OpenTelemetry.BaseExportProcessor.BaseExportProcessor(OpenTelemetry.BaseExporter exporter) -> void @@ -28,14 +24,14 @@ OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void diff --git a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt index fb5f9482703..cd5aa877061 100644 --- a/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt @@ -1,7 +1,3 @@ -const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int -const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int -const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int -const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor @@ -29,14 +25,14 @@ OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void diff --git a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index fb5f9482703..cd5aa877061 100644 --- a/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,7 +1,3 @@ -const OpenTelemetry.BatchExportProcessor.DefaultMaxBatchSize = 512 -> int -const OpenTelemetry.BatchExportProcessor.DefaultMaxQueueLength = 2048 -> int -const OpenTelemetry.BatchExportProcessor.DefaultScheduledDelayMilliseconds = 5000 -> int -const OpenTelemetry.BatchExportProcessor.DefaultTimeoutMilliseconds = 30000 -> int Microsoft.Extensions.Logging.OpenTelemetryLoggingExtensions OpenTelemetry.BaseExporter.ParentProvider.get -> OpenTelemetry.BaseProvider OpenTelemetry.BaseExportProcessor @@ -29,14 +25,14 @@ OpenTelemetry.BatchExportProcessor OpenTelemetry.BatchExportProcessor.BatchExportProcessor(OpenTelemetry.BaseExporter exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void OpenTelemetry.BatchExportProcessorOptions OpenTelemetry.BatchExportProcessorOptions.BatchExportProcessorOptions() -> void -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxBatchSize.set -> void -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.get -> int -OpenTelemetry.BatchExportProcessorOptions.MaxQueueLength.set -> void +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.get -> int +OpenTelemetry.BatchExportProcessorOptions.ExporterTimeoutMilliseconds.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxExportBatchSize.set -> void +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.get -> int +OpenTelemetry.BatchExportProcessorOptions.MaxQueueSize.set -> void OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.get -> int OpenTelemetry.BatchExportProcessorOptions.ScheduledDelayMilliseconds.set -> void -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.get -> int -OpenTelemetry.BatchExportProcessorOptions.TimeoutMilliseconds.set -> void OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.AddProcessor(OpenTelemetry.BaseProcessor processor) -> OpenTelemetry.CompositeProcessor OpenTelemetry.CompositeProcessor.CompositeProcessor(System.Collections.Generic.IEnumerable> processors) -> void diff --git a/src/OpenTelemetry/BatchExportProcessor.cs b/src/OpenTelemetry/BatchExportProcessor.cs index 929f1d0d4b1..864475fd610 100644 --- a/src/OpenTelemetry/BatchExportProcessor.cs +++ b/src/OpenTelemetry/BatchExportProcessor.cs @@ -28,10 +28,10 @@ namespace OpenTelemetry public class BatchExportProcessor : BaseExportProcessor where T : class { - public const int DefaultMaxQueueLength = 2048; - public const int DefaultScheduledDelayMilliseconds = 5000; - public const int DefaultTimeoutMilliseconds = 30000; - public const int DefaultMaxBatchSize = 512; + internal const int DefaultMaxQueueSize = 2048; + internal const int DefaultScheduledDelayMilliseconds = 5000; + internal const int DefaultExporterTimeoutMilliseconds = 30000; + internal const int DefaultMaxExportBatchSize = 512; private readonly CircularBuffer circularBuffer; private readonly int scheduledDelayMilliseconds; @@ -54,10 +54,10 @@ public class BatchExportProcessor : BaseExportProcessor /// The maximum batch size of every export. It must be smaller or equal to maxQueueSize. The default value is 512. public BatchExportProcessor( BaseExporter exporter, - int maxQueueSize = DefaultMaxQueueLength, + int maxQueueSize = DefaultMaxQueueSize, int scheduledDelayMilliseconds = DefaultScheduledDelayMilliseconds, - int exporterTimeoutMilliseconds = DefaultTimeoutMilliseconds, - int maxExportBatchSize = DefaultMaxBatchSize) + int exporterTimeoutMilliseconds = DefaultExporterTimeoutMilliseconds, + int maxExportBatchSize = DefaultMaxExportBatchSize) : base(exporter) { if (maxQueueSize <= 0) diff --git a/src/OpenTelemetry/BatchExportProcessorOptions.cs b/src/OpenTelemetry/BatchExportProcessorOptions.cs index 105eb90665a..61fcc6e61c4 100644 --- a/src/OpenTelemetry/BatchExportProcessorOptions.cs +++ b/src/OpenTelemetry/BatchExportProcessorOptions.cs @@ -27,7 +27,7 @@ public class BatchExportProcessorOptions /// /// Gets or sets the maximum queue size. The queue drops the data if the maximum size is reached. The default value is 2048. /// - public int MaxQueueLength { get; set; } = BatchExportProcessor.DefaultMaxQueueLength; + public int MaxQueueSize { get; set; } = BatchExportProcessor.DefaultMaxQueueSize; /// /// Gets or sets the delay interval (in milliseconds) between two consecutive exports. The default value is 5000. @@ -37,11 +37,11 @@ public class BatchExportProcessorOptions /// /// Gets or sets the timeout (in milliseconds) after which the export is cancelled. The default value is 30000. /// - public int TimeoutMilliseconds { get; set; } = BatchExportProcessor.DefaultTimeoutMilliseconds; + public int ExporterTimeoutMilliseconds { get; set; } = BatchExportProcessor.DefaultExporterTimeoutMilliseconds; /// /// Gets or sets the maximum batch size of every export. It must be smaller or equal to MaxQueueLength. The default value is 512. /// - public int MaxBatchSize { get; set; } = BatchExportProcessor.DefaultMaxBatchSize; + public int MaxExportBatchSize { get; set; } = BatchExportProcessor.DefaultMaxExportBatchSize; } } From cb790842d3fae77255f1fc41a6d8a9981a807a25 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai Date: Thu, 12 Nov 2020 18:10:54 -0800 Subject: [PATCH 12/12] Corrected spelling --- src/OpenTelemetry/ExportProcessorType.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry/ExportProcessorType.cs b/src/OpenTelemetry/ExportProcessorType.cs index 77f5739381b..37b4a8a7671 100644 --- a/src/OpenTelemetry/ExportProcessorType.cs +++ b/src/OpenTelemetry/ExportProcessorType.cs @@ -24,7 +24,7 @@ public enum ExportProcessorType /// /// Use SimpleExportProcessor. /// Refer to the - /// specifcation for more information. + /// specification for more information. /// Simple,