Documentation ¶
Overview ¶
Package nrlambda adds support for AWS Lambda.
Use this package to instrument your AWS Lambda handler function. Data is sent to CloudWatch when the Lambda is invoked. CloudWatch collects Lambda log data and sends it to a New Relic log-ingestion Lambda. The log-ingestion Lambda sends that data to us.
Monitoring AWS Lambda requires several steps shown here: https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/enable-new-relic-monitoring-aws-lambda
Example: https://github.com/Easypay/go-agent/tree/master/_integrations/nrlambda/example/main.go
Index ¶
- func NewConfig() newrelic.Config
- func Start(handler interface{}, app newrelic.Application)
- func StartHandler(handler lambda.Handler, app newrelic.Application)
- func Wrap(handler interface{}, app newrelic.Application) lambda.Handler
- func WrapHandler(handler lambda.Handler, app newrelic.Application) lambda.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfig ¶
NewConfig populates a newrelic.Config with correct default settings for a Lambda serverless environment. NewConfig will populate fields based on environment variables common to all New Relic agents that support Lambda. Environment variables NEW_RELIC_ACCOUNT_ID, NEW_RELIC_TRUSTED_ACCOUNT_KEY, and NEW_RELIC_PRIMARY_APPLICATION_ID configure fields required for distributed tracing. Environment variable NEW_RELIC_APDEX_T may be used to set a custom apdex threshold.
func Start ¶
func Start(handler interface{}, app newrelic.Application)
Start should be used in place of lambda.Start. Replace:
lambda.Start(myhandler)
With:
nrlambda.Start(myhandler, app)
func StartHandler ¶
func StartHandler(handler lambda.Handler, app newrelic.Application)
StartHandler should be used in place of lambda.StartHandler. Replace:
lambda.StartHandler(myhandler)
With:
nrlambda.StartHandler(myhandler, app)
func Wrap ¶
func Wrap(handler interface{}, app newrelic.Application) lambda.Handler
Wrap wraps the provided handler and returns a new handler with instrumentation. Start should generally be used in place of Wrap.
func WrapHandler ¶
WrapHandler wraps the provided handler and returns a new handler with instrumentation. StartHandler should generally be used in place of WrapHandler: this function is exposed for consumers who are chaining middlewares.
Types ¶
This section is empty.