Package io.opentelemetry.semconv
Class AttributeKeyTemplate<T>
java.lang.Object
io.opentelemetry.semconv.AttributeKeyTemplate<T>
- Type Parameters:
T- The type of the nestedAttributeKeys.
This class provides a handle for creating and caching dynamic / template-type attributes of the
form <prefix>.<key>. The <prefix> is fixed for a template instance while
AttributeKeys can be created and are cached for different values of the <key> part.
An example template-type attribute is the set of attributes for HTTP headers: http.request.header.<key>
-
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeKeyTemplate<List<Boolean>>booleanArrayKeyTemplate(String prefix) static AttributeKeyTemplate<Boolean>booleanKeyTemplate(String prefix) static AttributeKeyTemplate<List<Double>>doubleArrayKeyTemplate(String prefix) static AttributeKeyTemplate<Double>doubleKeyTemplate(String prefix) io.opentelemetry.api.common.AttributeKey<T>getAttributeKey(String key) Returns anAttributeKeyobject for the given attribute key whereby the key is the variable part of the full attribute name in a template-typed attribute, for example http.request.header.<key>.static AttributeKeyTemplate<List<Long>>longArrayKeyTemplate(String prefix) static AttributeKeyTemplate<Long>longKeyTemplate(String prefix) static AttributeKeyTemplate<List<String>>stringArrayKeyTemplate(String prefix) static AttributeKeyTemplate<String>stringKeyTemplate(String prefix)
-
Method Details
-
stringKeyTemplate
-
stringArrayKeyTemplate
-
booleanKeyTemplate
-
booleanArrayKeyTemplate
-
longKeyTemplate
-
longArrayKeyTemplate
-
doubleKeyTemplate
-
doubleArrayKeyTemplate
-
getAttributeKey
Returns anAttributeKeyobject for the given attribute key whereby the key is the variable part of the full attribute name in a template-typed attribute, for example http.request.header.<key>.AttributeKeyobjets are being created and cached on the first invocation of this method for a certain key. Subsequent invocations of this method with the same key return the cached object.- Parameters:
key- The variable part of the template-typed attribute name.- Returns:
- An
AttributeKeyobject for the given key.
-