Creating, Monitoring & Alerting Lambda with DevopsGirls and SEEKers
Have you ever joined a team and thought, how does everything come together? And more importantly how do we get notified when the system isn’t working as intended? In a workshop run by SEEKers we explored how a simple API can be created, deployed, monitored and alerted of any errors.
—
Written by Ash Smridhi and Nancy Do
On the 29th of January 2022, SEEKers hosted a remote workshop for DevOps Girls. This was a beginner-intermediate level hands-on workshop to understand how to setup AWS services using Serverless, and be notified via Slack of errors generated by the API. Participants were mostly interested in learning more about observability, anything devops and understanding how Lambdas work!
Before the workshop
After months of planning and Zoom meetings, we came up with a project that covered end to end creation, deployment and monitoring of Lambda.
Before running the workshop we had hesitations and questions about whether or not this was too simple or would it be useful for people. After a dry run with our trusted colleagues, to our surprise everyone learnt something new from it. They found it really helpful to see event driven architecture in action with something they’ve created. Even for the people who were familiar with AWS services it was a good refresher to build something simple from scratch.
On the day!
The day comprised of morning coffee and 2 other SEEKers (Bridget and Irene) joining in to help participants debug issues throughout the workshop. The event started at 9am for those that needed assistance with setup. We then swiftly kicked the workshop off at 10am with an overview of key concepts which included:
- Cloud computing
- Different AWS services that we were covering on that day (API gateway, Lambda and CloudWatch)
- Event driven architecture
- Infrastructure as code
- Serverless
We then took another coffee break to help tie up any loose ends with setup and then jumped into the meaty section of the agenda which was the project!
Hands on project time!
We started off by walking the attendees through the project file structure. We provided them with an endpoint that would generate dog names given a breed. A very simple and fun example but when applied to bigger and crucial systems, having alerting and monitoring in place was important.
This is the overview of the project:
Lambda Deployment — We deployed the dog name generator API to Lambda using serverless
. This helped participants understand:
- The architecture of how a lambda function is written and what it looks like in Amazon console
- The IAM service and how to configure
aws cli
- The deployment process and cloud-formation stacks
- How to test the API that had just been deployed.
Created an SNS Topic — this helped participants:
- Understand how SNS publisher and subscriber model works
- How SNS fits into our project
- How to add an SNS topic as a resource.
Created a CloudWatch Alarm — this was done to show:
- How to find logs, metrics and insights
- How to create different kinds of alarms and trigger an action.
Create a notification lambda — this step gives an opportunity to create a lambda handler from scratch that will call the Slack webhook and notify the Slack channel.
After following the step by step guide participants were able to trigger an error to their deployed API, track the error through CloudWatch alarms and see the Slack notification lambda get triggered sending an error message in the configured slack channel:
We have designed this content to be self paced. So please feel free to follow the instructions at the simple-lambda-alert-notification repository.
What did participants say about the day?
Overall the day was a successful one with great feedback:
Topic and content was good
Everything was well explained… team was friendly and helpful
Step by step guide was clear with experienced [developers] kindly offering help.
What would we do differently?
There are definitely a couple of things that we’d do differently:
- Capture participant emails: We tried to communicate with participants over meetup.com however that turned out to be very unstable. So we will definitely ask for preferred email upfront
- Account for higher drop out rate. It looks like there is a higher drop out rate during the weekends. So we will either open the event to more people or hold the event during a weekday in the next workshop.
Massive thanks to the following SEEKers:
Bridget Barnes, Irene Lee, Franca Moretto, Andy Luu, Alexa Nguyen, Saumya Pandey.
Massive thanks to the non-SEEKer contingent:
DevOps Girls organisers for your help and support.
Special thanks to AWS’s sponsorship and providing each participant with an AWS voucher.