Package io.micronaut.tracing.brave
Class BraveTracerConfiguration
java.lang.Object
io.micronaut.tracing.brave.BraveTracerConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@Requires(classes=brave.Tracing.class) @Requires(property="tracing.zipkin.enabled",value="true")
@ConfigurationProperties("tracing.zipkin")
public class BraveTracerConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
Configuration properties for Brave.
- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Used to configure HTTP trace sending under thetracing.zipkin.http
namespace.static class
The sampler configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
The default enable value.static final float
static final String
protected brave.Tracing.Builder
-
Constructor Summary
ConstructorsConstructorDescriptionBraveTracerConfiguration
(io.micronaut.runtime.ApplicationConfiguration configuration) Constructs a newBraveTracerConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionbrave.Tracing.Builder
boolean
void
setClock
(@Nullable brave.Clock clock) void
setCurrentTraceContext
(brave.propagation.CurrentTraceContext traceContext) Sets the current trace context.void
setEnabled
(boolean enabled) Default value (false).void
setErrorParser
(@Nullable brave.ErrorParser errorParser) void
setPropagationFactory
(brave.propagation.Propagation.Factory propagationFactory) void
setSampler
(@Nullable brave.sampler.Sampler sampler) void
setSamplerConfiguration
(@Nullable BraveTracerConfiguration.SamplerConfiguration samplerConfiguration)
-
Field Details
-
PREFIX
- See Also:
-
DEFAULT_SAMPLER_PROBABILITY
public static final float DEFAULT_SAMPLER_PROBABILITY- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
tracingBuilder
@ConfigurationBuilder(prefixes="", excludes={"errorParser","clock","endpoint","spanReporter","propagationFactory","currentTraceContext","sampler"}) protected brave.Tracing.Builder tracingBuilder
-
-
Constructor Details
-
BraveTracerConfiguration
public BraveTracerConfiguration(io.micronaut.runtime.ApplicationConfiguration configuration) Constructs a newBraveTracerConfiguration
.- Parameters:
configuration
- the application configuration
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
- Returns:
- true if enabled
-
setEnabled
public void setEnabled(boolean enabled) Default value (false).- Parameters:
enabled
- true if tracing is enabled
-
setSamplerConfiguration
@Inject public void setSamplerConfiguration(@Nullable @Nullable BraveTracerConfiguration.SamplerConfiguration samplerConfiguration) - Parameters:
samplerConfiguration
- the configuration
-
getTracingBuilder
public brave.Tracing.Builder getTracingBuilder()- Returns:
- the builder
-
setSampler
@Inject public void setSampler(@Nullable @Nullable brave.sampler.Sampler sampler) - Parameters:
sampler
- the sampler
-
setErrorParser
@Inject public void setErrorParser(@Nullable @Nullable brave.ErrorParser errorParser) - Parameters:
errorParser
- the parser
-
setPropagationFactory
@Inject public void setPropagationFactory(@Nullable brave.propagation.Propagation.Factory propagationFactory) - Parameters:
propagationFactory
- the factory
-
setClock
@Inject public void setClock(@Nullable @Nullable brave.Clock clock) - Parameters:
clock
- the clock
-
setCurrentTraceContext
@Inject public void setCurrentTraceContext(brave.propagation.CurrentTraceContext traceContext) Sets the current trace context.- Parameters:
traceContext
- the context
-