Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshallContext ¶
MarshallContext encodes the context to a JSON object. Assumes that there is an initialized context map propagator.
Types ¶
type GlobalTracer ¶
func New ¶
func New(opt *Options) (*GlobalTracer, error)
New connects to the collector and returns a new tracer.
func (*GlobalTracer) StartSpan ¶ added in v0.2.0
func (gt *GlobalTracer) StartSpan( ctx context.Context, name string, fn Operation, opts ...trace.SpanStartOption, ) (err error)
StartSpan creates a span arround a given operation. The function automatically closes the span, records the Operation error and returns it. Span.End does nothing if called more than one time.
type Operation ¶ added in v0.2.0
Operation represents the execution wrapped by a span. The ctx parameter contains the context tied to the span. The returned error will be recorded in span and re-returned by StartSpan.
type Options ¶
type Options struct { ServiceName string TracerName string // CollectorAddr contains the grpc collector // address in the form <ip/domain>:<port>. CollectorAddr string // DialDeadline is the max time to dial // a connection with the collector. DialDeadline time.Duration }
Options contains all basic elements to establish a connection with an OpenTelemetry cluster.
Click to show internal directories.
Click to hide internal directories.