public static final class DefaultInMemoryTracer.Builder
extends java.lang.Object
DefaultInMemoryTracer
.Constructor and Description |
---|
Builder(InMemoryScopeManager scopeManager)
Constructs a builder for an
DefaultInMemoryTracer . |
Modifier and Type | Method and Description |
---|---|
DefaultInMemoryTracer.Builder |
addListener(InMemorySpanEventListener listener)
Add a trace event listener.
|
DefaultInMemoryTracer |
build()
Builds the
DefaultInMemoryTracer . |
DefaultInMemoryTracer.Builder |
persistLogs(boolean persistLogs)
Sets whether logs are persisted in the span object.
|
DefaultInMemoryTracer.Builder |
use128BitTraceId(boolean use128BitTraceId)
Sets whether to use 128-bit trace IDs.
|
DefaultInMemoryTracer.Builder |
withMaxTagSize(int maxTagSize)
Sets the maximum number of tags.
|
DefaultInMemoryTracer.Builder |
withSampler(java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> sampler)
Sets the sampler.
|
DefaultInMemoryTracer.Builder |
withSampler(java.util.function.Predicate<java.lang.String> sampler)
Sets the sampler.
|
public Builder(InMemoryScopeManager scopeManager)
DefaultInMemoryTracer
.scopeManager
- a InMemoryScopeManager
.public DefaultInMemoryTracer.Builder withSampler(java.util.function.Predicate<java.lang.String> sampler)
sampler
- policy which takes a traceId and returns whether the given trace should be sampledpublic DefaultInMemoryTracer.Builder withSampler(java.util.function.BiFunction<java.lang.String,java.lang.Boolean,java.lang.Boolean> sampler)
sampler
- policy which takes a traceId and the sampling flag specified in carrier (optional,
could be null
), and returns whether the given trace should be sampled.public DefaultInMemoryTracer.Builder addListener(InMemorySpanEventListener listener)
listener
- listener to addpublic DefaultInMemoryTracer.Builder withMaxTagSize(int maxTagSize)
maxTagSize
- maximum number of tagspublic DefaultInMemoryTracer.Builder persistLogs(boolean persistLogs)
persistLogs
- whether to persist logs in the span object. Defaults to false.public DefaultInMemoryTracer.Builder use128BitTraceId(boolean use128BitTraceId)
use128BitTraceId
- whether to use 128-bit trace IDs.public DefaultInMemoryTracer build()
DefaultInMemoryTracer
.