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 SimpleExporter and BatchExporter for Activity and LogRecord #1622

Merged
2 changes: 1 addition & 1 deletion docs/logs/extending-the-sdk/LoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public static OpenTelemetryLoggerOptions AddMyExporter(this OpenTelemetryLoggerO
throw new ArgumentNullException(nameof(options));
}

return options.AddProcessor(new BatchExportProcessor<LogRecord>(new MyExporter()));
return options.AddProcessor(new BatchLogRecordExportProcessor(new MyExporter()));
}
}
2 changes: 1 addition & 1 deletion docs/logs/extending-the-sdk/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void Main()
builder.AddOpenTelemetry(options => options
.AddProcessor(new MyProcessor("ProcessorA"))
.AddProcessor(new MyProcessor("ProcessorB"))
.AddProcessor(new SimpleExportProcessor<LogRecord>(new MyExporter("ExporterX")))
.AddProcessor(new SimpleLogRecordExportProcessor(new MyExporter("ExporterX")))
.AddMyExporter());
});

Expand Down
2 changes: 1 addition & 1 deletion docs/trace/extending-the-sdk/MyExporterHelperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public static TracerProviderBuilder AddMyExporter(this TracerProviderBuilder bui
throw new ArgumentNullException(nameof(builder));
}

return builder.AddProcessor(new BatchExportProcessor<Activity>(new MyExporter()));
return builder.AddProcessor(new BatchActivityExportProcessor(new MyExporter()));
}
}
2 changes: 1 addition & 1 deletion docs/trace/extending-the-sdk/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void Main()
.AddSource("OTel.Demo")
.AddProcessor(new MyProcessor("ProcessorA"))
.AddProcessor(new MyProcessor("ProcessorB"))
.AddProcessor(new SimpleExportProcessor<Activity>(new MyExporter("ExporterX")))
.AddProcessor(new SimpleActivityExportProcessor(new MyExporter("ExporterX")))
.AddMyExporter()
.Build();

Expand Down
2 changes: 1 addition & 1 deletion docs/trace/extending-the-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ register the exporter, they must be registered manually as shown below:
.SetSampler(new MySampler())
.AddSource("OTel.Demo")
.AddProcessor(new MyFilteringProcessor(
new SimpleExportProcessor<Activity>(new MyExporter("ExporterX")),
new SimpleActivityExportProcessor(new MyExporter("ExporterX")),
(act) => true))
.Build();
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static TracerProviderBuilder AddConsoleExporter(this TracerProviderBuilde

var options = new ConsoleExporterOptions();
configure?.Invoke(options);
return builder.AddProcessor(new SimpleExportProcessor<Activity>(new ConsoleActivityExporter(options)));
return builder.AddProcessor(new SimpleActivityExportProcessor(new ConsoleActivityExporter(options)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static OpenTelemetryLoggerOptions AddConsoleExporter(this OpenTelemetryLo

var options = new ConsoleExporterOptions();
configure?.Invoke(options);
return loggerOptions.AddProcessor(new SimpleExportProcessor<LogRecord>(new ConsoleLogRecordExporter(options)));
return loggerOptions.AddProcessor(new SimpleLogRecordExportProcessor(new ConsoleLogRecordExporter(options)));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static TracerProviderBuilder AddInMemoryExporter(this TracerProviderBuild
throw new ArgumentNullException(nameof(exportedItems));
}

return builder.AddProcessor(new SimpleExportProcessor<Activity>(new InMemoryExporter<Activity>(exportedItems)));
return builder.AddProcessor(new SimpleActivityExportProcessor(new InMemoryExporter<Activity>(exportedItems)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static OpenTelemetryLoggerOptions AddInMemoryExporter(this OpenTelemetryL
throw new ArgumentNullException(nameof(exportedItems));
}

return loggerOptions.AddProcessor(new SimpleExportProcessor<LogRecord>(new InMemoryExporter<LogRecord>(exportedItems)));
return loggerOptions.AddProcessor(new SimpleLogRecordExportProcessor(new InMemoryExporter<LogRecord>(exportedItems)));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public static TracerProviderBuilder AddJaegerExporter(this TracerProviderBuilder

if (exporterOptions.ExportProcessorType == ExportProcessorType.Simple)
{
return builder.AddProcessor(new SimpleExportProcessor<Activity>(jaegerExporter));
return builder.AddProcessor(new SimpleActivityExportProcessor(jaegerExporter));
}
else
{
return builder.AddProcessor(new BatchExportProcessor<Activity>(
return builder.AddProcessor(new BatchActivityExportProcessor(
jaegerExporter,
exporterOptions.BatchExportProcessorOptions.MaxQueueSize,
exporterOptions.BatchExportProcessorOptions.ScheduledDelayMilliseconds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public static TracerProviderBuilder AddOtlpExporter(this TracerProviderBuilder b

if (exporterOptions.ExportProcessorType == ExportProcessorType.Simple)
{
return builder.AddProcessor(new SimpleExportProcessor<Activity>(otlpExporter));
return builder.AddProcessor(new SimpleActivityExportProcessor(otlpExporter));
}
else
{
return builder.AddProcessor(new BatchExportProcessor<Activity>(
return builder.AddProcessor(new BatchActivityExportProcessor(
otlpExporter,
exporterOptions.BatchExportProcessorOptions.MaxQueueSize,
exporterOptions.BatchExportProcessorOptions.ScheduledDelayMilliseconds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public static TracerProviderBuilder AddZipkinExporter(this TracerProviderBuilder

if (exporterOptions.ExportProcessorType == ExportProcessorType.Simple)
{
return builder.AddProcessor(new SimpleExportProcessor<Activity>(zipkinExporter));
return builder.AddProcessor(new SimpleActivityExportProcessor(zipkinExporter));
}
else
{
return builder.AddProcessor(new BatchExportProcessor<Activity>(
return builder.AddProcessor(new BatchActivityExportProcessor(
zipkinExporter,
exporterOptions.BatchExportProcessorOptions.MaxQueueSize,
exporterOptions.BatchExportProcessorOptions.ScheduledDelayMilliseconds,
Expand Down
8 changes: 7 additions & 1 deletion src/OpenTelemetry/.publicApi/net452/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ OpenTelemetry.Batch<T>.Enumerator.Enumerator() -> void
OpenTelemetry.Batch<T>.Enumerator.MoveNext() -> bool
OpenTelemetry.Batch<T>.Enumerator.Reset() -> void
OpenTelemetry.Batch<T>.GetEnumerator() -> OpenTelemetry.Batch<T>.Enumerator
OpenTelemetry.BatchActivityExportProcessor
OpenTelemetry.BatchActivityExportProcessor.BatchActivityExportProcessor(OpenTelemetry.BaseExporter<System.Diagnostics.Activity> exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void
OpenTelemetry.BatchExportProcessor<T>
OpenTelemetry.BatchExportProcessor<T>.BatchExportProcessor(OpenTelemetry.BaseExporter<T> exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void
OpenTelemetry.BatchExportProcessorOptions<T>
Expand Down Expand Up @@ -130,6 +132,8 @@ OpenTelemetry.Resources.ResourceBuilder.Build() -> OpenTelemetry.Resources.Resou
OpenTelemetry.Resources.ResourceBuilder.Clear() -> OpenTelemetry.Resources.ResourceBuilder
OpenTelemetry.Resources.ResourceBuilderExtensions
OpenTelemetry.Sdk
OpenTelemetry.SimpleActivityExportProcessor
OpenTelemetry.SimpleActivityExportProcessor.SimpleActivityExportProcessor(OpenTelemetry.BaseExporter<System.Diagnostics.Activity> exporter) -> void
OpenTelemetry.SimpleExportProcessor<T>
OpenTelemetry.SimpleExportProcessor<T>.SimpleExportProcessor(OpenTelemetry.BaseExporter<T> exporter) -> void
OpenTelemetry.SuppressInstrumentationScope
Expand Down Expand Up @@ -179,7 +183,9 @@ abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.BaseExportProcessor<T>.Dispose(bool disposing) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.BatchActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.BatchExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.BatchExportProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
override OpenTelemetry.BatchExportProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
Expand Down Expand Up @@ -214,6 +220,7 @@ override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
override OpenTelemetry.SimpleActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.SimpleExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.Trace.AlwaysOnSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
Expand All @@ -222,7 +229,6 @@ override OpenTelemetry.Trace.SamplingResult.Equals(object obj) -> bool
override OpenTelemetry.Trace.SamplingResult.GetHashCode() -> int
override OpenTelemetry.Trace.TraceIdRatioBasedSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
abstract OpenTelemetry.BaseExportProcessor<T>.OnExport(T data) -> void
override sealed OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
override sealed OpenTelemetry.BaseExportProcessor<T>.OnStart(T data) -> void
readonly OpenTelemetry.BaseExportProcessor<T>.exporter -> OpenTelemetry.BaseExporter<T>
static OpenTelemetry.ProviderExtensions.GetResource(this OpenTelemetry.BaseProvider baseProvider) -> OpenTelemetry.Resources.Resource
Expand Down
8 changes: 7 additions & 1 deletion src/OpenTelemetry/.publicApi/net46/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ OpenTelemetry.Batch<T>.Enumerator.Enumerator() -> void
OpenTelemetry.Batch<T>.Enumerator.MoveNext() -> bool
OpenTelemetry.Batch<T>.Enumerator.Reset() -> void
OpenTelemetry.Batch<T>.GetEnumerator() -> OpenTelemetry.Batch<T>.Enumerator
OpenTelemetry.BatchActivityExportProcessor
OpenTelemetry.BatchActivityExportProcessor.BatchActivityExportProcessor(OpenTelemetry.BaseExporter<System.Diagnostics.Activity> exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void
OpenTelemetry.BatchExportProcessor<T>
OpenTelemetry.BatchExportProcessor<T>.BatchExportProcessor(OpenTelemetry.BaseExporter<T> exporter, int maxQueueSize = 2048, int scheduledDelayMilliseconds = 5000, int exporterTimeoutMilliseconds = 30000, int maxExportBatchSize = 512) -> void
OpenTelemetry.BatchExportProcessorOptions<T>
Expand Down Expand Up @@ -130,6 +132,8 @@ OpenTelemetry.Resources.ResourceBuilder.Build() -> OpenTelemetry.Resources.Resou
OpenTelemetry.Resources.ResourceBuilder.Clear() -> OpenTelemetry.Resources.ResourceBuilder
OpenTelemetry.Resources.ResourceBuilderExtensions
OpenTelemetry.Sdk
OpenTelemetry.SimpleActivityExportProcessor
OpenTelemetry.SimpleActivityExportProcessor.SimpleActivityExportProcessor(OpenTelemetry.BaseExporter<System.Diagnostics.Activity> exporter) -> void
OpenTelemetry.SimpleExportProcessor<T>
OpenTelemetry.SimpleExportProcessor<T>.SimpleExportProcessor(OpenTelemetry.BaseExporter<T> exporter) -> void
OpenTelemetry.SuppressInstrumentationScope
Expand Down Expand Up @@ -179,7 +183,9 @@ abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.BaseExportProcessor<T>.Dispose(bool disposing) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.BatchActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.BatchExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.BatchExportProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
override OpenTelemetry.BatchExportProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
Expand Down Expand Up @@ -214,6 +220,7 @@ override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
override OpenTelemetry.SimpleActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.SimpleExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.Trace.AlwaysOnSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
Expand All @@ -222,7 +229,6 @@ override OpenTelemetry.Trace.SamplingResult.Equals(object obj) -> bool
override OpenTelemetry.Trace.SamplingResult.GetHashCode() -> int
override OpenTelemetry.Trace.TraceIdRatioBasedSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
abstract OpenTelemetry.BaseExportProcessor<T>.OnExport(T data) -> void
override sealed OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
override sealed OpenTelemetry.BaseExportProcessor<T>.OnStart(T data) -> void
readonly OpenTelemetry.BaseExportProcessor<T>.exporter -> OpenTelemetry.BaseExporter<T>
static OpenTelemetry.ProviderExtensions.GetResource(this OpenTelemetry.BaseProvider baseProvider) -> OpenTelemetry.Resources.Resource
Expand Down
Loading