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 java.lang.Object implements io.micronaut.core.util.ToggleableConfiguration properties for Brave.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBraveTracerConfiguration.HttpClientSenderConfigurationUsed to configure HTTP trace sending under thetracing.zipkin.httpnamespace.static classBraveTracerConfiguration.SamplerConfigurationThe sampler configuration.
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ENABLEDThe default enable value.static floatDEFAULT_SAMPLER_PROBABILITYstatic java.lang.StringPREFIXprotected brave.Tracing.BuildertracingBuilder
-
Constructor Summary
Constructors Constructor Description BraveTracerConfiguration(io.micronaut.runtime.ApplicationConfiguration configuration)Constructs a newBraveTracerConfiguration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description brave.Tracing.BuildergetTracingBuilder()booleanisEnabled()voidsetClock(brave.Clock clock)voidsetCurrentTraceContext(brave.propagation.CurrentTraceContext traceContext)Sets the current trace context.voidsetEnabled(boolean enabled)Default value (false).voidsetErrorParser(brave.ErrorParser errorParser)voidsetPropagationFactory(brave.propagation.Propagation.Factory propagationFactory)voidsetSampler(brave.sampler.Sampler sampler)voidsetSamplerConfiguration(BraveTracerConfiguration.SamplerConfiguration samplerConfiguration)
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_SAMPLER_PROBABILITY
public static final float DEFAULT_SAMPLER_PROBABILITY
- See Also:
- Constant Field Values
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
The default enable value.- See Also:
- Constant Field Values
-
tracingBuilder
@ConfigurationBuilder(prefixes="", excludes={"errorParser","clock","endpoint","spanReporter","propagationFactory","currentTraceContext","sampler"}) protected brave.Tracing.Builder tracingBuilder
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin 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 BraveTracerConfiguration.SamplerConfiguration samplerConfiguration)- Parameters:
samplerConfiguration- the configuration
-
getTracingBuilder
public brave.Tracing.Builder getTracingBuilder()
- Returns:
- the builder
-
setSampler
@Inject public void setSampler(@Nullable brave.sampler.Sampler sampler)- Parameters:
sampler- the sampler
-
setErrorParser
@Inject public void setErrorParser(@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 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
-
-