dotnet add package OpenTelemetry.Exporter.Zipkin
You can enable the the ZipkinExporter
with the AddZipkinExporter()
extension
method on TracerProviderBuilder
.
You can configure the ZipkinExporter
through ZipkinExporterOptions
and environment variables. The ZipkinExporterOptions
setters
take precedence over the environment variables.
ServiceName
: Name of the service reporting telemetry. If theResource
associated with the telemetry has "service.name" defined, then it'll be preferred over this option.Endpoint
: URI address to receive telemetry (defaulthttp://localhost:9411/api/v2/spans
).UseShortTraceIds
: Whether the trace's ID should be shortened before sending to Zipkin (default false).MaxPayloadSizeInBytes
: Maximum payload size - for .NET versions other than 4.5.2 (default 4096).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
TestZipkinExporter.cs
for example use.
This exporter allows easy configuration of ZipkinExporterOptions
from
dependency injection container, when used in conjunction with
OpenTelemetry.Extensions.Hosting
.
See the Startup class of the ASP.NET Core application for example use.
The following environment variables can be used to override the default
values of the ZipkinExporterOptions
.
Environment variable | ZipkinExporterOptions property |
---|---|
OTEL_EXPORTER_ZIPKIN_ENDPOINT |
Endpoint |
FormatException
is thrown in case of an invalid value for any of the
supported environment variables.