Skip to content

Commit

Permalink
Add OTLP/HTTP binary protobuf trace exporter for .NET open-telemetry#…
Browse files Browse the repository at this point in the history
…2292

- removed redundant IDisposable implementation for HttpHandler
  • Loading branch information
rypdal committed Sep 7, 2021
1 parent 9d1471b commit 34ef797
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public abstract class BaseOtlpHttpExporter<T> : BaseExporter<T>
where T : class
{
private OtlpResource.Resource processResource;
private bool disposedValue; // To avoid duplicate dispose calls

/// <summary>
/// Initializes a new instance of the <see cref="BaseOtlpHttpExporter{T}"/> class.
Expand All @@ -56,22 +55,6 @@ protected BaseOtlpHttpExporter(OtlpExporterOptions options, IHttpHandler httpHan

internal IHttpHandler HttpHandler { get; }

/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
if (!this.disposedValue)
{
if (disposing)
{
this.HttpHandler?.Dispose();
}

this.disposedValue = true;
}

base.Dispose(disposing);
}

/// <inheritdoc/>
protected override bool OnShutdown(int timeoutMilliseconds)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation
/// <summary>
/// Interface partialy exposing <see cref="HttpClient"/> methods.
/// </summary>
public interface IHttpHandler : IDisposable
public interface IHttpHandler
{
/// <summary>
/// Cancel all pending requests on this instance.
Expand Down

0 comments on commit 34ef797

Please sign in to comment.