Package zipkin2

Class Annotation

java.lang.Object
zipkin2.Annotation
All Implemented Interfaces:
Serializable, Comparable<Annotation>

public final class Annotation extends Object implements Comparable<Annotation>, Serializable
Associates an event that explains latency with a timestamp.

Unlike log statements, annotations are often codes: Ex. cache.miss.

See Also:
  • Method Details

    • create

      public static Annotation create(long timestamp, String value)
    • timestamp

      public long timestamp()
      Microseconds from epoch.

      This value should be set directly by instrumentation, using the most precise value possible. For example, gettimeofday or multiplying System.currentTimeMillis() by 1000.

    • value

      public String value()
      Usually a short tag indicating an event, like cache.miss or error
    • compareTo

      public int compareTo(Annotation that)
      Compares by timestamp, then value.
      Specified by:
      compareTo in interface Comparable<Annotation>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object