Class ExtendedTracerConfig.BuilderBase<BUILDER extends ExtendedTracerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ExtendedTracerConfig>

java.lang.Object
io.helidon.tracing.ExtendedTracerConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
ExtendedTracerConfig.Builder, OpenTelemetryTracerConfig.BuilderBase
Enclosing interface:
ExtendedTracerConfig

public abstract static class ExtendedTracerConfig.BuilderBase<BUILDER extends ExtendedTracerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ExtendedTracerConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for ExtendedTracerConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ExtendedTracerConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ExtendedTracerConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      @Deprecated public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ExtendedTracerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ExtendedTracerConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ExtendedTracerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ExtendedTracerConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • serviceName

      public BUILDER serviceName(String serviceName)
      Service name of the traced service.
      Parameters:
      serviceName - service name
      Returns:
      updated builder instance
      See Also:
    • clearCollectorUri

      public BUILDER clearCollectorUri()
      Clear existing value of collectorUri.
      Returns:
      updated builder instance
      See Also:
    • collectorUri

      public BUILDER collectorUri(URI collectorUri)
      URI for the collector to which to send tracing data.
      Parameters:
      collectorUri - tracing collector URI
      Returns:
      updated builder instance
      See Also:
    • clearCollectorProtocol

      public BUILDER clearCollectorProtocol()
      Clear existing value of collectorProtocol.
      Returns:
      updated builder instance
      See Also:
    • collectorProtocol

      public BUILDER collectorProtocol(String collectorProtocol)
      Protocol (such as http or https) used in connecting to the tracing collector.
      Parameters:
      collectorProtocol - collector protocol
      Returns:
      updated builder instance
      See Also:
    • clearCollectorPort

      public BUILDER clearCollectorPort()
      Clear existing value of collectorPort.
      Returns:
      updated builder instance
      See Also:
    • collectorPort

      public BUILDER collectorPort(int collectorPort)
      Port used in connecting to the tracing collector.
      Parameters:
      collectorPort - collector port number
      Returns:
      updated builder instance
      See Also:
    • clearCollectorHost

      public BUILDER clearCollectorHost()
      Clear existing value of collectorHost.
      Returns:
      updated builder instance
      See Also:
    • collectorHost

      public BUILDER collectorHost(String collectorHost)
      Host used in connecting to the tracing collector.
      Parameters:
      collectorHost - collector host
      Returns:
      updated builder instance
      See Also:
    • clearCollectorPath

      public BUILDER clearCollectorPath()
      Clear existing value of collectorPath.
      Returns:
      updated builder instance
      See Also:
    • collectorPath

      public BUILDER collectorPath(String collectorPath)
      Path at the collector host and port used when sending trace data to the collector.
      Parameters:
      collectorPath - collector path
      Returns:
      updated builder instance
      See Also:
    • tracerTags

      public BUILDER tracerTags(Map<String,String> tracerTags)
      Tracer-level tags with String values added to all reported spans. This method replaces all values with the new ones.
      Parameters:
      tracerTags - tracer-level string-valued tags
      Returns:
      updated builder instance
      See Also:
    • addTracerTags

      public BUILDER addTracerTags(Map<String,String> tracerTags)
      Tracer-level tags with String values added to all reported spans. This method keeps existing values, then puts all new values into the map.
      Parameters:
      tracerTags - tracer-level string-valued tags
      Returns:
      updated builder instance
      See Also:
    • putTracerTag

      public BUILDER putTracerTag(String key, String tracerTag)
      Tracer-level tags with String values added to all reported spans. This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      tracerTag - new value for the key
      Returns:
      updated builder instance
      See Also:
    • intTracerTags

      public BUILDER intTracerTags(Map<String,Integer> intTracerTags)
      Tracer level tags with integer values added to all reported spans. This method replaces all values with the new ones.
      Parameters:
      intTracerTags - tracer-level integer-valued tags
      Returns:
      updated builder instance
      See Also:
    • addIntTracerTags

      public BUILDER addIntTracerTags(Map<String,Integer> intTracerTags)
      Tracer level tags with integer values added to all reported spans. This method keeps existing values, then puts all new values into the map.
      Parameters:
      intTracerTags - tracer-level integer-valued tags
      Returns:
      updated builder instance
      See Also:
    • putIntTracerTag

      public BUILDER putIntTracerTag(String key, Integer intTracerTag)
      Tracer level tags with integer values added to all reported spans. This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      intTracerTag - new value for the key
      Returns:
      updated builder instance
      See Also:
    • booleanTracerTags

      public BUILDER booleanTracerTags(Map<String,Boolean> booleanTracerTags)
      Tracer-level tags with boolean values added to all reported spans. This method replaces all values with the new ones.
      Parameters:
      booleanTracerTags - tracer-level boolean-valued tags
      Returns:
      updated builder instance
      See Also:
    • addBooleanTracerTags

      public BUILDER addBooleanTracerTags(Map<String,Boolean> booleanTracerTags)
      Tracer-level tags with boolean values added to all reported spans. This method keeps existing values, then puts all new values into the map.
      Parameters:
      booleanTracerTags - tracer-level boolean-valued tags
      Returns:
      updated builder instance
      See Also:
    • putBooleanTracerTag

      public BUILDER putBooleanTracerTag(String key, Boolean booleanTracerTag)
      Tracer-level tags with boolean values added to all reported spans. This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      booleanTracerTag - new value for the key
      Returns:
      updated builder instance
      See Also:
    • enabled

      public BUILDER enabled(boolean enabled)
      Whether to enable tracing. That is, whether to use a fully-featured tracing implementation on the path vs. a no-op implementation.
      Parameters:
      enabled - whether tracing is enabled
      Returns:
      updated builder instance
      See Also:
    • registerGlobal

      public BUILDER registerGlobal(boolean registerGlobal)
      Whether to create and register a tracer as the global tracer.
      Parameters:
      registerGlobal - whether to register the configured tracer as global
      Returns:
      updated builder instance
      See Also:
    • clearPrivateKey

      public BUILDER clearPrivateKey()
      Clear existing value of privateKey.
      Returns:
      updated builder instance
      See Also:
    • privateKey

      public BUILDER privateKey(Resource privateKey)
      Private key for connecting securely to the tracing collector.
      Parameters:
      privateKey - private key
      Returns:
      updated builder instance
      See Also:
    • privateKey

      public BUILDER privateKey(ResourceConfig privateKey)
      Private key for connecting securely to the tracing collector.
      Parameters:
      privateKey - prototype of private key
      Returns:
      updated builder instance
      See Also:
    • privateKey

      public BUILDER privateKey(Consumer<ResourceConfig.Builder> consumer)
      Private key for connecting securely to the tracing collector.
      Parameters:
      consumer - consumer of builder of private key
      Returns:
      updated builder instance
      See Also:
    • privateKey

      public BUILDER privateKey(Supplier<? extends Resource> supplier)
      Private key for connecting securely to the tracing collector.
      Parameters:
      supplier - supplier of private key
      Returns:
      updated builder instance
      See Also:
    • clearClientCertificate

      public BUILDER clearClientCertificate()
      Clear existing value of clientCertificate.
      Returns:
      updated builder instance
      See Also:
    • clientCertificate

      public BUILDER clientCertificate(Resource clientCertificate)
      Client certificate for connecting securely to the tracing collector.
      Parameters:
      clientCertificate - client certificate
      Returns:
      updated builder instance
      See Also:
    • clientCertificate

      public BUILDER clientCertificate(ResourceConfig clientCertificate)
      Client certificate for connecting securely to the tracing collector.
      Parameters:
      clientCertificate - prototype of client certificate
      Returns:
      updated builder instance
      See Also:
    • clientCertificate

      public BUILDER clientCertificate(Consumer<ResourceConfig.Builder> consumer)
      Client certificate for connecting securely to the tracing collector.
      Parameters:
      consumer - consumer of builder of client certificate
      Returns:
      updated builder instance
      See Also:
    • clientCertificate

      public BUILDER clientCertificate(Supplier<? extends Resource> supplier)
      Client certificate for connecting securely to the tracing collector.
      Parameters:
      supplier - supplier of client certificate
      Returns:
      updated builder instance
      See Also:
    • clearTrustedCertificate

      public BUILDER clearTrustedCertificate()
      Clear existing value of trustedCertificate.
      Returns:
      updated builder instance
      See Also:
    • trustedCertificate

      public BUILDER trustedCertificate(Resource trustedCertificate)
      Trusted certificates for connecting to the tracing collector.
      Parameters:
      trustedCertificate - trusted certificates
      Returns:
      updated builder instance
      See Also:
    • trustedCertificate

      public BUILDER trustedCertificate(ResourceConfig trustedCertificate)
      Trusted certificates for connecting to the tracing collector.
      Parameters:
      trustedCertificate - prototype of trusted certificates
      Returns:
      updated builder instance
      See Also:
    • trustedCertificate

      public BUILDER trustedCertificate(Consumer<ResourceConfig.Builder> consumer)
      Trusted certificates for connecting to the tracing collector.
      Parameters:
      consumer - consumer of builder of trusted certificates
      Returns:
      updated builder instance
      See Also:
    • trustedCertificate

      public BUILDER trustedCertificate(Supplier<? extends Resource> supplier)
      Trusted certificates for connecting to the tracing collector.
      Parameters:
      supplier - supplier of trusted certificates
      Returns:
      updated builder instance
      See Also:
    • spanProcessorType

      public BUILDER spanProcessorType(SpanProcessorType spanProcessorType)
      Type of span processor for accumulating spans before transmission to the tracing collector.
      Parameters:
      spanProcessorType - span processor type
      Returns:
      updated builder instance
      See Also:
    • scheduleDelay

      public BUILDER scheduleDelay(Duration scheduleDelay)
      Delay between consecutive transmissions to the tracing collector (batch processing).
      Parameters:
      scheduleDelay - delay between consecutive transmissions
      Returns:
      updated builder instance
      See Also:
    • maxQueueSize

      public BUILDER maxQueueSize(int maxQueueSize)
      Maximum number of spans retained before discarding any not sent to the tracing collector (batch processing).
      Parameters:
      maxQueueSize - maximum number of spans kept for transmission
      Returns:
      updated builder instance
      See Also:
    • maxExportBatchSize

      public BUILDER maxExportBatchSize(int maxExportBatchSize)
      Maximum number of spans grouped for transmission together; typically does not exceed maxQueueSize() (batch processing).
      Parameters:
      maxExportBatchSize - maximum number of spans batched
      Returns:
      updated builder instance
      See Also:
    • exportTimeout

      public BUILDER exportTimeout(Duration exportTimeout)
      Maximum time a transmission can be in progress before being cancelled.
      Parameters:
      exportTimeout - maximum transmission time
      Returns:
      updated builder instance
      See Also:
    • samplerType

      public BUILDER samplerType(SamplerType samplerType)
      Type of sampler for collecting spans.
      Parameters:
      samplerType - sampler type
      Returns:
      updated builder instance
      See Also:
    • samplerParam

      public BUILDER samplerParam(double samplerParam)
      Parameter value used by the selected sampler; interpretation depends on the sampler type..
      Parameters:
      samplerParam - sampler parameter value
      Returns:
      updated builder instance
      See Also:
    • serviceName

      public Optional<String> serviceName()
      Service name of the traced service.
      Returns:
      service name
    • collectorUri

      public Optional<URI> collectorUri()
      URI for the collector to which to send tracing data.
      Returns:
      tracing collector URI
    • collectorProtocol

      public Optional<String> collectorProtocol()
      Protocol (such as http or https) used in connecting to the tracing collector.
      Returns:
      collector protocol
    • collectorPort

      public Optional<Integer> collectorPort()
      Port used in connecting to the tracing collector.
      Returns:
      collector port number
    • collectorHost

      public Optional<String> collectorHost()
      Host used in connecting to the tracing collector.
      Returns:
      collector host
    • collectorPath

      public Optional<String> collectorPath()
      Path at the collector host and port used when sending trace data to the collector.
      Returns:
      collector path
    • tracerTags

      public Map<String,String> tracerTags()
      Tracer-level tags with String values added to all reported spans.
      Returns:
      tracer-level string-valued tags
    • intTracerTags

      public Map<String,Integer> intTracerTags()
      Tracer level tags with integer values added to all reported spans.
      Returns:
      tracer-level integer-valued tags
    • booleanTracerTags

      public Map<String,Boolean> booleanTracerTags()
      Tracer-level tags with boolean values added to all reported spans.
      Returns:
      tracer-level boolean-valued tags
    • enabled

      public boolean enabled()
      Whether to enable tracing. That is, whether to use a fully-featured tracing implementation on the path vs. a no-op implementation.
      Returns:
      whether tracing is enabled
    • registerGlobal

      public boolean registerGlobal()
      Whether to create and register a tracer as the global tracer.
      Returns:
      whether to register the configured tracer as global
    • privateKey

      public Optional<Resource> privateKey()
      Private key for connecting securely to the tracing collector.
      Returns:
      private key
    • clientCertificate

      public Optional<Resource> clientCertificate()
      Client certificate for connecting securely to the tracing collector.
      Returns:
      client certificate
    • trustedCertificate

      public Optional<Resource> trustedCertificate()
      Trusted certificates for connecting to the tracing collector.
      Returns:
      trusted certificates
    • spanProcessorType

      public SpanProcessorType spanProcessorType()
      Type of span processor for accumulating spans before transmission to the tracing collector.
      Returns:
      span processor type
    • scheduleDelay

      public Duration scheduleDelay()
      Delay between consecutive transmissions to the tracing collector (batch processing).
      Returns:
      delay between consecutive transmissions
    • maxQueueSize

      public int maxQueueSize()
      Maximum number of spans retained before discarding any not sent to the tracing collector (batch processing).
      Returns:
      maximum number of spans kept for transmission
    • maxExportBatchSize

      public int maxExportBatchSize()
      Maximum number of spans grouped for transmission together; typically does not exceed maxQueueSize() (batch processing).
      Returns:
      maximum number of spans batched
    • exportTimeout

      public Duration exportTimeout()
      Maximum time a transmission can be in progress before being cancelled.
      Returns:
      maximum transmission time
    • samplerType

      public SamplerType samplerType()
      Type of sampler for collecting spans.
      Returns:
      sampler type
    • samplerParam

      public double samplerParam()
      Parameter value used by the selected sampler; interpretation depends on the sampler type..
      Returns:
      sampler parameter value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance