From 34ef7970759f1d07dda5b3fa62eb8ba38ba9a0e0 Mon Sep 17 00:00:00 2001 From: "DYNATRACE\\oleksiy.dubinin" Date: Tue, 7 Sep 2021 09:21:32 +0200 Subject: [PATCH] Add OTLP/HTTP binary protobuf trace exporter for .NET #2292 - removed redundant IDisposable implementation for HttpHandler --- .../BaseOtlpHttpExporter.cs | 17 ----------------- .../Implementation/HttpHandler.cs | 5 ----- .../Implementation/IHttpHandler.cs | 2 +- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/BaseOtlpHttpExporter.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/BaseOtlpHttpExporter.cs index 3b35ffc5045..8c3d8a53907 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/BaseOtlpHttpExporter.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/BaseOtlpHttpExporter.cs @@ -29,7 +29,6 @@ public abstract class BaseOtlpHttpExporter : BaseExporter where T : class { private OtlpResource.Resource processResource; - private bool disposedValue; // To avoid duplicate dispose calls /// /// Initializes a new instance of the class. @@ -56,22 +55,6 @@ protected BaseOtlpHttpExporter(OtlpExporterOptions options, IHttpHandler httpHan internal IHttpHandler HttpHandler { get; } - /// - protected override void Dispose(bool disposing) - { - if (!this.disposedValue) - { - if (disposing) - { - this.HttpHandler?.Dispose(); - } - - this.disposedValue = true; - } - - base.Dispose(disposing); - } - /// protected override bool OnShutdown(int timeoutMilliseconds) { diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/HttpHandler.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/HttpHandler.cs index e59649e8db8..3688b62c43f 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/HttpHandler.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/HttpHandler.cs @@ -40,11 +40,6 @@ public void CancelPendingRequests() this.HttpClient.CancelPendingRequests(); } - public void Dispose() - { - this.HttpClient.Dispose(); - } - public HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) { #if NET5_0 diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/IHttpHandler.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/IHttpHandler.cs index 185bf18376c..3eb5fb1ece7 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/IHttpHandler.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/IHttpHandler.cs @@ -23,7 +23,7 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation /// /// Interface partialy exposing methods. /// - public interface IHttpHandler : IDisposable + public interface IHttpHandler { /// /// Cancel all pending requests on this instance.