epsagon

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEvent

func AddEvent(event *protocol.Event)

AddEvent adds an event to the tracer

func AddException

func AddException(exception *protocol.Exception)

AddException adds an exception to the tracer

func AddExceptionTypeAndMessage

func AddExceptionTypeAndMessage(exceptionType, msg string)

AddExceptionTypeAndMessage adds an exception to the current tracer with the current stack and time. exceptionType, msg are strings that will be added to the exception

func CreateTracer

func CreateTracer(config *Config)

CreateTracer will initiallize a global epsagon tracer

func GeneralEpsagonRecover

func GeneralEpsagonRecover(exceptionType, msg string)

GeneralEpsagonRecover recover function that will send exception to epsagon exceptionType, msg are strings that will be added to the exception

func GetTimestamp

func GetTimestamp() float64

GetTimestamp returns the current time in miliseconds

func StopTracer

func StopTracer()

StopTracer will close the tracer and send all the data to the collector

func WrapLambdaHandler

func WrapLambdaHandler(config *Config, handler interface{}) interface{}

WrapLambdaHandler wraps a generic handler for lambda function with epsagon tracing

Types

type Config

type Config struct {
	ApplicationName string
	Token           string
	CollectorURL    string
	MetadataOnly    bool
	Debug           bool
}

Config is the configuration for Epsagon's tracer

func GetGlobalTracerConfig

func GetGlobalTracerConfig() *Config

GetGlobalTracerConfig returns the configuration of the global tracer

type MockedEpsagonTracer

type MockedEpsagonTracer struct {
	Exceptions *[]*protocol.Exception
	Events     *[]*protocol.Event
	Config     *Config
	// contains filtered or unexported fields
}

MockedEpsagonTracer will not send traces if closed

func (*MockedEpsagonTracer) AddEvent

func (t *MockedEpsagonTracer) AddEvent(e *protocol.Event)

AddEvent implementes mocked AddEvent

func (*MockedEpsagonTracer) AddException

func (t *MockedEpsagonTracer) AddException(e *protocol.Exception)

AddException implementes mocked AddEvent

func (*MockedEpsagonTracer) GetConfig

func (t *MockedEpsagonTracer) GetConfig() *Config

GetConfig implementes mocked AddEvent

func (*MockedEpsagonTracer) Running

func (t *MockedEpsagonTracer) Running() bool

Running implementes mocked Running

func (*MockedEpsagonTracer) Start

func (t *MockedEpsagonTracer) Start()

Start implementes mocked Start

func (*MockedEpsagonTracer) Stop

func (t *MockedEpsagonTracer) Stop()

Stop implementes mocked Stop

func (*MockedEpsagonTracer) Stopped

func (t *MockedEpsagonTracer) Stopped() bool

Stopped implementes mocked Stopped

type Tracer

type Tracer interface {
	AddEvent(*protocol.Event)
	AddException(*protocol.Exception)
	Start()
	Running() bool
	Stop()
	Stopped() bool
	GetConfig() *Config
}

Tracer is what a general program tracer had to provide

var (

	// GlobalTracer A global Tracer for all internal uses
	GlobalTracer Tracer
)

Jump to

Keyboard shortcuts

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