Package io.opentelemetry.exporter.zipkin
Class ZipkinSpanExporterBuilder
- java.lang.Object
-
- io.opentelemetry.exporter.zipkin.ZipkinSpanExporterBuilder
-
public final class ZipkinSpanExporterBuilder extends Object
Builder class forZipkinSpanExporter
.
-
-
Constructor Summary
Constructors Constructor Description ZipkinSpanExporterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ZipkinSpanExporter
build()
Builds aZipkinSpanExporter
.ZipkinSpanExporterBuilder
setEncoder(zipkin2.codec.BytesEncoder<zipkin2.Span> encoder)
Sets theBytesEncoder
, which controls the format used by theSender
.ZipkinSpanExporterBuilder
setEndpoint(String endpoint)
Sets the zipkin endpoint.ZipkinSpanExporterBuilder
setSender(zipkin2.reporter.Sender sender)
Sets the Zipkin sender.ZipkinSpanExporterBuilder
setServiceName(String serviceName)
Deprecated.The default service name is now extracted from the default Resource.
-
-
-
Method Detail
-
setServiceName
@Deprecated public ZipkinSpanExporterBuilder setServiceName(String serviceName)
Deprecated.The default service name is now extracted from the default Resource. This method will be removed in the next release.Label of the remote node in the service graph, such as "favstar". Avoid names with variables or unique identifiers embedded. Defaults to the service.name specified in the default Resource.This is a primary label for trace lookup and aggregation, so it should be intuitive and consistent. Many use a name from service discovery.
Note: this value, will be superseded by the value of
ResourceAttributes.SERVICE_NAME
if it has been set in theResource
associated with the Tracer that created the spans.- Parameters:
serviceName
- The service name. It defaults to "unknown".- Returns:
- this.
- See Also:
Resource
,ResourceAttributes
-
setSender
public ZipkinSpanExporterBuilder setSender(zipkin2.reporter.Sender sender)
Sets the Zipkin sender. Implements the client side of the span transport. AOkHttpSender
is a good default.The
Component.close()
method will be called when the exporter is shut down.- Parameters:
sender
- the Zipkin sender implementation.- Returns:
- this.
-
setEncoder
public ZipkinSpanExporterBuilder setEncoder(zipkin2.codec.BytesEncoder<zipkin2.Span> encoder)
Sets theBytesEncoder
, which controls the format used by theSender
. Defaults to theSpanBytesEncoder.JSON_V2
.- Parameters:
encoder
- theBytesEncoder
to use.- Returns:
- this.
- See Also:
SpanBytesEncoder
-
setEndpoint
public ZipkinSpanExporterBuilder setEndpoint(String endpoint)
Sets the zipkin endpoint. This will use the endpoint to assign aOkHttpSender
instance to this builder.- Parameters:
endpoint
- The Zipkin endpoint URL, ex. "http://zipkinhost:9411/api/v2/spans".- Returns:
- this.
- See Also:
OkHttpSender
-
build
public ZipkinSpanExporter build()
Builds aZipkinSpanExporter
.- Returns:
- a
ZipkinSpanExporter
.
-
-