Package io.helidon.tracing.config
Class SpanTracingConfig
- java.lang.Object
-
- io.helidon.tracing.config.Traceable
-
- io.helidon.tracing.config.SpanTracingConfig
-
public abstract class SpanTracingConfig extends Traceable
Configuration of a single traced span.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpanTracingConfig.BuilderA fluent API builder forSpanTracingConfig.
-
Field Summary
Fields Modifier and Type Field Description static SpanTracingConfigDISABLEDA traced span that is disabled and all logs on it are disabled as well.static SpanTracingConfigENABLEDA traced span that is inabled and all logs on it are enabled as well.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSpanTracingConfig(String name)A new traceable span.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SpanTracingConfig.Builderbuilder(String name)A fluent API builder to create traced span configuration.static SpanTracingConfigcreate(String name, Config config)Create traced span configuration from aConfig.protected abstract Optional<SpanLogTracingConfig>getSpanLog(String name)Configuration of a traced span log.booleanlogEnabled(String logName, boolean defaultValue)Whether a log event should be logged on the span with a default value.abstract Optional<String>newName()When rename is desired, returns the new name.SpanLogTracingConfigspanLog(String name)Configuration of a traceable span log.StringtoString()
-
-
-
Field Detail
-
DISABLED
public static final SpanTracingConfig DISABLED
A traced span that is disabled and all logs on it are disabled as well.
-
ENABLED
public static final SpanTracingConfig ENABLED
A traced span that is inabled and all logs on it are enabled as well.
-
-
Constructor Detail
-
SpanTracingConfig
protected SpanTracingConfig(String name)
A new traceable span.- Parameters:
name- name of this span
-
-
Method Detail
-
newName
public abstract Optional<String> newName()
When rename is desired, returns the new name.- Returns:
- new name for this span or empty when rename is not desired
-
getSpanLog
protected abstract Optional<SpanLogTracingConfig> getSpanLog(String name)
Configuration of a traced span log.- Parameters:
name- name of the log event- Returns:
- configuration of the log event, or empty if not explicitly configured (used when merging)
-
spanLog
public final SpanLogTracingConfig spanLog(String name)
Configuration of a traceable span log. If this span is disabled, the log is always disabled.- Parameters:
name- name of the log event- Returns:
- configuration of the log event
-
logEnabled
public boolean logEnabled(String logName, boolean defaultValue)
Whether a log event should be logged on the span with a default value.- Parameters:
logName- name of the log eventdefaultValue- to use in case the log event is not configured in this span's configuration- Returns:
- whether to log (
true) the event or not (false), uses the default value for unconfigured logs
-
builder
public static SpanTracingConfig.Builder builder(String name)
A fluent API builder to create traced span configuration.- Parameters:
name- name of the span- Returns:
- a new builder instance
-
create
public static SpanTracingConfig create(String name, Config config)
Create traced span configuration from aConfig.- Parameters:
name- name of the spanconfig- config to load span configuration from- Returns:
- a new traced span configuration
-
-