tracing

package
v0.0.0-...-872dfdc Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package tracing is a generated protocol buffer package.

It is generated from these files:

cockroach/util/tracing/span.proto

It has these top-level messages:

Span

Index

Constants

View Source
const Snowball = "sb"

Snowball is set as Baggage on traces which are used for snowball tracing.

Variables

View Source
var (
	ErrInvalidLengthSpan = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSpan   = fmt.Errorf("proto: integer overflow")
)

Functions

func AnnotateTrace

func AnnotateTrace()

AnnotateTrace adds an annotation to the golang executation tracer by calling a no-op cgo function.

func DecodeRawSpan

func DecodeRawSpan(enc []byte, dest *basictracer.RawSpan) error

DecodeRawSpan unmarshals into the given RawSpan.

func Disable

func Disable() func()

Disable is for benchmarking use and causes all future tracers to deal in no-ops. Calling the returned closure undoes this effect. There is no synchronization, so no moving parts are allowed while Disable and the closure are called.

func EncodeRawSpan

func EncodeRawSpan(rawSpan *basictracer.RawSpan, dest []byte) ([]byte, error)

EncodeRawSpan encodes a raw span into bytes, using the given dest slice as a buffer.

func EnsureContext

func EnsureContext(ctx context.Context, tracer opentracing.Tracer) (context.Context, func())

EnsureContext checks whether the given context.Context contains a Span. If not, it creates one using the provided Tracer and wraps it in the returned Span. The returned closure must be called after the request has been fully processed.

func JoinOrNew

func JoinOrNew(tr opentracing.Tracer, carrier *Span, opName string) (opentracing.Span, error)

JoinOrNew creates a new Span joined to the provided DelegatingCarrier or creates Span from the given tracer.

func JoinOrNewSnowball

func JoinOrNewSnowball(opName string, carrier *Span, callback func(sp basictracer.RawSpan)) (opentracing.Span, error)

JoinOrNewSnowball returns a Span which records directly via the specified callback. If the given DelegatingCarrier is nil, a new Span is created. otherwise, the created Span is a child.

func NewTracer

func NewTracer() opentracing.Tracer

NewTracer creates a Tracer which records to the net/trace endpoint.

Types

type CallbackRecorder

type CallbackRecorder func(sp basictracer.RawSpan)

A CallbackRecorder immediately invokes itself on received trace spans.

func (CallbackRecorder) RecordSpan

func (cr CallbackRecorder) RecordSpan(sp basictracer.RawSpan)

RecordSpan implements basictracer.SpanRecorder.

type Span

type Span struct {
	TraceID uint64            `protobuf:"varint,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	SpanID  uint64            `protobuf:"varint,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"`
	Sampled bool              `protobuf:"varint,3,opt,name=sampled,proto3" json:"sampled,omitempty"`
	Baggage map[string]string `` /* 148-byte string literal not displayed */
}

A Span message holds metadata of a (potentially ongoing) span of a distributed trace as per the OpenTracing specification. See http://opentracing.io/spec/ for details.

func (*Span) Descriptor

func (*Span) Descriptor() ([]byte, []int)

func (*Span) GetBaggage

func (sp *Span) GetBaggage(fn func(key, value string))

GetBaggage implements basictracer.DelegatingCarrier.

func (*Span) Marshal

func (m *Span) Marshal() (data []byte, err error)

func (*Span) MarshalTo

func (m *Span) MarshalTo(data []byte) (int, error)

func (*Span) ProtoMessage

func (*Span) ProtoMessage()

func (*Span) Reset

func (m *Span) Reset()

func (*Span) SetBaggageItem

func (sp *Span) SetBaggageItem(key, value string)

SetBaggageItem implements basictracer.DelegatingCarrier.

func (*Span) SetState

func (sp *Span) SetState(traceID, spanID uint64, sampled bool)

SetState implements basictracer.DelegatingCarrier.

func (*Span) Size

func (m *Span) Size() (n int)

func (*Span) State

func (sp *Span) State() (traceID, spanID uint64, sampled bool)

State implements basictracer.DelegatingCarrier.

func (*Span) String

func (m *Span) String() string

func (*Span) Unmarshal

func (m *Span) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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