Code Monkey home page Code Monkey logo

lambda-metrics's Introduction

lambda-metrics

Experiment to log CloudWatch metrics from a Lambda

I am trying to make a practical template for logging some metrics to CloudWatch from a scheduled Lambda function

Usage Notes

Start by setting up your virtual environment as venv. Use myvirtualenvsetup.sh to see how.

You can install the required packages with the command(s) in pipinstall.sh .

Assuming you have a working Role you can deploy the lambda with zappa deploy devops

and update changes with zappa update devops

and get rid of it with zappa undeploy devops

You can follow the action with zappa tail devops

The Flask and app.py are there purely for cargo cult reasons. We don't ever invoke that.

You can invoke the function from the command line (in the command line context) with e.g.

python -c "import lambdametrics; lambdametrics.send_random()"

TODO

  • Reduce logging (a lot)
  • Improve handling of cases where load balancer could not get a reply from a real server
  • Add "lambda_description" and "project_name" to zappa configuration
  • Add some file exclusions to zappa configuration
  • Clean out the app.py dummy file
  • Got it to work with S3 Notifications, but should have a filter on keys. Would be easy to do in the lambda itself, but I wonder if zappa can do this? Mostly looks like the filter should be in the lambda
  • Consider separating out CloudWatchUtil (of course)
  • Consider making the logfilter configurable with e.g. environment variables. Overall should probably consider configuration more carefully
  • Add some exception handling. Esp if there is a useful way to notify datadog
  • I'm keeping the pandas and numpy dependencies around for now despite everything

lambda-metrics's People

Contributors

curryeleison avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.