Interface ExtendedAttributeKey<T>
- Type Parameters:
T- The type of value that can be set with the key.
ExtendedAttributes. The type
of value that can be set with an implementation of this key is denoted by the type parameter.
Implementations MUST be immutable, as these are used as the keys to Maps.
The allowed getType()s is a superset of those allowed in AttributeKey.
Convenience methods are provided for translating to / from AttributeKey:
asAttributeKey()converts fromExtendedAttributeKeytoAttributeKeyfromAttributeKey(AttributeKey)converts fromAttributeKeytoExtendedAttributeKey
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.opentelemetry.api.common.AttributeKey<T> static ExtendedAttributeKey<List<Boolean>> booleanArrayKey(String key) Returns a new ExtendedAttributeKey for List<Boolean> valued attributes.static ExtendedAttributeKey<Boolean> booleanKey(String key) Returns a new ExtendedAttributeKey for Boolean valued attributes.static ExtendedAttributeKey<List<Double>> doubleArrayKey(String key) Returns a new ExtendedAttributeKey for List<Double> valued attributes.static ExtendedAttributeKey<Double> Returns a new ExtendedAttributeKey for Double valued attributes.Deprecated.static <T> ExtendedAttributeKey<T> fromAttributeKey(io.opentelemetry.api.common.AttributeKey<T> attributeKey) Return an ExtendedAttributeKey equivalent to theattributeKey.getKey()Returns the underlying String representation of the key.getType()Returns the type of attribute for this key.static ExtendedAttributeKey<List<Long>> longArrayKey(String key) Returns a new ExtendedAttributeKey for List<Long> valued attributes.static ExtendedAttributeKey<Long> Returns a new ExtendedAttributeKey for Long valued attributes.static ExtendedAttributeKey<List<String>> stringArrayKey(String key) Returns a new ExtendedAttributeKey for List<String> valued attributes.static ExtendedAttributeKey<String> Returns a new ExtendedAttributeKey for String valued attributes.static ExtendedAttributeKey<io.opentelemetry.api.common.Value<?>> Returns a new ExtendedAttributeKey forValuevalued attributes.
-
Method Details
-
getKey
String getKey()Returns the underlying String representation of the key. -
getType
ExtendedAttributeType getType()Returns the type of attribute for this key. Useful for building switch statements. -
asAttributeKey
-
fromAttributeKey
static <T> ExtendedAttributeKey<T> fromAttributeKey(io.opentelemetry.api.common.AttributeKey<T> attributeKey) Return an ExtendedAttributeKey equivalent to theattributeKey. -
stringKey
Returns a new ExtendedAttributeKey for String valued attributes. -
booleanKey
Returns a new ExtendedAttributeKey for Boolean valued attributes. -
longKey
Returns a new ExtendedAttributeKey for Long valued attributes. -
doubleKey
Returns a new ExtendedAttributeKey for Double valued attributes. -
stringArrayKey
Returns a new ExtendedAttributeKey for List<String> valued attributes. -
booleanArrayKey
Returns a new ExtendedAttributeKey for List<Boolean> valued attributes. -
longArrayKey
Returns a new ExtendedAttributeKey for List<Long> valued attributes. -
doubleArrayKey
Returns a new ExtendedAttributeKey for List<Double> valued attributes. -
extendedAttributesKey
Deprecated.UsevalueKey(String)in combination withValue.of(java.util.Map)instead.Returns a new ExtendedAttributeKey forExtendedAttributesvalued attributes. -
valueKey
Returns a new ExtendedAttributeKey forValuevalued attributes.Simple attributes (
ExtendedAttributeType.STRING,ExtendedAttributeType.LONG,ExtendedAttributeType.DOUBLE,ExtendedAttributeType.BOOLEAN,ExtendedAttributeType.STRING_ARRAY,ExtendedAttributeType.LONG_ARRAY,ExtendedAttributeType.DOUBLE_ARRAY,ExtendedAttributeType.BOOLEAN_ARRAY) SHOULD be used whenever possible. Instrumentations SHOULD assume that backends do not index individual properties of complex attributes, that querying or aggregating on such properties is inefficient and complicated, and that reporting complex attributes carries higher performance overhead.
-
valueKey(String)in combination withValue.of(java.util.Map)instead.