From 05f0d506b68f152fb38af6b8e801cbca104c6dce Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Tue, 24 Jan 2023 14:49:16 -0800 Subject: [PATCH 1/3] Add support for batchprocessoroptions --- .../GenevaExporterHelperExtensions.cs | 8 +++++++- .../GenevaLoggingExtensions.cs | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/GenevaExporterHelperExtensions.cs b/src/OpenTelemetry.Exporter.Geneva/GenevaExporterHelperExtensions.cs index 09fb5c8942..50de95692b 100644 --- a/src/OpenTelemetry.Exporter.Geneva/GenevaExporterHelperExtensions.cs +++ b/src/OpenTelemetry.Exporter.Geneva/GenevaExporterHelperExtensions.cs @@ -43,7 +43,13 @@ private static TracerProviderBuilder AddGenevaTraceExporter(this TracerProviderB var exporter = new GenevaTraceExporter(options); if (exporter.IsUsingUnixDomainSocket) { - return builder.AddProcessor(new BatchActivityExportProcessor(exporter)); + var batchOptions = new BatchExportActivityProcessorOptions(); + return builder.AddProcessor(new BatchActivityExportProcessor( + exporter, + batchOptions.MaxQueueSize, + batchOptions.ScheduledDelayMilliseconds, + batchOptions.ExporterTimeoutMilliseconds, + batchOptions.MaxExportBatchSize)); } else { diff --git a/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs b/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs index 38f7c480da..c0d51a179a 100644 --- a/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs +++ b/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs @@ -33,7 +33,13 @@ public static OpenTelemetryLoggerOptions AddGenevaLogExporter(this OpenTelemetry var exporter = new GenevaLogExporter(genevaOptions); if (exporter.IsUsingUnixDomainSocket) { - return options.AddProcessor(new BatchLogRecordExportProcessor(exporter)); + var batchOptions = new BatchExportActivityProcessorOptions(); + return builder.AddProcessor(new BatchActivityExportProcessor( + exporter, + batchOptions.MaxQueueSize, + batchOptions.ScheduledDelayMilliseconds, + batchOptions.ExporterTimeoutMilliseconds, + batchOptions.MaxExportBatchSize)); } else { From a60fd636d86da090bbbebafba512714389c5f3d8 Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Tue, 24 Jan 2023 15:39:15 -0800 Subject: [PATCH 2/3] Revert logging --- .../GenevaLoggingExtensions.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs b/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs index c0d51a179a..29bddc6e1b 100644 --- a/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs +++ b/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs @@ -19,6 +19,7 @@ using OpenTelemetry.Exporter.Geneva; using OpenTelemetry.Internal; using OpenTelemetry.Logs; +using OpenTelemetry.Trace; namespace Microsoft.Extensions.Logging; @@ -33,13 +34,7 @@ public static OpenTelemetryLoggerOptions AddGenevaLogExporter(this OpenTelemetry var exporter = new GenevaLogExporter(genevaOptions); if (exporter.IsUsingUnixDomainSocket) { - var batchOptions = new BatchExportActivityProcessorOptions(); - return builder.AddProcessor(new BatchActivityExportProcessor( - exporter, - batchOptions.MaxQueueSize, - batchOptions.ScheduledDelayMilliseconds, - batchOptions.ExporterTimeoutMilliseconds, - batchOptions.MaxExportBatchSize)); + return options.AddProcessor(new BatchLogRecordExportProcessor(exporter)); } else { From 33c3143c2dbf329630c2d786f6f6c8a474619e0f Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Tue, 24 Jan 2023 16:00:04 -0800 Subject: [PATCH 3/3] nits --- src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md | 4 ++++ src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md index ee894bbca4..64e8ee4d01 100644 --- a/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md @@ -11,6 +11,10 @@ ([#662](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/662)) ([#874](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/874)) +* Add support for configuring BatchActivityExportProcessor parameters (via + environment variables) used by GenevaTraceExporter in Linux. + ([#925](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/925)) + ## 1.4.0-rc.1 Released 2022-Dec-19 diff --git a/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs b/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs index 29bddc6e1b..38f7c480da 100644 --- a/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs +++ b/src/OpenTelemetry.Exporter.Geneva/GenevaLoggingExtensions.cs @@ -19,7 +19,6 @@ using OpenTelemetry.Exporter.Geneva; using OpenTelemetry.Internal; using OpenTelemetry.Logs; -using OpenTelemetry.Trace; namespace Microsoft.Extensions.Logging;