Class JaegerRemoteSampler.Builder

java.lang.Object
codes.grow.packages.jaeger.JaegerRemoteSampler.Builder
Enclosing class:
JaegerRemoteSampler

public static final class JaegerRemoteSampler.Builder extends Object
Builder of a JaegerRemoteSampler.
  • Method Details

    • samplingUrl

      public JaegerRemoteSampler.Builder samplingUrl(String samplingUrl)
      Sets the sampling endpoint (default: config.samplingUrl()).
      Parameters:
      samplingUrl - URL
      Returns:
      this builder
    • pollInterval

      public JaegerRemoteSampler.Builder pollInterval(Duration pollInterval)
      Sets the poll interval (default 1 min).
      Parameters:
      pollInterval - positive interval, null = default
      Returns:
      this builder
    • initialSamplingRate

      public JaegerRemoteSampler.Builder initialSamplingRate(double rate)
      Sets the probability used until the first strategy arrives (default 0.001).
      Parameters:
      rate - 0..1
      Returns:
      this builder
    • config

      public JaegerRemoteSampler.Builder config(JaegerConfig config)
      Sets the transport settings (timeouts, retries, TLS, proxy, headers, token, samplingUrl).
      Parameters:
      config - configuration
      Returns:
      this builder
    • onError

      Receives poll errors (the last good strategy stays in use).
      Parameters:
      onError - callback
      Returns:
      this builder
    • onUpdate

      Called after each successful poll.
      Parameters:
      onUpdate - callback
      Returns:
      this builder
    • autoStart

      public JaegerRemoteSampler.Builder autoStart(boolean autoStart)
      Whether build() starts polling (default true).
      Parameters:
      autoStart - start at once
      Returns:
      this builder
    • build

      public JaegerRemoteSampler build()
      Validates and builds (and starts, unless autoStart(false)) the sampler.
      Returns:
      the sampler
      Throws:
      ConfigException - for a blank service, a bad URL, a non-positive interval or an initial rate outside 0..1