uWSGI with Emperor

If your environment is uWSGI with Emperor, you need to modify your WSGI configuration files and then manually launch the proxy.

uWSGI Emperor is a process manager specific to the uWSGI server. It does not allow you to control how the uWSGI processes that it manages are launched and therefore cannot be used with the pyagent run command.

The location of the WSGI configuration files is deployment-dependent. See http://uwsgi-docs.readthedocs.org/en/latest/Emperor.html for details of Emperor deployment.

To instrument an application for uWSGI with Emperor:

  1. Create the configuration file described in Configure the Agent.
  2. Modify the uWSGI configuration file.
    Do one of the following, depending on whether the configuration uses a module directive or a wsgi-file directive:
    • Module Directive:

      If the uWSGI configuration has a module directive such as the following:

      CODE
      module = yourcompany.sample:app

      Modify that configuration by changing the module setting and adding the APPD_WSGI_MODULE and APPD_CONFIG_FILE settings to look like this, assuming that you have stored the configuration file in /etc/appdynamics.cfg:

      CODE
      env = APPD_CONFIG_FILE=/etc/appdynamics.cfg
      env = APPD_WSGI_MODULE=yourcompany.sample:app
      module = appdynamics.scripts.wsgi:application
    • WSGI-File Directive:

      If the uWSGI configuration has a wsgi-file directive:

      CODE
      wsgi-file = /var/www/yourcompany/sample.py
      callable = app

      Modify the configuration to look like the following, assuming you have stored the configuration file in /etc/appdynamics.cfg:

      CODE
      env = APPD_CONFIG_FILE=/etc/appdynamics.cfg
      env = APPD_WSGI_SCRIPT_ALIAS=/var/www/yourcompany/sample.py
      env = APPD_WSGI_CALLABLE_OBJECT=app
      module = appdynamics.scripts.wsgi
  3. Before running any traffic through the instrumented application, manually launch the proxy by executing:
    CODE
    pyagent proxy start