performance

package
v0.0.0-...-df5614f Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextWithTraceId

func GetContextWithTraceId(ctx context.Context, traceId string) context.Context

GetContextWithTraceId Returns a child context with "trace_id" set to the given traceId

func GetTraceId

func GetTraceId(ctx context.Context) (string, error)

Types

type Instrumentor

type Instrumentor interface {
	StartSpan(ctx context.Context, operation string) Span
	NewTransaction(ctx context.Context, txName string, operation string) Span
	Finish(span Span)
}

func NewInstrumentor

func NewInstrumentor() Instrumentor

type NoopSpan

type NoopSpan struct {
	Operation string
	TxName    string
	Started   bool
	Finished  bool
	// contains filtered or unexported fields
}

func (*NoopSpan) Context

func (n *NoopSpan) Context() context.Context

func (*NoopSpan) Finish

func (n *NoopSpan) Finish()

func (*NoopSpan) GetOperation

func (n *NoopSpan) GetOperation() string

func (*NoopSpan) GetTraceId

func (n *NoopSpan) GetTraceId() string

func (*NoopSpan) GetTxName

func (n *NoopSpan) GetTxName() string

func (*NoopSpan) SetTransactionName

func (n *NoopSpan) SetTransactionName(txName string)

func (*NoopSpan) StartSpan

func (n *NoopSpan) StartSpan(ctx context.Context)

type Span

type Span interface {
	SetTransactionName(name string)
	StartSpan(ctx context.Context)
	Finish()
	GetOperation() string
	GetTxName() string

	// GetTraceId Returns UUID of the trace
	GetTraceId() string
	Context() context.Context
}

type SpanRecorder

type SpanRecorder interface {
	Record(span Span)
	Spans() []Span
	ClearSpans()
	Finish(span Span)
}

type TraceIdContextKey

type TraceIdContextKey string

Jump to

Keyboard shortcuts

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