public final class ZipkinTraceExporter extends Object
Example of usage:
public static void main(String[] args) {
ZipkinTraceExporter.createAndRegister(
ZipkinExporterConfiguration.builder()
.setV2Url("http://127.0.0.1:9411/api/v2/spans")
.setServiceName("myservicename")
.build());
... // Do work.
}
Modifier and Type | Method and Description |
---|---|
static void |
createAndRegister(zipkin2.codec.SpanBytesEncoder encoder,
zipkin2.reporter.Sender sender,
String serviceName)
Deprecated.
in favor of
createAndRegister(ZipkinExporterConfiguration) . |
static void |
createAndRegister(String v2Url,
String serviceName)
Deprecated.
in favor of
createAndRegister(ZipkinExporterConfiguration) . |
static void |
createAndRegister(ZipkinExporterConfiguration configuration)
Creates and registers the Zipkin Trace exporter to the OpenCensus library.
|
static void |
unregister()
Unregisters the Zipkin Trace exporter from the OpenCensus library.
|
public static void createAndRegister(ZipkinExporterConfiguration configuration)
configuration
- configuration for this exporter.IllegalStateException
- if a Zipkin exporter is already registered.@Deprecated public static void createAndRegister(String v2Url, String serviceName)
createAndRegister(ZipkinExporterConfiguration)
.v2Url
- Ex http://127.0.0.1:9411/api/v2/spansserviceName
- the local service name
of the process.IllegalStateException
- if a Zipkin exporter is already registered.@Deprecated public static void createAndRegister(zipkin2.codec.SpanBytesEncoder encoder, zipkin2.reporter.Sender sender, String serviceName)
createAndRegister(ZipkinExporterConfiguration)
.encoder
- Usually SpanBytesEncoder.JSON_V2
sender
- Often, but not necessarily an http sender. This could be Kafka or SQS.serviceName
- the local service name
of the process.IllegalStateException
- if a Zipkin exporter is already registered.public static void unregister()
IllegalStateException
- if a Zipkin exporter is not registered.