tracer

package
v0.0.0-...-b02c517 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(c context.Context, span *Span) context.Context

Types

type Span

type Span struct {
	// ID identifis the span.
	ID string
	// Parent identifies the parent of the span.
	Parent string
	// Trace identifies the trace this span belongs to.
	Trace string
	// Name names the span.
	Name string
	// Time tells when this span was created.
	Time time.Time
	// Duration tells how long this span lasted.
	Duration time.Duration
	// Metadata associated.
	Metadata metadata.MD
}

func FromContext

func FromContext(c context.Context) (*Span, bool)

type Tracer

type Tracer interface {
	// Trace starts a span following the given context.
	Trace(context.Context, string) (context.Context, *Span)
	// Finish marks a span as finished.
	Finish(*Span) error
	// String returns the implementation name.
	String() string
}

TODO: design

Jump to

Keyboard shortcuts

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