go-agent: github.com/newrelic/go-agent/_integrations/nrlambda Index | Files | Directories

package nrlambda

import "github.com/newrelic/go-agent/_integrations/nrlambda"

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/newrelic/go-agent/tree/master/_integrations/nrlambda/example/main.go


Package Files

config.go events.go handler.go

func NewConfig Uses

func NewConfig() newrelic.Config

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 Uses

func Start(handler interface{}, app newrelic.Application)

Start should be used in place of lambda.Start. Replace:



nrlambda.Start(myhandler, app)

func StartHandler Uses

func StartHandler(handler lambda.Handler, app newrelic.Application)

StartHandler should be used in place of lambda.StartHandler. Replace:



nrlambda.StartHandler(myhandler, app)

func Wrap Uses

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 Uses

func WrapHandler(handler lambda.Handler, app newrelic.Application) lambda.Handler

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.



Package nrlambda imports 15 packages (graph) and is imported by 1 packages. Updated 2019-10-24. Refresh now. Tools for package owners.