Top Description Methods
io.opentelemetry.api.common

public Interface AttributeKey<T>

Known Direct Implementers
io.opentelemetry.api.internal.InternalAttributeKeyImpl
Annotations
@SuppressWarnings:rawtypes
@Immutable
Type Parameters
<T>
The type of value that can be set with the key.
Imports
io.opentelemetry.api.internal.InternalAttributeKeyImpl, java.util.List, javax.annotation.concurrent.Immutable

This interface provides a handle for setting the values of Attributes. 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.

Method Summary

Modifier and TypeMethod and Description
public static AttributeKey<List<Boolean>>
booleanArrayKey(String key)

Returns a new AttributeKey for List<Boolean> valued attributes.

public static AttributeKey<Boolean>
booleanKey(String key)

Returns a new AttributeKey for Boolean valued attributes.

public static AttributeKey<List<Double>>
doubleArrayKey(String key)

Returns a new AttributeKey for List<Double> valued attributes.

public static AttributeKey<Double>
doubleKey(String key)

Returns a new AttributeKey for Double valued attributes.

public String
getKey()

Returns the underlying String representation of the key.

public AttributeType
getType()

Returns the type of attribute for this key.

public static AttributeKey<List<Long>>
longArrayKey(String key)

Returns a new AttributeKey for List<Long> valued attributes.

public static AttributeKey<Long>
longKey(String key)

Returns a new AttributeKey for Long valued attributes.

public static AttributeKey<List<String>>
stringArrayKey(String key)

Returns a new AttributeKey for List<String> valued attributes.

public static AttributeKey<String>
stringKey(String key)

Returns a new AttributeKey for String valued attributes.

Method Detail

booleanArrayKeyback to summary
public static AttributeKey<List<Boolean>> booleanArrayKey(String key)

Returns a new AttributeKey for List<Boolean> valued attributes.

booleanKeyback to summary
public static AttributeKey<Boolean> booleanKey(String key)

Returns a new AttributeKey for Boolean valued attributes.

doubleArrayKeyback to summary
public static AttributeKey<List<Double>> doubleArrayKey(String key)

Returns a new AttributeKey for List<Double> valued attributes.

doubleKeyback to summary
public static AttributeKey<Double> doubleKey(String key)

Returns a new AttributeKey for Double valued attributes.

getKeyback to summary
public String getKey()

Returns the underlying String representation of the key.

getTypeback to summary
public AttributeType getType()

Returns the type of attribute for this key. Useful for building switch statements.

longArrayKeyback to summary
public static AttributeKey<List<Long>> longArrayKey(String key)

Returns a new AttributeKey for List<Long> valued attributes.

longKeyback to summary
public static AttributeKey<Long> longKey(String key)

Returns a new AttributeKey for Long valued attributes.

stringArrayKeyback to summary
public static AttributeKey<List<String>> stringArrayKey(String key)

Returns a new AttributeKey for List<String> valued attributes.

stringKeyback to summary
public static AttributeKey<String> stringKey(String key)

Returns a new AttributeKey for String valued attributes.