Class TracingConfig.Builder

java.lang.Object
codes.grow.packages.datadogapm.tracing.TracingConfig.Builder
Enclosing class:
TracingConfig

public static final class TracingConfig.Builder extends Object
Builder for TracingConfig.
  • Method Details

    • serviceName

      public TracingConfig.Builder serviceName(String serviceName)
      Sets service.name.
      Parameters:
      serviceName - non-blank name
      Returns:
      this builder
    • serviceVersion

      public TracingConfig.Builder serviceVersion(String serviceVersion)
      Sets service.version.
      Parameters:
      serviceVersion - version or null
      Returns:
      this builder
    • environment

      public TracingConfig.Builder environment(String environment)
      Sets deployment.environment.name and the legacy deployment.environment.
      Parameters:
      environment - environment or null
      Returns:
      this builder
    • resourceAttributes

      public TracingConfig.Builder resourceAttributes(Map<String,?> attributes)
      Replaces the extra resource attributes.
      Parameters:
      attributes - attributes
      Returns:
      this builder
    • endpoint

      public TracingConfig.Builder endpoint(String endpoint)
      Sets the export endpoint.
      Parameters:
      endpoint - http(s) URL or null for the service default
      Returns:
      this builder
    • protocol

      public TracingConfig.Builder protocol(TracingConfig.Protocol protocol)
      Sets the export protocol (default http/protobuf unless the service changes it).
      Parameters:
      protocol - protocol
      Returns:
      this builder
    • headers

      public TracingConfig.Builder headers(Map<String,String> headers)
      Replaces the export headers.
      Parameters:
      headers - headers
      Returns:
      this builder
    • header

      public TracingConfig.Builder header(String name, String value)
      Adds an export header.
      Parameters:
      name - header name
      value - header value
      Returns:
      this builder
    • sampler

      Sets the sampler.
      Parameters:
      sampler - sampler
      Returns:
      this builder
    • samplerRatio

      public TracingConfig.Builder samplerRatio(double samplerRatio)
      Sets the ratio of the ratio samplers.
      Parameters:
      samplerRatio - between 0 and 1
      Returns:
      this builder
    • propagators

      public TracingConfig.Builder propagators(List<String> propagators)
      Sets the propagators (tracecontext, baggage, b3, b3multi, none or names the service package registers).
      Parameters:
      propagators - names
      Returns:
      this builder
    • batch

      Sets the batch processor settings.
      Parameters:
      batch - settings
      Returns:
      this builder
    • tls

      Sets the exporter TLS options.
      Parameters:
      tls - options or null
      Returns:
      this builder
    • compression

      public TracingConfig.Builder compression(TracingConfig.Compression compression)
      Sets the export compression.
      Parameters:
      compression - compression
      Returns:
      this builder
    • setGlobal

      public TracingConfig.Builder setGlobal(boolean setGlobal)
      Whether to register the SDK globally (default true).
      Parameters:
      setGlobal - flag
      Returns:
      this builder
    • build

      public TracingConfig build()
      Validates and builds.
      Returns:
      config
      Throws:
      ConfigException - when a value is invalid