tracings

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, trace *Trace)

Types

type Config

type Config struct {
	Enable      bool            `json:"enable"`
	BatchSize   int             `json:"batchSize"`
	ChannelSize int             `json:"channelSize"`
	Reporter    json.RawMessage `json:"reporter"`
}

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func (*Middleware) Close

func (middle *Middleware) Close()

func (*Middleware) Construct

func (middle *Middleware) Construct(options transports.MiddlewareOptions) (err error)

func (*Middleware) Handler

func (middle *Middleware) Handler(next transports.Handler) transports.Handler

func (*Middleware) Name

func (middle *Middleware) Name() string

type Reporter

type Reporter interface {
	Construct(options ReporterOptions) (err error)
	Report(ctx context.Context, trace Trace)
}

type ReporterOptions

type ReporterOptions struct {
	Log    logs.Logger
	Config configures.Config
}

type Span

type Span struct {
	Id       string            `json:"id"`
	Endpoint string            `json:"endpoint"`
	Fn       string            `json:"fn"`
	Begin    time.Time         `json:"begin"`
	Waited   time.Time         `json:"waited"`
	End      time.Time         `json:"end"`
	Tags     map[string]string `json:"tags"`
	Children []*Span           `json:"children"`
	// contains filtered or unexported fields
}

type Trace

type Trace struct {
	Id   string `json:"id"`
	Span *Span  `json:"span"`
	// contains filtered or unexported fields
}

func Load

func Load(ctx context.Context) (trace *Trace, found bool)

func New

func New(id []byte) Trace

func (*Trace) Begin

func (trace *Trace) Begin(pid []byte, endpoint []byte, fn []byte, tags ...string)

func (*Trace) Finish

func (trace *Trace) Finish(tags ...string)

func (*Trace) Mount

func (trace *Trace) Mount(child *Span)

func (*Trace) Tagging

func (trace *Trace) Tagging(tags ...string)

func (*Trace) Waited

func (trace *Trace) Waited(tags ...string)

Jump to

Keyboard shortcuts

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