opencensus

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 5 Imported by: 5

Documentation

Index

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)

func (*AnnotationLogger) Fatal added in v0.1.3

func (a *AnnotationLogger) Fatal(msg string, attributes ...tab.Attribute)

func (*AnnotationLogger) Info added in v0.1.3

func (a *AnnotationLogger) Info(msg string, 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

func (s *Span) AddAttributes(attributes ...tab.Attribute)

AddAttributes sets attributes in the span.

Existing attributes whose keys appear in the attributes parameter are overwritten.

func (*Span) End

func (s *Span) End()

End ends the span

func (*Span) Inject

func (s *Span) Inject(carrier tab.Carrier) error

Inject propagation key onto the carrier

func (*Span) InternalSpan

func (s *Span) InternalSpan() interface{}

InternalSpan returns the real implementation of the Span

func (*Span) Logger

func (s *Span) Logger() tab.Logger

Logger returns a trace.Logger for the span

type Trace

type Trace struct{}

Trace is the implementation of the OpenCensus trace abstraction

func (*Trace) FromContext

func (t *Trace) FromContext(ctx context.Context) tab.Spanner

FromContext returns the Span stored in a context, or nil if there isn't one.

func (*Trace) NewContext

func (t *Trace) NewContext(ctx context.Context, span tab.Spanner) context.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL