Documentation ¶
Index ¶
- func AddEvent(event *protocol.Event)
- func AddException(exception *protocol.Exception)
- func AddExceptionTypeAndMessage(exceptionType, msg string)
- func CreateTracer(config *Config)
- func GeneralEpsagonRecover(exceptionType, msg string)
- func GetTimestamp() float64
- func StopTracer()
- func WrapLambdaHandler(config *Config, handler interface{}) interface{}
- type Config
- type MockedEpsagonTracer
- func (t *MockedEpsagonTracer) AddEvent(e *protocol.Event)
- func (t *MockedEpsagonTracer) AddException(e *protocol.Exception)
- func (t *MockedEpsagonTracer) GetConfig() *Config
- func (t *MockedEpsagonTracer) Running() bool
- func (t *MockedEpsagonTracer) Start()
- func (t *MockedEpsagonTracer) Stop()
- func (t *MockedEpsagonTracer) Stopped() bool
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddException ¶
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 )