Package zipkin2.reporter.okhttp3
Class OkHttpSender.Builder
- java.lang.Object
-
- zipkin2.reporter.okhttp3.OkHttpSender.Builder
-
- Enclosing class:
- OkHttpSender
public static final class OkHttpSender.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OkHttpSenderbuild()okhttp3.OkHttpClient.BuilderclientBuilder()OkHttpSender.BuildercompressionEnabled(boolean compressionEnabled)Default true.OkHttpSender.BuilderconnectTimeout(int connectTimeoutMillis)Sets the default connect timeout (in milliseconds) for new connections.OkHttpSender.Builderencoding(zipkin2.codec.Encoding encoding)Use this to change the encoding used in messages.OkHttpSender.Builderendpoint(String endpoint)No default.OkHttpSender.Builderendpoint(okhttp3.HttpUrl endpoint)OkHttpSender.BuildermaxRequests(int maxRequests)Maximum in-flight requests.OkHttpSender.BuildermessageMaxBytes(int messageMaxBytes)Maximum size of a message.OkHttpSender.BuilderreadTimeout(int readTimeoutMillis)Sets the default read timeout (in milliseconds) for new connections.OkHttpSender.BuilderwriteTimeout(int writeTimeoutMillis)Sets the default write timeout (in milliseconds) for new connections.
-
-
-
Method Detail
-
endpoint
public OkHttpSender.Builder endpoint(String endpoint)
No default. The POST URL for zipkin's v2 api, usually "http://zipkinhost:9411/api/v2/spans"
-
endpoint
public OkHttpSender.Builder endpoint(okhttp3.HttpUrl endpoint)
-
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(zipkin2.codec.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 final OkHttpSender.Builder connectTimeout(int connectTimeoutMillis)
Sets the default connect timeout (in milliseconds) for new connections. Default 10000
-
readTimeout
public final OkHttpSender.Builder readTimeout(int readTimeoutMillis)
Sets the default read timeout (in milliseconds) for new connections. Default 10000
-
writeTimeout
public final OkHttpSender.Builder writeTimeout(int writeTimeoutMillis)
Sets the default write timeout (in milliseconds) for new connections. Default 10000
-
clientBuilder
public okhttp3.OkHttpClient.Builder clientBuilder()
-
build
public final OkHttpSender build()
-
-