- java.lang.Object
-
- io.helidon.tracing.config.Traceable
-
- io.helidon.tracing.config.TracingConfig
-
public abstract class TracingConfig extends Traceable
Tracing configuration that contains traced components (such as WebServer, Security) and their traced spans and span logs. Spans can be renamed through configuration, components, spans and span logs may be disabled through this configuration.- See Also:
create(io.helidon.config.Config)
,builder()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TracingConfig.Builder
Fluent API builder forTracingConfig
.
-
Field Summary
Fields Modifier and Type Field Description static TracingConfig
DISABLED
Traced conifg that is disabled for all components, spans and logs.static TracingConfig
ENABLED
Traced config that is enabled for all components, spans and logs.
-
Constructor Summary
Constructors Modifier Constructor Description protected
TracingConfig(String name)
A new traced configuration.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TracingConfig.Builder
builder()
A fluent API builder for tracing configuration.ComponentTracingConfig
component(String componentName)
Configuration of a traced component.ComponentTracingConfig
component(String componentName, boolean enabledByDefault)
Configuration of a traced component.static TracingConfig
create(Config config)
Create new tracing configuration based on the provided config.protected abstract Optional<ComponentTracingConfig>
getComponent(String componentName)
Configuration of a traced component.static TracingConfig
merge(TracingConfig older, TracingConfig newer)
Merge two configurations together.SpanTracingConfig
spanConfig(String component, String spanName)
Return configuration of a specific span.String
toString()
-
-
-
Field Detail
-
ENABLED
public static final TracingConfig ENABLED
Traced config that is enabled for all components, spans and logs.
-
DISABLED
public static final TracingConfig DISABLED
Traced conifg that is disabled for all components, spans and logs.
-
-
Constructor Detail
-
TracingConfig
protected TracingConfig(String name)
A new traced configuration.- Parameters:
name
- name of this configuration, when created usingTracingConfig.Builder
, the name ishelidon
-
-
Method Detail
-
getComponent
protected abstract Optional<ComponentTracingConfig> getComponent(String componentName)
Configuration of a traced component.- Parameters:
componentName
- name of the component- Returns:
- component tracing configuration or empty if defaults should be used
-
component
public ComponentTracingConfig component(String componentName)
Configuration of a traced component.- Parameters:
componentName
- name of the component- Returns:
- component tracing configuration if configured, or an enabled component configuration
-
component
public ComponentTracingConfig component(String componentName, boolean enabledByDefault)
Configuration of a traced component.- Parameters:
componentName
- name of the componentenabledByDefault
- whether the component should be enabled or disabled in case it is not configured- Returns:
- component tracing configuration if configured, or an enabled/disabled component configuration depending on
enabledByDefault
-
create
public static TracingConfig create(Config config)
Create new tracing configuration based on the provided config.- Parameters:
config
- configuration of tracing- Returns:
- tracing configuration
-
builder
public static TracingConfig.Builder builder()
A fluent API builder for tracing configuration.- Returns:
- a new builder instance
-
merge
public static TracingConfig merge(TracingConfig older, TracingConfig newer)
Merge two configurations together. The result will combine configuration from both configurations. In case of conflicts, thenewer
wins.- Parameters:
older
- older instance to mergenewer
- newer (more significant) instance to merge- Returns:
- a new configuration combining odler and newer
-
spanConfig
public SpanTracingConfig spanConfig(String component, String spanName)
Return configuration of a specific span. This is a shortcut method tocomponent(String)
andComponentTracingConfig.span(String)
.- Parameters:
component
- component, such as "web-server", "security"spanName
- name of the span, such as "HTTP Request", "security:atn"- Returns:
- configuration of the span if present in this traced system configuration
-
-