Fork me on GitHub

Monitoring

Monitoring tools capture, analyze and display information for a web application's execution. Every application has issues arise throughout all levels of the web stack. Monitoring tools provide transparency so developers and operations teams can respond and fix problems.

Why is monitoring necessary?

Capturing and analyzing data about your production environment is critical to proactively deal with stability, performance, and errors in a web application.

Monitoring layers

There are several important resources to monitor on the operating system and network level of a web stack.

  1. CPU utilization
  2. Memory utilization
  3. Persistence storage consumed versus free
  4. Network bandwidth and latency

Application level monitoring encompasses several aspects. The amount of time and resources dedicated to each aspect will vary based on whether an application is read-heavy, write-heavy, or subject to rapid swings in traffic.

  1. Application warnings and errors (500-level HTTP errors)
  2. Application code performance
  3. Template rendering time
  4. Browser rendering time for the application
  5. Database querying performance

Monitoring Third Party Services

  • New Relic. Application and database monitoring as well as plug ins for capturing and analyzing additional data about tools in your stack.

  • CopperEgg is lower-level monitoring on server and infrastructure. It's popular with DevOps shops that are making changes to their production environments and want immediate feedback on the results of those modifications.

  • Status.io focuses on uptime and response metrics transparency for web applications.

  • StatusPage.io (yes, there's both a Status and StatusPage.io) provides easy set up status pages for monitoring application up time.

  • PagerDuty alerts a designated person or group if there are stability, performance, or uptime issues with an application.

Open source monitoring projects

  • statsd is a node.js network daemon that listens for metrics and aggregates them for transfer into another service such as Graphite.

  • Graphite stores time-series data and displays them in graphs through a Django web application.

  • Bucky measures the performance of a web application from end user's browsers and sends that data back to the server for collection.

  • Sensu is an open source monitoring framework written in Ruby but applicable to any programming language web application.

  • Graph Explorer by Vimeo is a Graphite-based dashboard with added features and a slick design.

  • PacketBeat sniffs protocol packets. Elasticsearch then allows developers to search the collected data and visualize what's happening inside their web application using the Kibana user interface.

  • Munin is a client plugin-based monitoring system that sends monitoring traffic to the Munin node where the data can be analyzed and visualized. Note this project is written in Perl so Perl 5 must be installed on the node collecting the data.

Monitoring resources

Monitoring learning checklist

Review the software-as-a-service and open source monitoring tools below. Third party services tend to be easier to set up and host the data for you. Open source projects give you more control but you'll need to have additional servers ready for the monitoring.

My recommendation is to install New Relic's free option with the trial period to see how it works with your app. It'll give you a good idea of the capabilities for application-level monitoring tools.

As your app scales take a look at setting up one of the the open source monitoring projects such as StatsD with Graphite. The combination of those two projects will give you fine-grained control over the system metrics you're collecting and visualizing.

What topic do you want to learn next?

How do I learn more about the users of my app with web analytics?

What should I learn about web application security?

How do I automate the server configuration I've set up?

How should I log events in my application outside monitoring?


对Full Stack Python这本书很感兴趣?想要一本包含代码、详细教程的完整版吗?那么用邮箱订阅吧。一旦完成了我就会发给你的,别担心除了订阅确认邮件,我是不会给你发乱七八糟的邮件的。