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 (open-telemetry#2292)

- added NET 5.0 to list of target frameworks
- adapted HttpHandler.Send method implementation according to used target
  • Loading branch information
rypdal committed Sep 6, 2021
1 parent 6a09c22 commit 9d1471b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ public void Dispose()

public HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)
{
// TODO: replace by synchronous vesrion of Send method when it becomes availabe.
// See https://github.com/dotnet/runtime/pull/34948 (should be available starting form .NET 5.0).
#if NET5_0
return this.HttpClient.Send(request);
#else
return AsyncHelper.RunSync(() => this.HttpClient.SendAsync(request));
#endif
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net461;net5.0</TargetFrameworks>
<Description>OpenTelemetry protocol exporter for OpenTelemetry .NET</Description>
<PackageTags>$(PackageTags);OTLP</PackageTags>
<MinVerTagPrefix>core-</MinVerTagPrefix>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static OtlpHttpTraceExporterTests()
}

[Fact]
public void OtlpExporter_BadArgs()
public void AddOtlpHttpExporter_BadArgs_Throws()
{
TracerProviderBuilder builder = null;
Assert.Throws<ArgumentNullException>(() => builder.AddOtlpHttpExporter());
Expand Down

0 comments on commit 9d1471b

Please sign in to comment.