Serverless monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. When you enable serverless monitoring using our Lambda extension, this is what happens:
The layer for your runtime contains the New Relic Lambda extension . This executable extends your Lambda function. The extension sends telemetry data to New Relic, and interacts with AWS directly to enhance the data we gather, while minimizing the impact of instrumentation on your application’s performance.
For Node.js and Python, the layer contains the New Relic agent code, and a wrapper for your Lambda handler. For other runtimes, we take an SDK approach, providing you with the tools to instrument your code, while taking advantage of emerging standards like OpenTracing and OpenTelemetry.
Two things have to happen to let New Relic gather telemetry from your Lambda functions.
In this section we will be linking your AWS account with your New Relic account.
When you link your AWS account to New Relic, you’re granting permission to New Relic to create an inventory of your AWS account, and gather CloudWatch metrics for your Lambda functions. Resources in your AWS account then show up as entities in the entity explorer, decorated with config information.
To link your account, you will need the following information:
Navigate to your New Relic One homepage and once again click on the button at the top right hand corner of the screen. This time, select API keys from the dropdown dialog:
On the API keys page, click on the Create key button located toward the right hand side of your screen:
You will notice that your account number is listed in the dropdown box under the Account heading. Please open a text file in your favorite text editor and type this in for easy access later on in this workshop.
Create your key by filling out the form on the right hand side of your screen as shown below, ensuring that the Key type field is set to User, and clicking on the Create key button:
Copy your newly created key (as shown below) and paste it into the text file as well: