Class DeclarativeConfigPropertiesBridgeBuilder
java.lang.Object
io.opentelemetry.instrumentation.config.bridge.DeclarativeConfigPropertiesBridgeBuilder
A builder for
DeclarativeConfigPropertiesBridge that allows adding translations and fixed
values for properties.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMapping(String propertyPrefix, String yamlPath) Adds a mapping from a property prefix to a YAML path.addOverride(String propertyName, Object value) Adds a fixed override value for a property.io.opentelemetry.sdk.autoconfigure.spi.ConfigPropertiesbuild(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties node) BuildConfigPropertiesfrom the providedDeclarativeConfigPropertiesnode.io.opentelemetry.sdk.autoconfigure.spi.ConfigPropertiesbuild(io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) BuildConfigPropertiesfrom theautoConfiguredOpenTelemetrySdk.io.opentelemetry.sdk.autoconfigure.spi.ConfigPropertiesbuildFromInstrumentationConfig(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties instrumentationConfig) BuildConfigPropertiesfrom theDeclarativeConfigPropertiesprovided by the instrumentation configuration.
-
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 translateyamlPath- 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 overridevalue- the value to return when the property is requested
-
build
public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties build(io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) BuildConfigPropertiesfrom theautoConfiguredOpenTelemetrySdk. -
build
public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties build(@Nullable io.opentelemetry.api.incubator.config.DeclarativeConfigProperties node) BuildConfigPropertiesfrom the providedDeclarativeConfigPropertiesnode.- 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) BuildConfigPropertiesfrom theDeclarativeConfigPropertiesprovided by the instrumentation configuration.If the provided
instrumentationConfigis null, an emptyDeclarativeConfigPropertieswill be used.- Parameters:
instrumentationConfig- the instrumentation configuration to build from- Returns:
- a new instance of
ConfigProperties
-