If you use the
pyagent run command to instrument your application, the proxy is automatically started when you start the agent.
However, you may need to arrange to start the proxy separately from the agent. The most likely reason you would need to do this is because your Python environment uses uWSGI with Emperor or Apache with mod_wsgi. You can do so using the
pyagent run command described here. Only use this command only if you need to launch the proxy manually.
Directory Configuration Setting
The command you use to start the proxy needs to read the directory configuration setting, APPD_DIR, the base directory for the AppDynamics Python Agent configuration. Make sure it is correctly set. The default is
You can make this setting available to the proxy in any of the following ways:
- Setting the environment variable
- Setting the
APPD_CONFIG_FILEenvironment variable to point to the configuration file and then setting the base directory in the configuration file. See Install the Python Agent.
- Passing in the path to the configuration file to the pyagent proxy command using -c ( —config-file ) option as illustrated below.
Start, Stop, and Restart Options for the pyagent proxy
To start, stop, or restart the proxy, use the
pyagent run command, passing the desired operation and any options. The options include:
- —debug (-d): starts the proxy in debugging mode
- —no-watchdog: disables the proxy watchdog (not recommended)
- —config-file (-c): path to the Python Agent configuration file
When agent is stopped without stopping the proxy it continues to be shown as active for the next 10 minutes. To avoid the application from reappearing in the controller, it is recommended that you wait for at least 10 minutes before deleting the application after the agent shut down.