drivers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span interface {
	End()
	SetTag(key, value string)
	Context() context.Context
	SetContext(ctx context.Context)
	StartChildSpan(operation string, description string) Span
}

Span is a child operation under a transaction (or under another span).

type TraceSight

type TraceSight interface {
	// StartTransaction begins a root transaction in the tracing system
	// and returns an updated context plus the Transaction object.
	StartTransaction(ctx context.Context, operation, description string) Transaction

	// CurrentTransaction attempts to retrieve the current Transaction from ctx if any,
	// or return nil if not found.
	CurrentTransaction(ctx context.Context) Transaction
}

TraceSight is the interface each driver must implement.

type Transaction

type Transaction interface {
	// End finishes the transaction.
	End()
	// SetName changes the transaction name if needed.
	SetName(name string)
	// SetTag or SetAttribute
	SetTag(key, value string)
	// SetUser Optionally attach user
	SetUser(user UserInfo)
	// SetRequest Optionally attach request
	SetRequest(req *http.Request)
	SetResponseCode(responseCode int)

	GetRootSpan() Span
	SetContext(ctx context.Context)
	Context() context.Context
}

Transaction is a high-level operation or root span in your tracing system.

type UserInfo

type UserInfo struct {
	ID       string
	Email    string
	Username string
	IP       string
	Name     string
}

UserInfo is a generic representation of user data you want to attach to a trace.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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