Annotation
Annotation
An annotation tells a descriptive story in text, of an event that occurred during a span’s lifetime.
It consists of fields:
Field | Information |
---|---|
Description | The user supplied message that details the event |
Attributes | A set of attributes to articulate the annotate |
Code examples
We’ll add an annotation to a span in the excerpts with a couple of languages:
import "go.opencensus.io/trace"
span.Annotate([]trace.Attribute{
trace.StringAttribute("store", "memcache"),
trace.BoolAttribute("cache_miss", true),
trace.Int64Attribute("age_ns", 13488999),
}, "Cache miss during GC")
Visual representation
References
Resource | URL |
---|---|
Data model reference | trace_proto/v1.Annotation |
Go annotation API: Span.Annotate | GoDoc |
Java annotation API: Span.addAnnotation | JavaDoc |
Python annotation API | Definition |
C++ annotation API | Definition |