Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a new context with the given Span attached.
Types ¶
type Attribute ¶
type Attribute struct {
Key string
Value interface{}
}
Attribute is a key value pair for decorating spans
func BoolAttribute ¶
BoolAttribute returns a bool-valued attribute.
func Int64Attribute ¶
Int64Attribute returns an int64-valued attribute.
func StringAttribute ¶
StringAttribute returns a string-valued attribute.
type Logger ¶
type Logger interface {
Info(msg string, attributes ...Attribute)
Error(err error, attributes ...Attribute)
Fatal(msg string, attributes ...Attribute)
Debug(msg string, attributes ...Attribute)
}
Logger is a generic interface for logging
type SpanLogger ¶
type SpanLogger struct {
Span Spanner
}
SpanLogger is a Logger implementation which logs to a tracing span
func (SpanLogger) Debug ¶
func (sl SpanLogger) Debug(msg string, attributes ...Attribute)
Debug logs a debug tag with message to a span
func (SpanLogger) Error ¶
func (sl SpanLogger) Error(err error, attributes ...Attribute)
Error logs an error tag with message to a span
func (SpanLogger) Fatal ¶
func (sl SpanLogger) Fatal(msg string, attributes ...Attribute)
Fatal logs an error tag with message to a span
func (SpanLogger) Info ¶
func (sl SpanLogger) Info(msg string, attributes ...Attribute)
Info logs an info tag with message to a span
type Spanner ¶
type Spanner interface {
AddAttributes(attributes ...Attribute)
End()
Logger() Logger
Inject(carrier Carrier) error
InternalSpan() interface{}
}
Spanner is an abstraction over OpenTracing and OpenCensus Spans
func FromContext ¶
FromContext returns the Span stored in a context, or nil if there isn't one.
type Tracer ¶
type Tracer interface {
StartSpan(ctx context.Context, operationName string, opts ...interface{}) (context.Context, Spanner)
StartSpanWithRemoteParent(ctx context.Context, operationName string, carrier Carrier, opts ...interface{}) (context.Context, Spanner)
FromContext(ctx context.Context) Spanner
NewContext(parent context.Context, span Spanner) context.Context
}
Tracer is an abstraction over OpenTracing and OpenCensus trace implementations