Class TempoTracingConfig.Builder

java.lang.Object
codes.grow.packages.tempo.TempoTracingConfig.Builder
Enclosing class:
TempoTracingConfig

public static final class TempoTracingConfig.Builder extends Object
Builder of TempoTracingConfig; every field is optional.
  • Method Details

    • serviceName

      public TempoTracingConfig.Builder serviceName(String serviceName)
      Sets service.name (default OTEL_SERVICE_NAME).
      Parameters:
      serviceName - name
      Returns:
      this builder
    • serviceVersion

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

      public TempoTracingConfig.Builder environment(String environment)
      Sets deployment.environment.
      Parameters:
      environment - environment or null
      Returns:
      this builder
    • resourceAttributes

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

      public TempoTracingConfig.Builder endpoint(String endpoint)
      Sets the OTLP endpoint (http://host:4318 or a full …/v1/traces URL; http://host:4317 for gRPC).
      Parameters:
      endpoint - URL or null
      Returns:
      this builder
    • protocol

      Sets the export protocol.
      Parameters:
      protocol - protocol or null
      Returns:
      this builder
    • headers

      public TempoTracingConfig.Builder headers(Map<String,String> headers)
      Replaces the export headers (for example a proxy Authorization).
      Parameters:
      headers - headers
      Returns:
      this builder
    • header

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

      public TempoTracingConfig.Builder tenantId(String tenantId)
      Sets the tenant sent as X-Scope-OrgID (gRPC metadata x-scope-orgid); an empty string removes the header.
      Parameters:
      tenantId - tenant or null (environment)
      Returns:
      this builder
    • sampler

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

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

      public TempoTracingConfig.Builder propagators(List<String> propagators)
      Sets the propagators.
      Parameters:
      propagators - names (tracecontext, baggage, b3, b3multi)
      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 TempoTracingConfig.Builder compression(TracingConfig.Compression compression)
      Sets the export compression.
      Parameters:
      compression - compression or null
      Returns:
      this builder
    • setGlobal

      public TempoTracingConfig.Builder setGlobal(boolean setGlobal)
      Whether to register the SDK as the global OpenTelemetry (default true).
      Parameters:
      setGlobal - flag
      Returns:
      this builder
    • build

      public TempoTracingConfig build()
      Builds the (unresolved) settings.
      Returns:
      settings