Documentation ¶
Index ¶
- Constants
- Variables
- func NewSpan(s trace.Span) *octrace.Span
- func NewTracer(tracer trace.Tracer) octrace.Tracer
- type Span
- func (s *Span) AddAttributes(attributes ...octrace.Attribute)
- func (s *Span) AddLink(l octrace.Link)
- func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64)
- func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64)
- func (s *Span) Annotate(attributes []octrace.Attribute, str string)
- func (s *Span) Annotatef(attributes []octrace.Attribute, format string, a ...interface{})
- func (s *Span) End()
- func (s *Span) IsRecordingEvents() bool
- func (s *Span) SetName(name string)
- func (s *Span) SetStatus(status octrace.Status)
- func (s *Span) SpanContext() octrace.SpanContext
- func (s *Span) String() string
- type Tracer
- func (o *Tracer) FromContext(ctx context.Context) *octrace.Span
- func (o *Tracer) NewContext(parent context.Context, s *octrace.Span) context.Context
- func (o *Tracer) StartSpan(ctx context.Context, name string, s ...octrace.StartOption) (context.Context, *octrace.Span)
- func (o *Tracer) StartSpanWithRemoteParent(ctx context.Context, name string, parent octrace.SpanContext, ...) (context.Context, *octrace.Span)
Constants ¶
const ( // MessageSendEvent is the name of the message send event. MessageSendEvent = "message send" // MessageReceiveEvent is the name of the message receive event. MessageReceiveEvent = "message receive" )
Variables ¶
var ( // UncompressedKey is used for the uncompressed byte size attribute. UncompressedKey = attribute.Key("uncompressed byte size") // CompressedKey is used for the compressed byte size attribute. CompressedKey = attribute.Key("compressed byte size") )
var Handle = otel.Handle
Handle is the package level function to handle errors. It can be overwritten for testing.
Functions ¶
Types ¶
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is an OpenCensus SpanInterface wrapper for an OpenTelemetry Span.
func (*Span) AddAttributes ¶
AddAttributes sets attributes in this span.
func (*Span) AddLink ¶
AddLink adds a link to this span. This drops the OpenCensus LinkType because there is no such concept in OpenTelemetry.
func (*Span) AddMessageReceiveEvent ¶
AddMessageReceiveEvent adds a message receive event to this span.
func (*Span) AddMessageSendEvent ¶
AddMessageSendEvent adds a message send event to this span.
func (*Span) IsRecordingEvents ¶
IsRecordingEvents returns true if events are being recorded for this span.
func (*Span) SpanContext ¶
func (s *Span) SpanContext() octrace.SpanContext
SpanContext returns the SpanContext of this span.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is an OpenCensus Tracer that wraps an OpenTelemetry Tracer.
func (*Tracer) FromContext ¶
FromContext returns the Span stored in a context.
func (*Tracer) NewContext ¶
NewContext returns a new context with the given Span attached.
func (*Tracer) StartSpan ¶
func (o *Tracer) StartSpan(ctx context.Context, name string, s ...octrace.StartOption) (context.Context, *octrace.Span)
StartSpan starts a new child span of the current span in the context. If there is no span in the context, it creates a new trace and span.
func (*Tracer) StartSpanWithRemoteParent ¶
func (o *Tracer) StartSpanWithRemoteParent(ctx context.Context, name string, parent octrace.SpanContext, s ...octrace.StartOption) (context.Context, *octrace.Span)
StartSpanWithRemoteParent starts a new child span of the span from the given parent.