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.
  • Field Details

    • 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 Details

    • SpanTracingConfig

      protected SpanTracingConfig(String name)
      A new traceable span.
      Parameters:
      name - name of this span
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 event
      defaultValue - 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 a Config.
      Parameters:
      name - name of the span
      config - config to load span configuration from
      Returns:
      a new traced span configuration