Evaluate your SIEM
Get the guideComplete visibility for DevSecOps
Reduce downtime and move from reactive to proactive monitoring.
May 8, 2020
AWS Lambda is the leading serverless computing solution and is one of AWS’ most successful products, to date. Its popularity is in large part because of the way it makes development easier and faster. Lambda completely abstracts away the maintenance of underlying infrastructure including compute, storage, memory, and networking. Developers simply upload their code in the form of Lambda functions and the service fully handles the execution of these functions. Lambda has been put to good use as a way to integrate two enterprise applications, to run data processing jobs, automating tasks between cloud applications, and even to power an IoT backend.
There are at least three reasons why you’d want to monitor Lambda closely. First, to ensure performance is as expected. While there are fewer infrastructure issues with Lambda, the new paradigm of code-as-functions can introduce issues of code compatibility.
Second, Lambda follows a pay-per-use model where you pay for the amount of AWS resources like compute, memory and storage used. Though the prices are extremely low for an individual request, the number of requests needed to run an application can easily spike as the app scales. Further, whether you run more short-term or long-term workloads matters a lot. Monitoring is the best way to keep costs under control.
Third, monitoring is necessary for enforcing security. When there is a vulnerability or anomaly, monitoring is the first step to spot the issue and resolve it before it escalates.
There are three main types of metrics to monitor: invocations, performance, and concurrency. We’ll look at each below.
These are the most important metrics as they show vital information about the execution of functions in Lambda. Lambda reports on the number of invocations executed successfully, the number of errors, and more. Below are the key invocation metrics.
These are primarily time-based metrics that help to assess the performance of functions in Lambda.
Concurrency is a key metric with Lambda as it is used to throttle functions when they exceed Lambda’s concurrency limit. Keeping an eye on these metrics can ensure your app functions smoothly without performance lags as it scales.
Lambda includes a default dashboard with the most vital metrics for AWS monitoring. This is what it looks like:
We’ve already discussed these metrics above. As you can see, some of these metrics have more than one dimension. For example, duration is shown as minimum, average, and maximum.
Apart from metrics, logging is essential to gain deep observability into lambda functions. Lambda allows you to insert logging statements in functions that are automatically sent to CloudWatch. From here, you can use CloudWatch to dig into these logs, or send them to a dedicated logging service like SumoLogic for more robust log analysis.
A dedicated log analysis platform comes with better log visualization and search capabilities. These services allow you to quickly build custom dashboards and collaborate with team members around log data.
If you’re running applications or workloads on AWS Lambda, monitoring is essential to get the most out of your investment. Though Lambda abstracts away the infrastructure, there is a lot of monitoring at the application level that needs to be done by you. By monitoring Lambda using a log analysis tool, you can improve the performance of applications and optimize resources like costs. You’ve taken the leap to invest in the future of cloud computing – serverless. However, your monitoring shouldn’t be left in the past.
Reduce downtime and move from reactive to proactive monitoring.
Build, run, and secure modern applications and cloud infrastructures.
Start free trial