metrics

package
v0.0.0-...-07ef3d6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MonitorType      string
	DatadogDebugMode bool
	Addr             string
	ServiceName      string
)

Functions

func ContextWithMonitor

func ContextWithMonitor(ctx context.Context, m Monitor) context.Context

func ContextWithTransaction

func ContextWithTransaction(ctx context.Context, tx Transaction) context.Context

func Start

func Start(ctx context.Context) (context.Context, error)

Types

type Monitor

type Monitor interface {
	Start(context.Context) error
	StartTransaction(ctx context.Context, name string) (Transaction, context.Context)
	CreateWrapHandleFunc(path string) func(h http.HandlerFunc) http.HandlerFunc
}

func ContextMonitor

func ContextMonitor(ctx context.Context) Monitor

func NewDatadogMonitor

func NewDatadogMonitor() Monitor

func NewNullMonitor

func NewNullMonitor() Monitor

func NewStdOutMonitor

func NewStdOutMonitor() Monitor

type Transaction

type Transaction interface {
	End()
	AddAttribute(key string, value any)
	AddAttributes(attrs map[string]any)
	StartTransaction(ctx context.Context, name string) (Transaction, context.Context)
	NoticeError(err error)
}

func ContextTransaction

func ContextTransaction(ctx context.Context) (Transaction, bool)

func NewDatadogTransaction

func NewDatadogTransaction(ctx context.Context, spanName string) (Transaction, context.Context)

func NewStdOutTransaction

func NewStdOutTransaction(ctx context.Context, name string) (Transaction, context.Context)

func StartTransaction

func StartTransaction(ctx context.Context, name string) (Transaction, context.Context)

Jump to

Keyboard shortcuts

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