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. true implies that spans will be gzipped before transport.OkHttpSender.BuilderconnectTimeout(int connectTimeoutMillis)Sets the default connect timeout (in milliseconds) for new connections.OkHttpSender.Builderencoding(Encoding encoding)Use this to change the encoding used in messages.OkHttpSender.Builderendpoint(String endpoint)No default.OkHttpSender.Builderendpoint(okhttp3.HttpUrl endpoint)OkHttpSender.BuilderendpointSupplierFactory(HttpEndpointSupplier.Factory endpointSupplierFactory)Defaults toHttpEndpointSuppliers.constantFactory().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
-
endpointSupplierFactory
public OkHttpSender.Builder endpointSupplierFactory(HttpEndpointSupplier.Factory endpointSupplierFactory)
Defaults toHttpEndpointSuppliers.constantFactory().See JavaDoc on
HttpEndpointSupplierfor implementation notes.
-
endpoint
public OkHttpSender.Builder endpoint(String endpoint)
No default. The POST HttpUrl 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(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()
-
build
public OkHttpSender build()
-
-