November 22, 2018
Serverless workflows are notorious for being difficult to monitor and manage, and providers are starting to take notice. AWS Lambda – one of the most popular FaaS platforms – is now slowly taking steps to improve the observability and manageability of functions with the recent addition of Lambda Applications view.
As an AWS Lambda advocate myself, I decided to try out Applications to see how it could potentially make adopting a serverless architecture easier, or improve the lives of serverless veterans.
I recommend looking at the official docs.
I started by heading over to the AWS console to look for a simple application to deploy. Serverless survey was the first application that caught my eye. According to the app’s description, it includes two Lambda functions and one DynamoDB table for storing the survey's results:
I deployed the application using the Deploy button:
Once the deployment had finished, I now had two functions (Survey and SurveySubmit) deployed along with the DynamoDB table (SurveyTable). The deployment also created 9 other resources including roles, API endpoints, and permission sets. I was able to get more details about each resource by opening the Applications View and then clicking on the Applications Name:
Each resource created by the application is listed and categorized. There are four primary resources - two Lambda functions, one DynamoDB table, and one API Gateway (or APIGW), which was declared in the SAM template with the API event. Each resource can be expanded to show all the supporting resources such as roles and deployments.
While the serverless survey application has only a few resources, larger applications can have hundreds or even thousands of resources. This view is critical for quickly seeing what resources your application does and does not have.
Next I needed to see how the application works. The first function – Survey – displays the survey’s frontend as an HTML page, and the second function – SurveySubmit – collects the survey’s results and submits them to the DynamoDB table.
I want to continue with some step-by-step instructions: Start by clicking on the Survey resource to open the function's configuration page. Here, you can change the function's resources and even modify its code. To get the URL, click on the API Gateway trigger as shown below - this will open the survey in a browser window:
Next, click on the URL to open the survey page in the browser:
After filling out the survey, click the send button multiple times to make sure the function is working and responding correctly.
Now, you’ll want to check the results in the DynamoDB table: go back to the Applications View and select the SurveyTable resource. You should be able to see the raw data by clicking on the Items tab:
Now that the application is running, take a look at metrics - For that, you need to open the Monitoring view.
The Monitoring tab shows metrics for both functions including the number of requests, errors, and average duration of each request. You can access it by opening the Applications View and clicking on the Monitoring tab
You can see metrics for other resources like the APIGW and DynamoDB using the dropdown menu above the dashboard. You can even add custom metrics by adding an Amazon CloudWatch dashboard to the Application Template.
As far as simplifying serverless functions goes, Lambda Applications provides clear benefits. According to Amazon, it adds portability to Lambda projects and integrates with other AWS tools such as CodePipeline, CodeBuild, and the Serverless Application Model command line interface (SAM CLI). These tools were already available for regular Lambda functions, and Applications hasn't really added much to that mix.
What more can we expect to see from Lambda Applications in the future?
Lambda Applications certainly adds useful features to the growing arsenal of serverless management tools. And it take all of us one step closer to serverless utopia.