nrlambda

package
v3.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

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

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

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.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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