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") the declarative configuration is read from the
headers/development node of the supplied configuration, falling back to the deprecated
capture_headers/development node, and the corresponding flat properties are
otel.instrumentation.messaging.experimental.headers.included, ...headers.excluded and
otel.instrumentation.messaging.experimental.capture-headers.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.instrumentation.api.config.IncludeExcluderesolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) 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, boolean systemPropertyFallback) Returns the configured selector, ornullwhen nothing is configured to be captured.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
@Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName) 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
@Nullable public static io.opentelemetry.instrumentation.api.config.IncludeExclude resolve(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties config, String instrumentationName, String selectorName, 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:
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.
-
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(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties, java.lang.String, java.lang.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(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties, java.lang.String, java.lang.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.
-