[OTLP Exporter] Configurable gRPC ChannelOptions (#1033)

* Allow gRPC ChannelOptions

* Adding to the changelog

Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
This commit is contained in:
Peter Wiese 2020-08-11 10:29:01 -07:00 committed by GitHub
parent a3bf19d450
commit ba077fb95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -2,6 +2,9 @@
## Unreleased
* Allow configurable gRPC channel options
([#1033](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1033))
## 0.3.0-beta
Released 2020-07-23

View File

@ -45,7 +45,7 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol
public OtlpExporter(OtlpExporterOptions options)
{
this.headers = options.Headers;
this.channel = new Channel(options.Endpoint, options.Credentials);
this.channel = new Channel(options.Endpoint, options.Credentials, options.ChannelOptions);
this.traceClient = new OtlpCollector.TraceService.TraceServiceClient(this.channel);
}

View File

@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using Grpc.Core;
namespace OpenTelemetry.Exporter.OpenTelemetryProtocol
@ -38,6 +39,11 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol
/// <summary>
/// Gets or sets optional headers for the connection.
/// </summary>
public Metadata Headers { get; set; } = new Metadata();
public Metadata Headers { get; set; } = new Metadata();
/// <summary>
/// Gets or sets the gRPC channel options.
/// </summary>
public IEnumerable<ChannelOption> ChannelOptions { get; set; }
}
}