Monkeying Around with Python at New Relic

A session at DjangoCon US 2011

Tuesday 6th September, 2011

11:20am to 12:00pm

This session will cover the challenges of creating a production application performance monitoring system for Python. It includes an overview of the architecture of the system, as well as how it hooks into Django and captures details about web transactions, database transactions, memcache requests, exceptions and much more.

This session provides a technical review of the challenges associated with instrumenting Python for production monitoring. How do you place monitoring hooks into code that cannot be modified directly in order to collect meaningful performance data? Concepts covered in this session will include:

  • Using context manager objects to time execution of code.
  • Using context manager objects to catch details of exceptions.
  • Applying a context manager to functions using wrappers and decorators.
  • Applying a context manager to WSGI applications and components.
  • How to go about applying the above to existing code using monkey patching.
  • Deriving the name of a wrapped object for identification purposes.
  • Using post import hooks as a means to trigger monkey patching.
  • Driving the process of monkey patching from a configuration file.

The talk includes real-world examples of how these mechanisms have been used to add instrumentation to the Django web framework in order to collect actionable performance data.

About the speaker

This person is speaking at this event.
Graham Dumpleton

C and Python developer. Interested in Apache, WSGI, Python web hosting, Python web frameworks, Docker and Platform as a Service (PaaS). bio from Twitter

Coverage of this session

Sign in to add slides, notes or videos to this session

Tell your friends!


Time 11:20am12:00pm PST

Date Tue 6th September 2011

Short URL


Official session page


View the schedule



See something wrong?

Report an issue with this session