metrics

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MonitorType      string
	DatadogDebugMode bool
)

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)
}

func ContextMonitor

func ContextMonitor(ctx context.Context) Monitor

func NewDatadogMonitor

func NewDatadogMonitor() Monitor

func NewNullMonitor

func NewNullMonitor() Monitor

type Transaction

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

func ContextTransaction

func ContextTransaction(ctx context.Context) Transaction

func NewDatadogTransaction

func NewDatadogTransaction(ctx context.Context, spanName 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