Class DeclarativeConfigBridge
java.lang.Object
io.opentelemetry.instrumentation.config.bridge.DeclarativeConfigBridge
Exposes flat
ConfigProperties through the declarative configuration APIs.-
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.api.incubator.config.DeclarativeConfigPropertiescreateComponentProperties(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties, String configPropertyPrefix) Creates component-local declarative properties backed by flatConfigProperties.static io.opentelemetry.api.incubator.config.ConfigProvidercreateInstrumentationConfig(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties) Creates the complete declarative instrumentation configuration backed by flatConfigProperties.
-
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 flatConfigProperties. -
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 flatConfigProperties.The returned properties translate scalar and string scalar-list reads relative to the component root. For example, a component can read
enabledwhile the bridge resolves the value fromconfigPropertyPrefix + "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 onlyStringelements, and structured lists are not supported.
-