This document discusses monitoring AWS Lambda functions. It provides an overview of AWS Lambda, important concepts like triggers and statelessness. It also covers best practices, examples of AWS Lambda usage, and how to add monitoring. Specifically, it recommends adding a line to CloudWatch logs to report metrics to monitoring systems like Datadog. The speaker then demonstrates creating and monitoring a sample AWS Lambda function.
12. Other Examples
Bittorrent Tracker
Hugely scalable using S3
https://blog.zappa.io/posts/zappa-bittorrent-
tracker
Chat Bots
Easy to build
https://claudiajs.com/claudia-bot-builder.html
S3 Data Loading
Simpler than the typical Kinesis process
https://www.trek10.com/blog/serverless-
architectures-s3-data-loading/
Skills for the Amazon Echo
Make one today in the hall
13. Best Practices from AWS
Write stateless code
Local vars
Permissions
Minimize startup
Monitor
Delete old functions
29. Native Gotchas
Lambda runs on an Amazon Linux container
…and your dev box probably isn’t Amazon Linux…
…so native NPM modules are problematic
30. Native npm
1. Launch an Amazon Linux ec2
2. Use a node version manager
3. Install node 4.3
4. Install the native modules you need
5. Package the modules and dl to your box
6. Deploy
31. Building the demo with node-lambda
Four files:
• package.json
• .env
• event.json
• index.js
58. What are the AWS Lambda Metrics
aws.lambda.duration, min, max, sum
aws.lambda.errors
aws.lambda.invocations
aws.lambda.throttles
59. Three Options for Monitoring AWS Lambda
1. Add a custom metric to CloudWatch
2. Add metric directly to monitoring application
3. Add a line to the CloudWatch logs
60. How Datadog Does It
Add line to CloudWatch logs:
MONITORING|unix_epoch_timestamp|value|type|
my.metric.name|#tag1:value,tag2