Class TransportConfig

java.lang.Object
codes.grow.packages.skywalking.core.TransportConfig

public final class TransportConfig extends Object
Settings of one HttpTransport. Service configs translate their common fields (SPEC section 2.2) into this class.
  • Method Details

    • builder

      public static TransportConfig.Builder builder(String baseUrl)
      Starts a builder with the SPEC defaults.
      Parameters:
      baseUrl - endpoint base URL (http or https)
      Returns:
      a new builder
    • baseUrl

      public String baseUrl()
      Returns the base URL.
      Returns:
      the base URL
    • connectTimeout

      public Duration connectTimeout()
      Returns the connection setup timeout.
      Returns:
      the connect timeout
    • requestTimeout

      public Duration requestTimeout()
      Returns the per-attempt timeout.
      Returns:
      the request timeout
    • totalTimeout

      public Duration totalTimeout()
      Returns the budget of a whole call including retries and backoff.
      Returns:
      the total timeout
    • retry

      public RetryPolicy retry()
      Returns the retry policy.
      Returns:
      the policy
    • tls

      public TlsOptions tls()
      Returns the TLS options.
      Returns:
      the options
    • proxy

      public Optional<String> proxy()
      Returns the proxy URL.
      Returns:
      the proxy, or empty (environment proxies are ignored)
    • headers

      public Map<String,String> headers()
      Returns the extra headers sent with every request.
      Returns:
      immutable header map
    • userAgentSuffix

      public Optional<String> userAgentSuffix()
      Returns the user agent suffix.
      Returns:
      the suffix, or empty
    • userAgent

      public String userAgent()
      Returns the full User-Agent header value.
      Returns:
      the user agent
    • hooks

      public Hooks hooks()
      Returns the hooks.
      Returns:
      the hooks, Hooks.NONE by default
    • logger

      public Logger logger()
      Returns the logger.
      Returns:
      the logger, Logger.NOOP by default
    • knownSecrets

      public Collection<String> knownSecrets()
      Returns the secret values removed from every error message, hook and log line.
      Returns:
      the current known secrets
    • clock

      public Clock clock()
      Returns the clock used for Retry-After dates.
      Returns:
      the clock
    • retryAfterHeaders

      public List<String> retryAfterHeaders()
      Returns the vendor headers read as a retry hint when a 429 or 503 response has no Retry-After (for example X-RateLimit-Reset), parsed with RetryPolicy.parseRateLimitReset(java.lang.String, java.time.Instant).
      Returns:
      header names in lookup order (empty by default)
    • errorMapper

      public ErrorMapper errorMapper()
      Returns the service error mapper.
      Returns:
      the mapper (ErrorMapper.NONE by default)