Package io.opencensus.tags
Class Tag
- java.lang.Object
-
- io.opencensus.tags.Tag
-
- Direct Known Subclasses:
AutoValue_Tag
@Immutable public abstract class Tag extends java.lang.Object
- Since:
- 0.8
-
-
Field Summary
Fields Modifier and Type Field Description private static TagMetadata
METADATA_UNLIMITED_PROPAGATION
-
Constructor Summary
Constructors Constructor Description Tag()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Tag
create(TagKey key, TagValue value)
Deprecated.in favor ofcreate(TagKey, TagValue, TagMetadata)
.static Tag
create(TagKey key, TagValue value, TagMetadata tagMetadata)
Creates aTag
from the given key, value and metadata.abstract TagKey
getKey()
Returns the tag's key.abstract TagMetadata
getTagMetadata()
Returns theTagMetadata
associated with thisTag
.abstract TagValue
getValue()
Returns the tag's value.
-
-
-
Field Detail
-
METADATA_UNLIMITED_PROPAGATION
private static final TagMetadata METADATA_UNLIMITED_PROPAGATION
-
-
Method Detail
-
create
@Deprecated public static Tag create(TagKey key, TagValue value)
Deprecated.in favor ofcreate(TagKey, TagValue, TagMetadata)
.Creates aTag
from the given key and value.For backwards-compatibility this method still produces propagating
Tag
s.This is equivalent to calling
create(key, value, TagMetadata.create(TagTtl.UNLIMITED_PROPAGATION))
.- Parameters:
key
- the tag key.value
- the tag value.- Returns:
- a
Tag
with the given key and value. - Since:
- 0.8
-
create
public static Tag create(TagKey key, TagValue value, TagMetadata tagMetadata)
Creates aTag
from the given key, value and metadata.- Parameters:
key
- the tag key.value
- the tag value.tagMetadata
- the tag metadata.- Returns:
- a
Tag
. - Since:
- 0.20
-
getKey
public abstract TagKey getKey()
Returns the tag's key.- Returns:
- the tag's key.
- Since:
- 0.8
-
getValue
public abstract TagValue getValue()
Returns the tag's value.- Returns:
- the tag's value.
- Since:
- 0.8
-
getTagMetadata
public abstract TagMetadata getTagMetadata()
Returns theTagMetadata
associated with thisTag
.- Returns:
- the
TagMetadata
. - Since:
- 0.20
-
-