Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 2.26 KB

File metadata and controls

59 lines (43 loc) · 2.26 KB

OTLP Exporter for OpenTelemetry .NET

NuGet NuGet

The OTLP (OpenTelemetry Protocol) exporter communicates to an OpenTelemetry Collector through a gRPC protocol.

Prerequisite

Installation

dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol

Configuration

You can configure the OtlpExporter through OtlpExporterOptions properties:

  • Endpoint: Target to which the exporter is going to send traces or metrics. The endpoint must be a valid Uri with scheme (http or https) and host, and MAY contain a port and path.
  • Headers: Optional headers for the connection.
  • TimeoutMilliseconds : Max waiting time for the backend to process a batch.
  • ExportProcessorType: Whether the exporter should use Batch or Simple exporting processor .
  • BatchExportProcessorOptions: Configuration options for the batch exporter. Only used if ExportProcessorType is set to Batch.

See the TestOtlpExporter.cs for an example of how to use the exporter.

Special case when using insecure channel

If your application is .NET Standard 2.1 or above, and you are using an insecure (http) endpoint, the following switch must be set before adding OtlpExporter.

AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport",
 true);

See this for more information.

References