Class OkHttpSender

java.lang.Object
zipkin2.Component
zipkin2.reporter.Sender
zipkin2.reporter.okhttp3.OkHttpSender
All Implemented Interfaces:
Closeable, AutoCloseable

public final class OkHttpSender
extends Sender
Reports spans to Zipkin, using its POST endpoint.

Usage

This type is designed for the async reporter.

Here's a simple configuration, configured for json:


 sender = OkHttpSender.create("http://127.0.0.1:9411/api/v2/spans");
 

Here's an example that adds basic auth (assuming you have an authenticating proxy):

{@code
 credential = Credentials.basic("me", "secure");
 sender = OkHttpSender.newBuilder()
   .endpoint("https://authenticated-proxy/api/v2/spans")
   .clientBuilder().authenticator(new Authenticator() {