public final class ZipkinTracerBuilder extends java.lang.Object implements Builder<Tracer>
Tracer to use with Zipkin.| Modifier and Type | Class and Description |
|---|---|
static class |
ZipkinTracerBuilder.Version
Versions available for Zipkin API.
|
| Modifier and Type | Method and Description |
|---|---|
Tracer |
build()
Builds the
Tracer for Zipkin based on the configured parameters. |
static ZipkinTracerBuilder |
forService(java.lang.String serviceName)
Get a Zipkin
Tracer builder for processing tracing data of a service with a given name. |
static ZipkinTracerBuilder |
from(Config config)
Create a new builder based on values in configuration.
|
ZipkinTracerBuilder |
fromConfig(Config config)
Update this builder from configuration.
|
ZipkinTracerBuilder |
path(java.lang.String path)
Override path to use.
|
ZipkinTracerBuilder |
port(int port)
Set the port to use.
|
ZipkinTracerBuilder |
protocol(java.lang.String protocol)
Set the protocol to use (http, https).
|
ZipkinTracerBuilder |
sender(Sender sender)
The sender to use for sending events to Zipkin.
|
ZipkinTracerBuilder |
version(ZipkinTracerBuilder.Version version)
Version of Zipkin API to use.
|
ZipkinTracerBuilder |
zipkin(java.lang.String endpoint)
Set the Zipkin endpoint address.
|
ZipkinTracerBuilder |
zipkin(java.net.URI endpoint)
Set the Zipkin endpoint address.
|
ZipkinTracerBuilder |
zipkinHost(java.lang.String hostName)
Set the Zipkin host name.
|
public static ZipkinTracerBuilder forService(java.lang.String serviceName)
Tracer builder for processing tracing data of a service with a given name.serviceName - name of the service that will be using the tracer.Tracer builder for Zipkin.public ZipkinTracerBuilder version(ZipkinTracerBuilder.Version version)
ZipkinTracerBuilder.Version.V2.version - version to usepublic ZipkinTracerBuilder path(java.lang.String path)
ZipkinTracerBuilder.Version.
Use this to override if not using default (e.g. when
Zipkin is behind a reverse proxy that prefixes the path).path - path to override the default defined by ZipkinTracerBuilder.Versionpublic static ZipkinTracerBuilder from(Config config)
config - configuration to load this builder fromfromConfig(Config)public ZipkinTracerBuilder fromConfig(Config config)
config - configuration that contains at least the key service (if using configuration only).public ZipkinTracerBuilder zipkin(java.net.URI endpoint)
The resulting Tracer will be sending any tracing data to this location. The significant parts of the URI
are userInfo, host and port. Other parts of the endpoint URI are ignored.
endpoint - Zipkin endpoint address. Must not be null.public ZipkinTracerBuilder zipkin(java.lang.String endpoint)
The resulting Tracer will be sending any tracing data to this location. The significant parts of the endpoint URI
are userInfo, host and port. Other parts of the endpoint URI are ignored.
endpoint - Zipkin endpoint address. May be null, in which case the default Zipkin endpoint address
will be used (http://127.0.0.1:9411/).public ZipkinTracerBuilder zipkinHost(java.lang.String hostName)
The resulting Tracer will be sending any tracing data to the Zipkin location address constructed using the
supplied host name and the default Zipkin port (i.e. http://<hostName>:9411/).
hostName - Zipkin host name.public ZipkinTracerBuilder protocol(java.lang.String protocol)
protocol - protocol to usepublic ZipkinTracerBuilder port(int port)
port - port of the zipkin serverpublic ZipkinTracerBuilder sender(Sender sender)
protocol(String), zipkinHost(String), port(int), and
version(Version) methods are ignored.sender - the sender to useCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.