Class DefaultInMemoryTracer.Builder
java.lang.Object
io.servicetalk.opentracing.inmemory.DefaultInMemoryTracer.Builder
- Enclosing class:
- DefaultInMemoryTracer
Builders for
DefaultInMemoryTracer
.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(InMemoryScopeManager scopeManager) Constructs a builder for anDefaultInMemoryTracer
. -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(InMemorySpanEventListener listener) Add a trace event listener.build()
Builds theDefaultInMemoryTracer
.persistLogs
(boolean persistLogs) Sets whether logs are persisted in the span object.use128BitTraceId
(boolean use128BitTraceId) Sets whether to use 128-bit trace IDs.withMaxTagSize
(int maxTagSize) Sets the maximum number of tags.withSampler
(BiFunction<String, Boolean, Boolean> sampler) Sets the sampler.withSampler
(Predicate<String> sampler) Sets the sampler.
-
Constructor Details
-
Builder
Constructs a builder for anDefaultInMemoryTracer
.- Parameters:
scopeManager
- aInMemoryScopeManager
.
-
-
Method Details
-
withSampler
Sets the sampler.- Parameters:
sampler
- policy which takes a traceId and returns whether the given trace should be sampled- Returns:
- this
-
withSampler
Sets the sampler.- Parameters:
sampler
- policy which takes a traceId and the sampling flag specified in carrier (optional, could benull
), and returns whether the given trace should be sampled.- Returns:
- this
-
addListener
Add a trace event listener.- Parameters:
listener
- listener to add- Returns:
- this
-
withMaxTagSize
Sets the maximum number of tags.- Parameters:
maxTagSize
- maximum number of tags- Returns:
- this
-
persistLogs
Sets whether logs are persisted in the span object. This is necessary when using using listeners which sends the span to a backend on span finish.- Parameters:
persistLogs
- whether to persist logs in the span object. Defaults to false.- Returns:
- this
-
use128BitTraceId
Sets whether to use 128-bit trace IDs.- Parameters:
use128BitTraceId
- whether to use 128-bit trace IDs.- Returns:
- this
-
build
Builds theDefaultInMemoryTracer
.- Returns:
- tracer
-