Class Tag

java.lang.Object
io.opencensus.tags.Tag
Direct Known Subclasses:
AutoValue_Tag

@Immutable public abstract class Tag extends Object
TagKey paired with a TagValue.
Since:
0.8
  • Field Details

    • METADATA_UNLIMITED_PROPAGATION

      private static final TagMetadata METADATA_UNLIMITED_PROPAGATION
  • Constructor Details

    • Tag

      Tag()
  • Method Details

    • create

      @Deprecated public static Tag create(TagKey key, TagValue value)
      Deprecated.
      Creates a Tag from the given key and value.

      For backwards-compatibility this method still produces propagating Tags.

      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 a Tag 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 the TagMetadata associated with this Tag.
      Returns:
      the TagMetadata.
      Since:
      0.20