observability

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextWithTraceId added in v1.4.2

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

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

Types

type ErrorReporter added in v0.3.0

type ErrorReporter interface {
	FlushErrorReporting()
	CaptureError(err error, options ErrorReporterOptions) bool
}

func NewErrorReporter added in v1.4.2

func NewErrorReporter(logger *zerolog.Logger) ErrorReporter

type ErrorReporterOptions added in v0.3.1

type ErrorReporterOptions struct {
	ErrorDiagnosticPath string
}

type Instrumentor

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

Instrumentor exposes functions used for adding instrumentation context to functions.

func NewInstrumentor added in v1.4.2

func NewInstrumentor() Instrumentor

type NoopSpan added in v1.4.2

type NoopSpan struct {
	Operation string
	TxName    string
	Started   bool
	Finished  bool

	StartTime  int64
	FinishTime int64
	// contains filtered or unexported fields
}

func NewNoopSpan added in v1.4.2

func NewNoopSpan(ctx context.Context, operation string, txName string, started bool, finished bool) *NoopSpan

func (*NoopSpan) Context added in v1.4.2

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

func (*NoopSpan) Finish added in v1.4.2

func (n *NoopSpan) Finish()

func (*NoopSpan) GetDurationMs added in v1.4.2

func (n *NoopSpan) GetDurationMs() int64

func (*NoopSpan) GetOperation added in v1.4.2

func (n *NoopSpan) GetOperation() string

func (*NoopSpan) GetTraceId added in v1.4.2

func (n *NoopSpan) GetTraceId() string

func (*NoopSpan) GetTxName added in v1.4.2

func (n *NoopSpan) GetTxName() string

func (*NoopSpan) SetTransactionName added in v1.4.2

func (n *NoopSpan) SetTransactionName(txName string)

func (*NoopSpan) StartSpan added in v1.4.2

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

	GetDurationMs() int64
}

Span exposes functions that have context about functions.

type SpanRecorder added in v1.4.2

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

type TraceIdContextKey added in v1.4.2

type TraceIdContextKey string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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