Class ZipkinSpanExporterBuilder

java.lang.Object
io.opentelemetry.exporter.zipkin.ZipkinSpanExporterBuilder

public final class ZipkinSpanExporterBuilder extends Object
Builder class for ZipkinSpanExporter.
  • Constructor Details

    • ZipkinSpanExporterBuilder

      public ZipkinSpanExporterBuilder()
  • Method Details

    • setSender

      public ZipkinSpanExporterBuilder setSender(zipkin2.reporter.Sender sender)
      Sets the Zipkin sender. Implements the client side of the span transport. An OkHttpSender is a good default.

      The Component.close() method will be called when the exporter is shut down.

      Parameters:
      sender - the Zipkin sender implementation.
      Returns:
      this.
    • setEncoder

      public ZipkinSpanExporterBuilder setEncoder(zipkin2.codec.BytesEncoder<zipkin2.Span> encoder)
      Sets the BytesEncoder, which controls the format used by the Sender. Defaults to the SpanBytesEncoder.JSON_V2.
      Parameters:
      encoder - the BytesEncoder to use.
      Returns:
      this.
      See Also:
      • SpanBytesEncoder
    • setLocalIpAddressSupplier

      public ZipkinSpanExporterBuilder setLocalIpAddressSupplier(Supplier<InetAddress> supplier)
      Sets the Supplier of InetAddress. This Supplier will be used by the OtelToZipkinSpanTransformer when creating the Zipkin local endpoint. The default implementation uses a Supplier that returns a single unchanging IP address that is captured at creation time.
      Parameters:
      supplier - - A supplier that returns an InetAddress that may be null.
      Returns:
      this
      Since:
      1.18.0
    • setEndpoint

      public ZipkinSpanExporterBuilder setEndpoint(String endpoint)
      Sets the zipkin endpoint. This will use the endpoint to assign an OkHttpSender instance to this builder.
      Parameters:
      endpoint - The Zipkin endpoint URL, ex. "http://zipkinhost:9411/api/v2/spans".
      Returns:
      this.
      See Also:
      • OkHttpSender
    • setCompression

      public ZipkinSpanExporterBuilder setCompression(String compressionMethod)
      Sets the method used to compress payloads. If unset, gzip compression is enabled. Currently supported compression methods include "gzip" and "none".

      The compression method is ignored when a custom Zipkin sender is set via setSender(Sender).

      Parameters:
      compressionMethod - The compression method, ex. "gzip".
      Returns:
      this.
      Since:
      1.20.0
      See Also:
      • OkHttpSender
    • setReadTimeout

      public ZipkinSpanExporterBuilder setReadTimeout(long timeout, TimeUnit unit)
      Sets the maximum time to wait for the export of a batch of spans. If unset, defaults to 10s.
      Returns:
      this.
      Since:
      1.2.0
    • setReadTimeout

      public ZipkinSpanExporterBuilder setReadTimeout(Duration timeout)
      Sets the maximum time to wait for the export of a batch of spans. If unset, defaults to 10s.
      Returns:
      this.
      Since:
      1.2.0
    • setMeterProvider

      public ZipkinSpanExporterBuilder setMeterProvider(io.opentelemetry.api.metrics.MeterProvider meterProvider)
      Sets the MeterProvider to use to collect metrics related to export. If not set, uses GlobalOpenTelemetry.getMeterProvider().
      Returns:
      this.
      Since:
      1.17.0
    • build

      public ZipkinSpanExporter build()
      Returns:
      a ZipkinSpanExporter.