Documentation ¶
Index ¶
- type AnnotationLogger
- type Span
- type Trace
- func (t *Trace) FromContext(ctx context.Context) tab.Spanner
- func (t *Trace) NewContext(ctx context.Context, span tab.Spanner) context.Context
- func (t *Trace) StartSpan(ctx context.Context, operationName string, opts ...interface{}) (context.Context, tab.Spanner)
- func (t *Trace) StartSpanWithRemoteParent(ctx context.Context, operationName string, carrier tab.Carrier, ...) (context.Context, tab.Spanner)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnotationLogger ¶ added in v0.1.3
type AnnotationLogger struct {
Span *Span
}
func (*AnnotationLogger) Debug ¶ added in v0.1.3
func (a *AnnotationLogger) Debug(msg string, attributes ...tab.Attribute)
func (*AnnotationLogger) Error ¶ added in v0.1.3
func (a *AnnotationLogger) Error(err error, attributes ...tab.Attribute)
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is the implementation of the OpenCensus Span abstraction
func (*Span) AddAttributes ¶
AddAttributes sets attributes in the span.
Existing attributes whose keys appear in the attributes parameter are overwritten.
func (*Span) InternalSpan ¶
func (s *Span) InternalSpan() interface{}
InternalSpan returns the real implementation of the Span
type Trace ¶
type Trace struct{}
Trace is the implementation of the OpenCensus trace abstraction
func (*Trace) FromContext ¶
FromContext returns the Span stored in a context, or nil if there isn't one.
func (*Trace) NewContext ¶
NewContext returns a new context with the given Span attached.
func (*Trace) StartSpan ¶
func (t *Trace) StartSpan(ctx context.Context, operationName string, opts ...interface{}) (context.Context, tab.Spanner)
StartSpan starts a new child span of the current span in the context. If there is no span in the context, creates a new trace and span.
Returned context contains the newly created span. You can use it to propagate the returned span in process.
func (*Trace) StartSpanWithRemoteParent ¶
func (t *Trace) StartSpanWithRemoteParent(ctx context.Context, operationName string, carrier tab.Carrier, opts ...interface{}) (context.Context, tab.Spanner)
StartSpanWithRemoteParent starts a new child span of the span from the given parent.
If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is preferred for cases where the parent is propagated via an incoming request.
Returned context contains the newly created span. You can use it to propagate the returned span in process.