Class OtlpGrpcSpanExporterBuilder
- java.lang.Object
-
- io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder
-
public final class OtlpGrpcSpanExporterBuilder extends Object
Builder utility for this exporter.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OtlpGrpcSpanExporterBuilderaddHeader(String key, String value)Add header to request.OtlpGrpcSpanExporterbuild()Constructs a new instance of the exporter based on the builder's values.OtlpGrpcSpanExporterBuildersetChannel(io.grpc.ManagedChannel channel)Sets the managed chanel to use when communicating with the backend.OtlpGrpcSpanExporterBuildersetEndpoint(String endpoint)Sets the OTLP endpoint to connect to.OtlpGrpcSpanExporterBuildersetTimeout(long timeout, TimeUnit unit)Sets the maximum time to wait for the collector to process an exported batch of spans.OtlpGrpcSpanExporterBuildersetTimeout(Duration timeout)Sets the maximum time to wait for the collector to process an exported batch of spans.OtlpGrpcSpanExporterBuildersetTrustedCertificates(byte[] trustedCertificatesPem)Sets the certificate chain to use for verifying servers when TLS is enabled.
-
-
-
Method Detail
-
setChannel
public OtlpGrpcSpanExporterBuilder setChannel(io.grpc.ManagedChannel channel)
Sets the managed chanel to use when communicating with the backend. Takes precedence oversetEndpoint(String)if both are called.- Parameters:
channel- the channel to use- Returns:
- this builder's instance
-
setTimeout
public OtlpGrpcSpanExporterBuilder setTimeout(long timeout, TimeUnit unit)
Sets the maximum time to wait for the collector to process an exported batch of spans. If unset, defaults to 10Ls.
-
setTimeout
public OtlpGrpcSpanExporterBuilder setTimeout(Duration timeout)
Sets the maximum time to wait for the collector to process an exported batch of spans. If unset, defaults to 10Ls.
-
setEndpoint
public OtlpGrpcSpanExporterBuilder setEndpoint(String endpoint)
Sets the OTLP endpoint to connect to. If unset, defaults to "http://localhost:4317". The endpoint must start with either http:// or https://.
-
setTrustedCertificates
public OtlpGrpcSpanExporterBuilder setTrustedCertificates(byte[] trustedCertificatesPem)
Sets the certificate chain to use for verifying servers when TLS is enabled. Thebyte[]should contain an X.509 certificate collection in PEM format. If not set, TLS connections will use the system default trusted certificates.
-
addHeader
public OtlpGrpcSpanExporterBuilder addHeader(String key, String value)
Add header to request. Optional. Applicable only ifendpointis set to build channel.- Parameters:
key- header keyvalue- header value- Returns:
- this builder's instance
-
build
public OtlpGrpcSpanExporter build()
Constructs a new instance of the exporter based on the builder's values.- Returns:
- a new exporter's instance
-
-