Class 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()
    • 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 using TracingConfig.Builder, the name is helidon
    • 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 component
        enabledByDefault - 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, the newer wins.
        Parameters:
        older - older instance to merge
        newer - 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 to component(String) and ComponentTracingConfig.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