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
ConfigOption populates a newrelic.Config with correct default settings for a Lambda serverless environment. ConfigOption 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.
Start should be used in place of lambda.Start. Replace:
StartHandler should be used in place of lambda.StartHandler. Replace:
Wrap wraps the provided handler and returns a new handler with instrumentation. Start should generally be used in place of Wrap.
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.