Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Exporter type to Zipkin exporter options #1504

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<System.Diagnostics.Activity> batch) -> OpenTelemetry.ExportResult
static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions> configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ 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
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<System.Diagnostics.Activity> batch) -> OpenTelemetry.ExportResult
static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions> configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ 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
utpilla marked this conversation as resolved.
Show resolved Hide resolved
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
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<System.Diagnostics.Activity> batch) -> OpenTelemetry.ExportResult
static OpenTelemetry.Trace.ZipkinExporterHelperExtensions.AddZipkinExporter(this OpenTelemetry.Trace.TracerProviderBuilder builder, System.Action<OpenTelemetry.Exporter.Zipkin.ZipkinExporterOptions> configure = null) -> OpenTelemetry.Trace.TracerProviderBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -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<Activity>(zipkinExporter));
if (exporterOptions.ExporterType == ZipkinExporterType.SimpleExportProcessor)
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
{
return builder.AddProcessor(new SimpleExportProcessor<Activity>(zipkinExporter));
utpilla marked this conversation as resolved.
Show resolved Hide resolved
}
else
{
return builder.AddProcessor(new BatchExportProcessor<Activity>(
zipkinExporter,
exporterOptions.MaxQueueSize,
exporterOptions.ScheduledDelayMilliseconds,
exporterOptions.ExporterTimeoutMilliseconds,
exporterOptions.MaxExportBatchSize));
}
}
}
}
25 changes: 25 additions & 0 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,30 @@ public sealed class ZipkinExporterOptions
/// </summary>
public int? MaxPayloadSizeInBytes { get; set; } = DefaultMaxPayloadSizeInBytes;
#endif

/// <summary>
/// Gets or sets the exporter type for Zipkin Exporter.
utpilla marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
public ZipkinExporterType ExporterType { get; set; } = ZipkinExporterType.SimpleExportProcessor;
utpilla marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Gets or sets the maxQueueSize for BatchExport.
/// </summary>
public int MaxQueueSize { get; set; } = 2048;
utpilla marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Gets or sets the scheduledDelayMilliseconds for BatchExport.
/// </summary>
public int ScheduledDelayMilliseconds { get; set; } = 5000;

/// <summary>
/// Gets or sets the exporterTimeoutMilliseconds for BatchExport.
/// </summary>
public int ExporterTimeoutMilliseconds { get; set; } = 30000;

/// <summary>
/// Gets or sets the maxExportBatchSize for BatchExport.
/// </summary>
public int MaxExportBatchSize { get; set; } = 512;
}
}
24 changes: 24 additions & 0 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems most of the using statements are not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this.

using System.Text;
using System.Threading.Tasks;

namespace OpenTelemetry.Exporter.Zipkin
{
/// <summary>
/// Type of exporter to be used.
/// </summary>
public enum ZipkinExporterType
utpilla marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Use SimpleExportProcessor
/// </summary>
SimpleExportProcessor,

/// <summary>
/// Use BatchExportProcessor
/// </summary>
BatchExportProcessor,
}
}