diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs index c033436b392..22fdd978d4d 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs @@ -70,10 +70,10 @@ public override ExportResult Export(in Batch logRecordBatch) var request = new OtlpCollector.ExportLogsServiceRequest(); - request.AddBatch(this.ProcessResource, logRecordBatch); - try { + request.AddBatch(this.ProcessResource, logRecordBatch); + if (!this.exportClient.SendExportRequest(request)) { return ExportResult.Failure; diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpMetricExporter.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpMetricExporter.cs index 2cb2aae876d..7983c3da069 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpMetricExporter.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpMetricExporter.cs @@ -69,10 +69,10 @@ public override ExportResult Export(in Batch metrics) var request = new OtlpCollector.ExportMetricsServiceRequest(); - request.AddMetrics(this.ProcessResource, metrics); - try { + request.AddMetrics(this.ProcessResource, metrics); + if (!this.exportClient.SendExportRequest(request)) { return ExportResult.Failure; diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporter.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporter.cs index 1a846dd6575..71f19db313a 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporter.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporter.cs @@ -69,10 +69,10 @@ public override ExportResult Export(in Batch activityBatch) var request = new OtlpCollector.ExportTraceServiceRequest(); - request.AddBatch(this.ProcessResource, activityBatch); - try { + request.AddBatch(this.ProcessResource, activityBatch); + if (!this.exportClient.SendExportRequest(request)) { return ExportResult.Failure; @@ -81,7 +81,6 @@ public override ExportResult Export(in Batch activityBatch) catch (Exception ex) { OpenTelemetryProtocolExporterEventSource.Log.ExportMethodException(ex); - return ExportResult.Failure; } finally