agent

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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

func (a *Agent) AddPlugin(plugin plugin.Plugin) *Agent

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

func (a *Agent) ExecutePreHooks(ctx context.Context, request json.RawMessage) context.Context

ExecutePreHooks contains necessary works that should be done before user's handler

func (*Agent) SetReporter

func (a *Agent) SetReporter(r reporter) *Agent

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.

Jump to

Keyboard shortcuts

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