Help APM APM for Python Install Python Agent

Install APM Insight Python Agent

To install APM Insight Python agent, follow the below given instructions.

Installation instructions

  1. The APM Insight Python agent is available from the Python Package Index. Install the agent in your application directory using the pip command.

    pip install apminsight
    The agent provides support for the applications that use the Web Server Gateway Interface in their services.
    • For Django applications,
      • Include the agent app name in Django's settings.py file.
      • Add apminsight.contrib.django as the first of INSTALLED_APPS in the settings.py file.
    • For Flask applications, add import apminsight in the first line of the main file.
  2. You can configure the agent details using either environment variables or a configuration file.
    • If you configure the agent details using environment variables, add the license key using the following command:
                export S247_LICENSE_KEY=<Your Device Key> 
      You can obtain your license key by logging in to your Site24x7 account and navigating to Admin> Developer > Device Key. The device key is your license key.
    • Apart from the license key, you can also add other environment variables like your application name and port number. 
      • export APM_APP_NAME = <Your application name> 
      • export APM_APP_PORT = <Your application port number>
        If you are using proxy:
      • export PROXY_SERVER_HOST=< Proxy Server host number> 
      • export PROXY_SERVER_PORT=<Proxy Server port number>
      • export PROXY_AUTH_USERNAME=<Username for proxy authentication>
      • export PROXY_AUTH_PASSWORD=<Password for proxy authentication>
    • If you configure the agent details using a JSON configuration file:
      • Create a file named apminsight_info.json in the root folder where the application is running.
      • Insert the following code snippet into the file, making the necessary changes:
        {
        "license_key" : "<Your Device Key>",
        "app_port" : "<Your application port number>",
        "appname" : "<Your application name>",
        If you are using proxy:
        "proxy_server_host" : "<Proxy host number>",
        "proxy_server_port" : "<Proxy port number>",
        "proxy_auth_username" : "<Username for proxy authentication>",
        "proxy_auth_password" :"<Password for proxy authentication>",
        }
  3. Restart your Python application.
  4. Perform some transactions in your application so that agent can collect data. 
  5. Log into your Site24x7 account and navigate to APM Insight.
  6. Click your application to see your application metrics. 
  7. You can view agent log files in the apminsightdata directory, which will be present under the process created location.
  • You can view key metrics like Apdex score, overall response time, throughput, error, and exception count. You can also mark key transactions, view traces and database transactions, and mark and record your deployments.
  • You can also change the default configuration profile to suit your monitoring needs.
 
 

Related links:

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help APM APM for Python Install Python Agent