Class DeclarativeConfigPropertiesBridgeBuilder

java.lang.Object
io.opentelemetry.instrumentation.config.bridge.DeclarativeConfigPropertiesBridgeBuilder

public class DeclarativeConfigPropertiesBridgeBuilder extends Object
A builder for DeclarativeConfigPropertiesBridge that allows adding translations and fixed values for properties.
  • Constructor Details

    • DeclarativeConfigPropertiesBridgeBuilder

      public DeclarativeConfigPropertiesBridgeBuilder()
  • Method Details

    • addMapping

      @CanIgnoreReturnValue public DeclarativeConfigPropertiesBridgeBuilder addMapping(String propertyPrefix, String yamlPath)
      Adds a mapping from a property prefix to a YAML path.

      For example, if the property prefix is "otel.javaagent" and the YAML path is "agent", then any property starting with "otel.javaagent." will be resolved against the "agent" node in the instrumentation/java section of the YAML configuration.

      Parameters:
      propertyPrefix - the prefix of the property to translate
      yamlPath - the YAML path to resolve the property against
    • addOverride

      @CanIgnoreReturnValue public DeclarativeConfigPropertiesBridgeBuilder addOverride(String propertyName, Object value)
      Adds a fixed override value for a property.
      Parameters:
      propertyName - the name of the property to override
      value - the value to return when the property is requested
    • build

      public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties build(io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk)
      Build ConfigProperties from the autoConfiguredOpenTelemetrySdk.
    • build

      public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties build(@Nullable io.opentelemetry.api.incubator.config.DeclarativeConfigProperties node)
      Build ConfigProperties from the provided DeclarativeConfigProperties node.
      Parameters:
      node - the declarative config properties to build from
      Returns:
      a new instance of ConfigProperties
    • buildFromInstrumentationConfig

      public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties buildFromInstrumentationConfig(@Nullable io.opentelemetry.api.incubator.config.DeclarativeConfigProperties instrumentationConfig)
      Build ConfigProperties from the DeclarativeConfigProperties provided by the instrumentation configuration.

      If the provided instrumentationConfig is null, an empty DeclarativeConfigProperties will be used.

      Parameters:
      instrumentationConfig - the instrumentation configuration to build from
      Returns:
      a new instance of ConfigProperties