- java.lang.Object
-
- io.helidon.tracing.config.Traceable
-
- io.helidon.tracing.config.ComponentTracingConfig
-
public abstract class ComponentTracingConfig extends Traceable
A component is a single "layer" of the application that can trace. Component examples:- web-server: webServer adds the root tracing span + two additional spans (content-read and content-write)
- security: security adds the overall request security span, a span for authentication ("security:atn"), a span for authorization "security:atz", and a span for response processing ("security:response")
- jax-rs: JAX-RS integration adds spans for overall resource invocation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ComponentTracingConfig.Builder
Fluent API builder forComponentTracingConfig
.
-
Field Summary
Fields Modifier and Type Field Description static ComponentTracingConfig
DISABLED
Disabled component - all subsequent calls return disabled spans and logs.static ComponentTracingConfig
ENABLED
Enabled component - all subsequent calls return enabled spans and logs.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComponentTracingConfig(String name)
A new named component.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ComponentTracingConfig.Builder
builder(String name)
Fluent API builder for traced component.static ComponentTracingConfig
create(String name, Config config)
Create a new traced component configuration fromConfig
.protected abstract Optional<SpanTracingConfig>
getSpan(String spanName)
Get a traced span configuration for a named span.SpanTracingConfig
span(String spanName)
Get a traced span configuration for a named span.SpanTracingConfig
span(String spanName, boolean enabledByDefault)
Get a traced span configuration for a named span.
-
-
-
Field Detail
-
DISABLED
public static final ComponentTracingConfig DISABLED
Disabled component - all subsequent calls return disabled spans and logs.
-
ENABLED
public static final ComponentTracingConfig ENABLED
Enabled component - all subsequent calls return enabled spans and logs.
-
-
Constructor Detail
-
ComponentTracingConfig
protected ComponentTracingConfig(String name)
A new named component.- Parameters:
name
- name of the component
-
-
Method Detail
-
getSpan
protected abstract Optional<SpanTracingConfig> getSpan(String spanName)
Get a traced span configuration for a named span.- Parameters:
spanName
- name of the span in this component- Returns:
- configuration of that span if present
-
span
public SpanTracingConfig span(String spanName)
Get a traced span configuration for a named span.- Parameters:
spanName
- name of a span in this component- Returns:
- configuration of the span, or enabled configuration if not configured
- See Also:
span(String, boolean)
-
span
public SpanTracingConfig span(String spanName, boolean enabledByDefault)
Get a traced span configuration for a named span.- Parameters:
spanName
- name of a span in this componentenabledByDefault
- whether the result is enabled if a configuration is not present- Returns:
- configuration of the span, or a span configuration enabled or disabled depending on
enabledByDefault
if not configured
-
builder
public static ComponentTracingConfig.Builder builder(String name)
Fluent API builder for traced component.- Parameters:
name
- the name of the component- Returns:
- a new builder instance
-
create
public static ComponentTracingConfig create(String name, Config config)
Create a new traced component configuration fromConfig
.- Parameters:
name
- name of the componentconfig
- config for a new component- Returns:
- a new traced component configuration
-
-