Class SelectorConfig
included/excluded selector and its deprecated include-only
predecessor, so that precedence and deprecation warnings are uniform across instrumentations.
The property names are derived from the instrumentation and selector names. For
("messaging", "headers"), experimental resolution reads the headers/development node and
otel.instrumentation.messaging.experimental.headers.included|excluded. Stable resolution
reads the headers node and
otel.instrumentation.messaging.headers.included|excluded. Both modes fall back to the deprecated
experimental capture_headers/development node and
otel.instrumentation.messaging.experimental.capture-headers flat property.
Flat system properties are read directly only when systemPropertyFallback is
true; otherwise the flat names describe the equivalent form of the supplied declarative
configuration.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe stability of the included/excluded selector configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.instrumentation.api.config.IncludeExcluderesolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) Deprecated.static io.opentelemetry.instrumentation.api.config.IncludeExcluderesolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, boolean systemPropertyFallback) Deprecated.Useresolve(DeclarativeConfigProperties, String, String, Stability, boolean)and specify the selector configuration stability explicitly.static io.opentelemetry.instrumentation.api.config.IncludeExcluderesolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, SelectorConfig.Stability stability) Returns the configured selector, ornullwhen nothing is configured to be captured.static io.opentelemetry.instrumentation.api.config.IncludeExcluderesolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, SelectorConfig.Stability stability, boolean systemPropertyFallback) Returns the configured selector, ornullwhen nothing is configured to be captured.static io.opentelemetry.instrumentation.api.config.IncludeExcluderesolveDeprecatedCapture(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, String replacementInstrumentationName, SelectorConfig.Stability replacementStability, boolean systemPropertyFallback) Resolves the deprecated include-only predecessor of a selector.resolveLegacyBoolean(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) Returns a predicate matching the configured selector, ornullwhen nothing is configured to be captured.resolveLegacyBoolean(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, String deprecatedSelectorName) Returns a predicate matching the configured selector, ornullwhen nothing is configured to be captured.resolveLegacyLiteral(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) Returns a predicate matching the configured selector, ornullwhen nothing is configured to be captured.resolveLegacyLiteral(List<String> deprecatedValues) Returns a predicate matching the given deprecated include-only values, ornullwhen nothing is configured to be captured.
-
Method Details
-
resolve
@Deprecated @Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) Deprecated.Useresolve(DeclarativeConfigProperties, String, String, Stability)and specify the selector configuration stability explicitly. May be removed in the next minor release.Returns the configured selector, ornullwhen nothing is configured to be captured.Note that
nullis returned rather than an empty selector because an empty selector matches every value.Values of the deprecated include-only setting that contain
*or?are ignored and logged, since that setting matches values literally and never supported wildcards. -
resolve
@Deprecated @Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, boolean systemPropertyFallback) Deprecated.Useresolve(DeclarativeConfigProperties, String, String, Stability, boolean)and specify the selector configuration stability explicitly. May be removed in the next minor release.Returns the configured selector, ornullwhen nothing is configured to be captured.Values of the deprecated include-only setting that contain
*or?are ignored and logged, since that setting matches values literally and never supported wildcards.- Parameters:
systemPropertyFallback- whether to fall back to the flat system properties when the declarative configuration does not contain a value. This is needed by library instrumentation entry points that have no programmatic configuration surface.
-
resolve
@Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, SelectorConfig.Stability stability) Returns the configured selector, ornullwhen nothing is configured to be captured.Values of the deprecated include-only setting that contain
*or?are ignored and logged, since that setting matches values literally and never supported wildcards.- Parameters:
stability- whether the included/excluded selector is stable or experimental
-
resolve
@Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, SelectorConfig.Stability stability, boolean systemPropertyFallback) Returns the configured selector, ornullwhen nothing is configured to be captured.Values of the deprecated include-only setting that contain
*or?are ignored and logged, since that setting matches values literally and never supported wildcards.- Parameters:
stability- whether the included/excluded selector is stable or experimentalsystemPropertyFallback- whether to fall back to the flat system properties when the declarative configuration does not contain a value. This is needed by library instrumentation entry points that have no programmatic configuration surface.
-
resolveDeprecatedCapture
@Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolveDeprecatedCapture(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, String replacementInstrumentationName, SelectorConfig.Stability replacementStability, boolean systemPropertyFallback) Resolves the deprecated include-only predecessor of a selector.- Parameters:
instrumentationName- the instrumentation namespace of the deprecated settingreplacementInstrumentationName- the instrumentation namespace of the replacementreplacementStability- whether the replacement selector is stable or experimentalsystemPropertyFallback- whether to fall back to the flat system property when the declarative configuration does not contain a value
-
resolveLegacyLiteral
@Nullable public static Predicate<String> resolveLegacyLiteral(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) Returns a predicate matching the configured selector, ornullwhen nothing is configured to be captured.Unlike
resolve(DeclarativeConfigProperties, String, String), the values of the deprecated include-only setting are matched literally, except for the single value"*"which matches everything. This preserves the behavior of settings that documented"*"as capturing all values, where interpreting the remaining values as globs would silently widen what is captured. -
resolveLegacyLiteral
Returns a predicate matching the given deprecated include-only values, ornullwhen nothing is configured to be captured.The values are matched literally, except for the single value
"*"which matches everything. This preserves the behavior of settings that documented"*"as capturing all values, where interpreting the remaining values as globs would silently widen what is captured. -
resolveLegacyBoolean
@Nullable public static Predicate<String> resolveLegacyBoolean(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) Returns a predicate matching the configured selector, ornullwhen nothing is configured to be captured.Unlike
resolve(DeclarativeConfigProperties, String, String), the deprecated setting is a boolean, wheretrueselects every value andfalseselects none. -
resolveLegacyBoolean
@Nullable public static Predicate<String> resolveLegacyBoolean(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, String deprecatedSelectorName) Returns a predicate matching the configured selector, ornullwhen nothing is configured to be captured.Unlike
resolveLegacyBoolean(DeclarativeConfigProperties, String, String), the deprecated boolean setting is named afterdeprecatedSelectorNameinstead ofselectorName, for settings that were not renamed consistently with their replacement.
-
resolve(DeclarativeConfigProperties, String, String, Stability)and specify the selector configuration stability explicitly.