Documentation
¶
Index ¶
- Constants
- func MicroToTime(micro int64) time.Time
- func NewAnnotations(annotations []Annotation, endpoint Endpoint) []trace.Annotation
- func NewBinaryAnnotations(annotations []BinaryAnnotation, endpoint Endpoint) []trace.BinaryAnnotation
- func NewTrace(spans []Span) (trace.Trace, error)
- type Annotation
- type BinaryAnnotation
- type Decoder
- type Endpoint
- type Span
Constants ¶
const DefaultServiceName = "unknown"
DefaultServiceName when the span does not have any serviceName
Variables ¶
This section is empty.
Functions ¶
func MicroToTime ¶
MicroToTime converts zipkin's native time of microseconds into time.Time.
func NewAnnotations ¶
func NewAnnotations(annotations []Annotation, endpoint Endpoint) []trace.Annotation
NewAnnotations converts a slice of Annotation into a slice of new Annotations
func NewBinaryAnnotations ¶
func NewBinaryAnnotations(annotations []BinaryAnnotation, endpoint Endpoint) []trace.BinaryAnnotation
NewBinaryAnnotations is very similar to NewAnnotations, but it converts BinaryAnnotations instead of the normal Annotation
Types ¶
type Annotation ¶
type Annotation interface {
// Timestamp returns the timestamp of the annotation.
Timestamp() time.Time
// Value returns the value of the annotation.
Value() string
// Host returns the endpoint associated with the annotation.
Host() Endpoint
}
Annotation represents an event that explains latency with a timestamp.
type BinaryAnnotation ¶
type BinaryAnnotation interface {
// Key returns the key of the binary annotation.
Key() string
// Value returns the value of the binary annotation.
Value() string
// Host returns the endpoint associated with the binary annotation.
Host() Endpoint
}
BinaryAnnotation represents tags applied to a Span to give it context.
type Decoder ¶
type Decoder interface {
// Decode decodes the given byte slice into a slice of Spans.
Decode(octets []byte) ([]Span, error)
}
Decoder decodes the bytes and returns a trace
type Endpoint ¶
type Endpoint interface {
// Host returns the host address of the endpoint.
Host() string
// Name returns the name of the service associated with the endpoint.
Name() string
}
Endpoint represents the network context of a service recording an annotation.
type Span ¶
type Span interface {
// Trace returns the trace ID of the span.
Trace() (string, error)
// SpanID returns the span ID.
SpanID() (string, error)
// Parent returns the parent span ID.
Parent() (string, error)
// Name returns the name of the span.
Name() string
// Annotations returns the annotations of the span.
Annotations() []Annotation
// BinaryAnnotations returns the binary annotations of the span.
BinaryAnnotations() ([]BinaryAnnotation, error)
// Timestamp returns the timestamp of the span.
Timestamp() time.Time
// Duration returns the duration of the span.
Duration() time.Duration
}
Span represents a span created by instrumentation in RPC clients or servers.