Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AWS ReInvent 2016 - DEV205-Monitoring Hold The Infrastructure

AWS ReInvent 2016 - DEV205-Monitoring Hold The Infrastructure

At re:Invent this year, I gave a talk about monitoring AWS Lambda. This folder contains the materials from that session.

You can find the GitHub repo for the demo app I used here: https://github.com/DataDog/monitorlambdasession

If you have questions, reach out to me at [email protected] or @technovangelist on Twitter.

Matt Williams

November 30, 2016
Tweet

More Decks by Matt Williams

Other Decks in Technology

Transcript

  1. © 2016, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Matt Williams - Evangelist @ Datadog Monitoring, Hold the Infrastructure Getting the Most from AWS Lambda
  2. The Plan Learn about the basics of AWS Lambda Add

    AWS Lambda to your infrastructure Monitoring 101 (the tl;dr version) Monitoring AWS Lambda
  3. What is AWS Lambda The next stage in a long

    progression... physical boxes virtual machines on physical boxes containers lambda AWS instances
  4. Important AWS Lambda Concepts Each event will trigger a new

    Lambda function There is a safety limit per region of 100 (contact support for changes)
  5. What is a AWS Lambda Function • Your executable code

    • No restrictions • Priced based on execution time, quantity, and memory
  6. What can trigger AWS Lambda? Files Amazon S3 Database Updates

    Amazon DynamoDB Streams Amazon Kinesis Messages Amazon SNS, Amazon SES User Data & Authentication Amazon Cognito Infrastructure Changes AWS CloudFormation Logs, Events, Metrics Amazon CloudWatch IoT Echo, Amazon API Gateway
  7. 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
  8. Best Practices from AWS Write stateless code Local vars Permissions

    Minimize startup Monitor Delete old functions
  9. Native Gotchas Lambda runs on an Amazon Linux container …and

    your dev box probably isn’t Amazon Linux… …so native NPM modules are problematic
  10. 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
  11. What are the AWS Lambda Metrics aws.lambda.duration, min, max, sum

    aws.lambda.errors aws.lambda.invocations aws.lambda.throttles
  12. 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