Class OkHttpSender.Builder

  • Enclosing class:
    OkHttpSender

    public static final class OkHttpSender.Builder
    extends Object
    • Method Detail

      • endpoint

        public OkHttpSender.Builder endpoint​(String endpoint)
        No default. The POST HttpUrl for zipkin's v2 api, usually "http://zipkinhost:9411/api/v2/spans"
      • compressionEnabled

        public OkHttpSender.Builder compressionEnabled​(boolean compressionEnabled)
        Default true. true implies that spans will be gzipped before transport.
      • messageMaxBytes

        public OkHttpSender.Builder messageMaxBytes​(int messageMaxBytes)
        Maximum size of a message. Default 500KB
      • maxRequests

        public OkHttpSender.Builder maxRequests​(int maxRequests)
        Maximum in-flight requests. Default 64
      • encoding

        public OkHttpSender.Builder encoding​(Encoding encoding)
        Use this to change the encoding used in messages. Default is Encoding.JSON This also controls the "Content-Type" header when sending spans.

        Note: If ultimately sending to Zipkin, version 2.8+ is required to process protobuf.

      • connectTimeout

        public OkHttpSender.Builder connectTimeout​(int connectTimeoutMillis)
        Sets the default connect timeout (in milliseconds) for new connections. Default 10000
      • readTimeout

        public OkHttpSender.Builder readTimeout​(int readTimeoutMillis)
        Sets the default read timeout (in milliseconds) for new connections. Default 10000
      • writeTimeout

        public OkHttpSender.Builder writeTimeout​(int writeTimeoutMillis)
        Sets the default write timeout (in milliseconds) for new connections. Default 10000
      • clientBuilder

        public okhttp3.OkHttpClient.Builder clientBuilder()