You can monitor your Python applications using a Python web module, the Linux Agent, and the Metricly StatsD server. To get up and running, all you’ll need is to install our Linux Agent and then instrument custom metrics.


Before you configure metric instrumentation in your Python application(s), you’ll need to install the Linux Agent and Metricly StatsD server first. See the instructions on this page for how to install it.

Python Configuration

  1. Set the statsd setting in the netuitive-agent.conf file to enabled = True.
    # local statsd server
    enabled = True
  2. Download the python web module and extract the files.
    >> wget
    >> tar xzvf
  3. Move the web directory to the same folder as your application.
    >> mv /opt/python

    If you prefer to not move the file, you can install the module globally:

    >> cd
    >> python install
  4. Download the pystatsd client from GitHub.
    >> git clone
  5. Move the statsd directory to the same folder as your application.
    >> cd pystatsd
    >> mv statsd /opt/python/
  6. Import the web and statsd modules into your application’s code.
    import web
    import statsd
  7. Instrument your application code by calling the appropriate functions.

    Below is a simple Python web application with the StatsD client imported to show how to create metrics using some of the types compatible with the pystatsd client:

    import web
    import statsd
    # Counter Increment
    c.incr('', 1)
    # Counter Decrement
    c.decr('', 1)
    # Timer
    c.timing('', 320)
    # Gauge
    c.gauge('', 4)
    urls = (
      '/', 'index'
    class index:
      def GET(self):
        return "Hello, world!"
    if __name__ == "__main__":
      app = web.application(urls, globals())
  8. Save your application, and then restart your application and the Linux Agent.


Redhat 6 and 7
CentOS 6 and 7
Amazon Linux (latest)
Ubuntu 12, 14, 15, and 16
Debian 7, 8, and 9
Linux Agent
Metricly StatsD Server
Python Client Library