Class DeclarativeConfigBridge

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

public final class DeclarativeConfigBridge extends Object
Exposes flat ConfigProperties through the declarative configuration APIs.
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.opentelemetry.api.incubator.config.DeclarativeConfigProperties
    createComponentProperties(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties, String configPropertyPrefix)
    Creates component-local declarative properties backed by flat ConfigProperties.
    static io.opentelemetry.api.incubator.config.ConfigProvider
    createInstrumentationConfig(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties)
    Creates the complete declarative instrumentation configuration backed by flat ConfigProperties.

    Methods inherited from class java.lang.Object

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

    • createInstrumentationConfig

      public static io.opentelemetry.api.incubator.config.ConfigProvider createInstrumentationConfig(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties)
      Creates the complete declarative instrumentation configuration backed by flat ConfigProperties.
    • createComponentProperties

      public static io.opentelemetry.api.incubator.config.DeclarativeConfigProperties createComponentProperties(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties, String configPropertyPrefix)
      Creates component-local declarative properties backed by flat ConfigProperties.

      The returned properties translate scalar and string scalar-list reads relative to the component root. For example, a component can read enabled while the bridge resolves the value from configPropertyPrefix + "enabled".

      This bridge does not provide full parity with native declarative configuration: DeclarativeConfigProperties.getPropertyKeys() is always empty, DeclarativeConfigProperties.getStructured(String) returns a non-null view even when the child is absent, scalar lists support only String elements, and structured lists are not supported.