Documentation ¶
Index ¶
- type Agent
- func (a *Agent) AddPlugin(plugin plugin.Plugin) *Agent
- func (a *Agent) CatchTimeout(ctx context.Context, payload json.RawMessage)
- func (a *Agent) ExecutePostHooks(ctx context.Context, request json.RawMessage, response interface{}, ...)
- func (a *Agent) ExecutePreHooks(ctx context.Context, request json.RawMessage) context.Context
- func (a *Agent) SetReporter(r reporter) *Agent
- func (a *Agent) Wrap(handler interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { Plugins []plugin.Plugin Reporter reporter WarmUp bool TimeoutMargin time.Duration }
Agent is thundra agent implementation
func New ¶
func New() *Agent
New is used to collect basic invocation data with thundra. Use NewBuilder and AddPlugin to access full functionality.
func (*Agent) AddPlugin ¶
AddPlugin is used to enable plugins on thundra. You can use Trace, Metrics and Log plugins. You need to initialize a plugin object and pass it as a parameter in order to enable it. e.g. AddPlugin(trace.New())
func (*Agent) CatchTimeout ¶
func (a *Agent) CatchTimeout(ctx context.Context, payload json.RawMessage)
CatchTimeout is checks for a timeout event and sends report if lambda is timedout
func (*Agent) ExecutePostHooks ¶
func (a *Agent) ExecutePostHooks(ctx context.Context, request json.RawMessage, response interface{}, err interface{})
ExecutePostHooks contains necessary works that should be done after user's handler
func (*Agent) ExecutePreHooks ¶
ExecutePreHooks contains necessary works that should be done before user's handler
func (*Agent) SetReporter ¶
SetReporter sets agent reporter
func (*Agent) Wrap ¶
func (a *Agent) Wrap(handler interface{}) interface{}
Wrap is used for wrapping your lambda functions and start monitoring it by following the thundra objects settings It wraps your lambda function and return a new lambda function. By that, AWS will be able to run this function and Thundra will be able to collect monitoring data from your function.