There have been some exciting releases at New Relic lately, including our official launch of the New Relic monitoring for AWS Lambda. Not to be confused with our AWS Lambda monitoring integration or the New Relic Logs for AWS CloudWatch, these steps do not apply to those products. We want to enable everyone to be experts, so here is part 1 of some common problems and some uncommon solutions. You’ll be able to fearlessly set up alerts for your users onsite or graciously show them the steps they need to do it themselves!
To start, let’s dig into alerting on Lambda functions. Our New Relic Alerts product allows us to set alerts on anything you monitor with New Relic, this includes APM metrics, key transactions, NRQL queries and more. We have a robust set of conditions, a large part of the challenge lies in putting the conditions into the right context. Let’s put alerting for AWS Lambda in context!
There are two options for setting up alerts on Lambda function. The first option is to also use the UI options available in infrastructure:
Most customers will be viewing their data in NRONE so we’ll be focusing on the second option, using the chart builder in NRONE with insights.
This example is to set up an alert for an error rate > any %, you’ll have 4 steps:
- Select a lambda entity. Use chart builder while on Lambda dashboard in UI and select
- Select the event type to set the alert on. In this example, we’re using
error rate. For a full list of generic event types you can search in the red highlighted area or use the New Relic event data dictionary. You can use either basic or advanced NRQL on this page. The easier route is to start basic and convert that into advanced NRQL:
- Copy the advanced NRQL into an alert policy, removing any timeseries or extrapolate keywords. Here’s my example, advanced Nrql generated after selecting
error rate. Please note this does not include any application name or identification and cannot be used without an application selected:
SELECT percentage(count(*), WHERE error is true) AS 'Error rate' FROM Transaction
- Follow the initial steps for creating an alert based of the NRQL query. We are using the example of error rate > 2%, this can be set under
thresholdsusing the UI:
Setting up alerts on Lambda functions in NR One can be simple. You can customise these steps in several different ways as long as you know the type of data you are querying for. Thanks for reading part 1!