java.lang.Object
io.helidon.tracing.jaeger.JaegerTracerBuilder
- All Implemented Interfaces:
Builder<JaegerTracerBuilder,,Tracer> TracerBuilder<JaegerTracerBuilder>,Supplier<Tracer>
The JaegerTracerBuilder is a convenience builder for
Tracer to use with Jaeger.
Unless You want to explicitly depend on Jaeger in Your code, please
use TracerBuilder.create(String) or
TracerBuilder.create(io.helidon.config.Config) that is abstracted.
The Jaeger tracer uses environment variables and system properties to override the defaults.
Except for protocol and service these are honored, unless overridden in configuration
or through the builder methods.
See Jaeger documentation
for details.
The following table lists jaeger specific defaults and configuration options.
| option | default | description |
|---|---|---|
service |
Service name | |
protocol |
http |
The protocol to use. By default http is used. |
host |
127.0.0.1 |
Host to use |
port |
14250 | Port to be used |
path |
Path to be used. | |
exporter-timeout-millis |
10 seconds | Timeout of exporter |
private-key-pem |
Client private key in PEM format | |
client-cert-pem |
Client certificate in PEM format | |
trusted-cert-pem |
Trusted certificates in PEM format | |
sampler-type |
const with param set to 1 |
Sampler type const (0 to disable, 1 to always enabled),
ratio (sample param contains the ratio as a double) |
sampler-param |
sampler type default | Numeric parameter specifying details for the sampler type. |
tags |
see TracerBuilder |
|
boolean-tags |
see TracerBuilder |
|
int-tags |
see TracerBuilder |
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSampler type definition. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor, does not modify any state. -
Method Summary
Modifier and TypeMethodDescriptionaddTracerTag(String key, boolean value) addTracerTag(String key, Number value) addTracerTag(String key, String value) build()Builds theTracerfor Jaeger based on the configured parameters.clientCertificate(Resource resource) Certificate of client in PEM format.collectorHost(String host) collectorPath(String path) collectorPort(int port) collectorProtocol(String protocol) static JaegerTracerBuilderCreate a new builder based on values in configuration.enabled(boolean enabled) exporterTimeout(Duration exporterTimeout) Timeout of exporter requests.static JaegerTracerBuilderforService(String serviceName) Get a JaegerTracerbuilder for processing tracing data of a service with a given name.privateKey(Resource resource) Private key in PEM format.registerGlobal(boolean global) samplerParam(Number samplerParam) The sampler parameter (number).samplerType(JaegerTracerBuilder.SamplerType samplerType) Sampler type.serviceName(String name) trustedCertificates(Resource resource) Trusted certificates in PEM format.<B> BMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.tracing.TracerBuilder
collectorUri
-
Constructor Details
-
JaegerTracerBuilder
protected JaegerTracerBuilder()Default constructor, does not modify any state.
-
-
Method Details
-
forService
Get a JaegerTracerbuilder for processing tracing data of a service with a given name.- Parameters:
serviceName- name of the service that will be using the tracer.- Returns:
Tracerbuilder for Jaeger.
-
create
Create a new builder based on values in configuration. This requires at least a key "service" in the provided config.- Parameters:
config- configuration to load this builder from- Returns:
- a new builder instance.
- See Also:
-
serviceName
- Specified by:
serviceNamein interfaceTracerBuilder<JaegerTracerBuilder>
-
collectorProtocol
- Specified by:
collectorProtocolin interfaceTracerBuilder<JaegerTracerBuilder>
-
collectorPort
- Specified by:
collectorPortin interfaceTracerBuilder<JaegerTracerBuilder>
-
collectorPath
- Specified by:
collectorPathin interfaceTracerBuilder<JaegerTracerBuilder>
-
collectorHost
- Specified by:
collectorHostin interfaceTracerBuilder<JaegerTracerBuilder>
-
addTracerTag
- Specified by:
addTracerTagin interfaceTracerBuilder<JaegerTracerBuilder>
-
addTracerTag
- Specified by:
addTracerTagin interfaceTracerBuilder<JaegerTracerBuilder>
-
addTracerTag
- Specified by:
addTracerTagin interfaceTracerBuilder<JaegerTracerBuilder>
-
config
- Specified by:
configin interfaceTracerBuilder<JaegerTracerBuilder>
-
privateKey
Private key in PEM format.- Parameters:
resource- key resource- Returns:
- updated builder
-
clientCertificate
Certificate of client in PEM format.- Parameters:
resource- certificate resource- Returns:
- updated builder
-
trustedCertificates
Trusted certificates in PEM format.- Parameters:
resource- trusted certificates resource- Returns:
- updated builder
-
exporterTimeout
Timeout of exporter requests.- Parameters:
exporterTimeout- timeout to use- Returns:
- updated builder
-
enabled
- Specified by:
enabledin interfaceTracerBuilder<JaegerTracerBuilder>
-
registerGlobal
- Specified by:
registerGlobalin interfaceTracerBuilder<JaegerTracerBuilder>
-
unwrap
- Specified by:
unwrapin interfaceTracerBuilder<JaegerTracerBuilder>
-
samplerParam
The sampler parameter (number).- Parameters:
samplerParam- parameter of the sampler- Returns:
- updated builder instance
-
samplerType
Sampler type.See Sampler types.
- Parameters:
samplerType- type of the sampler- Returns:
- updated builder instance
-
build
Builds theTracerfor Jaeger based on the configured parameters.- Specified by:
buildin interfaceBuilder<JaegerTracerBuilder,Tracer> - Returns:
- the tracer
-