“Serverless” aka Function as a Service (FaaS) is the hot new technology everybody is talking about these days and AWS Lambda is currently the most popular offering in this space.
Of course, FaaS is not a silver bullet and it doesn’t supersede everything that’s been here before.
I’d rather say that the various ways to slice and dice IT infrastructure are orthogonal and FaaS is a viable addition that solves a specific set of problems.
We saw growing demand amongst our customers starting in spring 2017 and so we started our research to extend Dynatrace to make monitoring AWS Lambda seamless with no code change required.
This posts covers the basics of “Serverless” computing and how to monitor this new addition to your tool belt. For an in-depth article about serverless computing, I recommend reading this article by Mike Roberts on martinfowler.com.
What is Serverless and Function as a Service (FaaS)?
‘Serverless’ is more of a marketing term and a bit misleading. Of course, there are still applications running on servers but while a PaaS environment gives you control over this applications – e.g. a Node.js application running on Heroku, FaaS abstracts away infrastructure, application and request routing and lets you focus on just writing code that is executed when a predefined event (like an incoming web request) is triggered.
Why enterprises are using FaaS
Technically, serverless functions are microservices and the reasoning behind breaking down monoliths is well known. Interestingly, we see customers using FaaS even before a real cloud migration takes place. Because of the low entry barrier, factoring out some logic into functions – think fetching data from an external API through a Lambda function – is easy and low-risk.
Enter AWS Lambda
As of today, AWS Lambda is the most popular FaaS platform and consequently supporting it was our first priority.
In a nutshell, a Lambda function is a piece of user provided code running in application on a dedicated container on AWS. Of course there is a lot more going on behind the scenes. E.g. Lambda functions are autoscaled and load balanced and there are triggers for many use cases beside just web requests. E.g. a function can be triggered by data inserted into a database or an event coming from an IoT device.
Why you need end-to-end monitoring for AWS Lambda
As for every larger application and even more so for micro services, end-to-end monitoring is needed to get full visibility into all tiers of your stack. Think of a lambda function that calls a slow API. This will not only extend the runtime of your function which adds more costs, it will also affect the overall performance of your application.
In conclusion, Lambda monitoring helps you to
- optimize response time hotspots
- optimize timing hotspots
- simplify error analytics
- understand and optimize your architecture
How to monitor AWS Lambda functions
Out-of-the box, Dynatrace comes with the full set of CloudWatch metrics.
By deploying the Dynatrace agent to Lambda we additionally provide
- End-to-end tracing to and from lambda functions, without changing your code
- AI powered problem detection
- Response times
- Failure rates
- Process metrics
- Event Loop Metrics (for Node.js)
This functionality is configurable through your AWS Lambda dashboard.
We are excited to roll out this new key feature to our customers soon and we will extend our closed EAP during the next weeks, aiming for a GA releases in Q1/2018.