You can monitor your Python applications using a Python web module, the Linux Agent, and the Metricly StatsD server.



  1. Navigate to the netuitive-agent.conf file.

  2. Update the StatsD setting to enabled = True.

    # local statsd server
    enabled = True
  3. Download the python web module and extract the files.

    >> wget
    >> tar xzvf
  4. Move the web directory to the same folder as your application.

    >> mv /opt/python
  5. Download the pystatsd client from GitHub.

    >> git clone
  6. Move the statsd directory to the same folder as your application.

    >> cd pystatsd
    >> mv statsd /opt/python/
  7. Import the web and statsd modules into your application’s code.

    import web
    import statsd
  8. Instrument your application code by calling the appropriate functions. Here’s an example:

    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())
  9. Save and then restart your application and the Linux Agent.