ZipkinReporterService

A Guava GenericIdleService that manages a Zipkin span reporter lifecycle.

Creates an OkHttpSender and AsyncReporter for sending trace spans to a Zipkin server, and provides a factory method for creating Tracing instances bound to this reporter. Stopping the service sends the spans still queued before closing the reporter.

toString, which the service logs at INFO each time it starts and stops, shows only the collector URL's scheme, host, port and path. A collector that needs a key takes it in the URL, usually in the query string, so the user info, query and fragment are left out, and a URL that cannot be parsed is shown as <unparseable URL>.

Constructors

Link copied to clipboard
constructor(url: String, defaultServiceName: String = "unknown", initBlock: ZipkinReporterService.() -> Unit = {})

Creates a reporter that sends spans to the Zipkin collector at url.

Properties

Link copied to clipboard

The service name newTracing uses when none is given.

Link copied to clipboard

Functions

Link copied to clipboard
fun addListener(listener: Service.Listener, executor: Executor)
Link copied to clipboard
fun awaitRunning(timeout: Duration)
fun awaitRunning(timeout: Long, unit: TimeUnit)
Link copied to clipboard
fun awaitTerminated(timeout: Long, unit: TimeUnit)
Link copied to clipboard
Link copied to clipboard
fun newTracing(serviceName: String = defaultServiceName): Tracing

Creates a new Tracing instance configured with the given service name and this reporter's span handler.

Link copied to clipboard
fun startAsync(): Service
Link copied to clipboard
fun startSync(timeout: Duration)
fun startSync(timeout: Duration)
Link copied to clipboard
fun state(): Service.State
Link copied to clipboard
fun stopAsync(): Service
Link copied to clipboard
fun stopSync(timeout: Duration)
fun stopSync(timeout: Duration)
Link copied to clipboard
open override fun toString(): String