Class ScopeConfiguratorBuilder<T>
java.lang.Object
io.opentelemetry.sdk.internal.ScopeConfiguratorBuilder<T>
- Type Parameters:
T- The scope configuration object, e.g.TracerConfig,LoggerConfig,MeterConfig.
Builder for
ScopeConfigurator.
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 TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ScopeConfigurator<T> private final List<ScopeConfiguratorBuilder.Condition<T>> private T -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCondition(Predicate<InstrumentationScopeInfo> scopePredicate, T scopeConfig) Add a condition.build()Build aScopeConfiguratorwith the configuration of this builder.static Predicate<InstrumentationScopeInfo> nameEquals(String scopeName) Helper function for exact matchingInstrumentationScopeInfo.getName()against thescopeName.static Predicate<InstrumentationScopeInfo> nameMatchesGlob(String globPattern) Helper function for pattern matchingInstrumentationScopeInfo.getName()against theglobPattern.setDefault(T defaultScopeConfig) Set the default scope config, which is returned byFunction.apply(Object)if aInstrumentationScopeInfodoes not match anyconditions.
-
Field Details
-
baseScopeConfigurator
-
defaultScopeConfig
-
conditions
-
-
Constructor Details
-
ScopeConfiguratorBuilder
ScopeConfiguratorBuilder(ScopeConfigurator<T> baseScopeConfigurator)
-
-
Method Details
-
setDefault
Set the default scope config, which is returned byFunction.apply(Object)if aInstrumentationScopeInfodoes not match anyconditions. If a default is not set, an SDK defined default is used. -
addCondition
public ScopeConfiguratorBuilder<T> addCondition(Predicate<InstrumentationScopeInfo> scopePredicate, T scopeConfig) Add a condition. Conditions are evaluated in order. ThescopeConfigfor the first match is returned byFunction.apply(Object).- Parameters:
scopePredicate- predicate thatInstrumentationScopeInfos are evaluated againstscopeConfig- the scope config to use when this condition is the first matchingscopePredicate- See Also:
-
nameMatchesGlob
Helper function for pattern matchingInstrumentationScopeInfo.getName()against theglobPattern.globPatternmay contain the wildcard characters*and?with the following matching criteria:*matches 0 or more instances of any character?matches exactly one instance of any character
- See Also:
-
nameEquals
Helper function for exact matchingInstrumentationScopeInfo.getName()against thescopeName.- See Also:
-
build
Build aScopeConfiguratorwith the configuration of this builder.
-