Class ComponentRegistry<V>
java.lang.Object
io.opentelemetry.sdk.internal.ComponentRegistry<V>
- Type Parameters:
V- the type of the registered value.
Component (tracer, meter, etc) registry class for all the provider classes (TracerProvider,
MeterProvider, etc.).
Components are identified by name, version, and schema. Name is required, but version and schema are optional. Therefore, we have 4 possible scenarios for component keys:
- Only name is provided, represented by
componentByName - Name and version are provided, represented by
componentByNameAndVersion - Name and schema are provided, represented by
componentByNameAndSchema - Name, version and schema are provided, represented by
componentByNameVersionAndSchema
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Function<InstrumentationScopeInfo, V> private final Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate VbuildComponent(InstrumentationScopeInfo instrumentationScopeInfo) get(String name, String version, String schemaUrl, Attributes attributes) Returns the component associated with thename,version, andschemaUrl.Returns aCollectionview of the registered components.
-
Field Details
-
componentByName
-
componentByNameAndVersion
-
componentByNameAndSchema
-
componentByNameVersionAndSchema
-
lock
-
allComponents
-
factory
-
-
Constructor Details
-
ComponentRegistry
-
-
Method Details
-
get
public V get(String name, @Nullable String version, @Nullable String schemaUrl, Attributes attributes) Returns the component associated with thename,version, andschemaUrl.Attributesare not part of component identity. Behavior is undefined when differentAttributesare provided wherename,version, andschemaUrlare identical. -
buildComponent
-
getComponents
Returns aCollectionview of the registered components.- Returns:
- a
Collectionview of the registered components.
-