Class 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
    • 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 component
        enabledByDefault - 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 from Config.
        Parameters:
        name - name of the component
        config - config for a new component
        Returns:
        a new traced component configuration