Class FileConfiguration

java.lang.Object
io.opentelemetry.sdk.extension.incubator.fileconfig.FileConfiguration

public final class FileConfiguration extends Object
Configure OpenTelemetrySdk from YAML configuration files conforming to the schema in open-telemetry/opentelemetry-configuration.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.opentelemetry.sdk.OpenTelemetrySdk
    create(io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel configurationModel)
    Interpret the configurationModel to create OpenTelemetrySdk instance corresponding to the configuration.
    static io.opentelemetry.sdk.OpenTelemetrySdk
    create(io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel configurationModel, io.opentelemetry.sdk.autoconfigure.internal.ComponentLoader componentLoader)
    Interpret the configurationModel to create OpenTelemetrySdk instance corresponding to the configuration.
    static io.opentelemetry.sdk.trace.samplers.Sampler
    createSampler(io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties genericSamplerModel)
    Create a SamplerModel from the samplerModel representing the sampler config.
    static io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel
    parse(InputStream configuration)
    Parse the configuration YAML and return the OpenTelemetryConfigurationModel.
    static io.opentelemetry.sdk.OpenTelemetrySdk
    static io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties
    toConfigProperties(io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel model)
    Convert the model to a generic StructuredConfigProperties.
    static io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties
    Convert the configuration YAML to a generic StructuredConfigProperties.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parseAndCreate

      public static io.opentelemetry.sdk.OpenTelemetrySdk parseAndCreate(InputStream inputStream)
      Throws:
      io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException - if unable to parse or interpret
    • create

      public static io.opentelemetry.sdk.OpenTelemetrySdk create(io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel configurationModel)
      Interpret the configurationModel to create OpenTelemetrySdk instance corresponding to the configuration.
      Parameters:
      configurationModel - the configuration model
      Returns:
      the OpenTelemetrySdk
      Throws:
      io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException - if unable to interpret
    • create

      public static io.opentelemetry.sdk.OpenTelemetrySdk create(io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel configurationModel, io.opentelemetry.sdk.autoconfigure.internal.ComponentLoader componentLoader)
      Interpret the configurationModel to create OpenTelemetrySdk instance corresponding to the configuration.
      Parameters:
      configurationModel - the configuration model
      componentLoader - the component loader used to load ComponentProvider implementations
      Returns:
      the OpenTelemetrySdk
      Throws:
      io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException - if unable to interpret
    • parse

      public static io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel parse(InputStream configuration)
      Parse the configuration YAML and return the OpenTelemetryConfigurationModel.

      Before parsing, environment variable substitution is performed as described in FileConfiguration.EnvSubstitutionConstructor.

      Throws:
      io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException - if unable to parse
    • toConfigProperties

      public static io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties toConfigProperties(io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfigurationModel model)
      Convert the model to a generic StructuredConfigProperties.
      Parameters:
      model - the configuration model
      Returns:
      a generic StructuredConfigProperties representation of the model
    • toConfigProperties

      public static io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties toConfigProperties(InputStream configuration)
      Convert the configuration YAML to a generic StructuredConfigProperties.
      Parameters:
      configuration - configuration YAML
      Returns:
      a generic StructuredConfigProperties representation of the model
    • createSampler

      public static io.opentelemetry.sdk.trace.samplers.Sampler createSampler(io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties genericSamplerModel)
      Create a SamplerModel from the samplerModel representing the sampler config.

      This is used when samplers are composed, with one sampler accepting one or more additional samplers as config properties. The ComponentProvider implementation can call this to configure a delegate SamplerModel from the StructuredConfigProperties corresponding to a particular config property.