Configuring the Python data collector for on-premises applications

To collect information about Python applications that run in your local environment, you must configure the Python data collector.

Before you begin

  1. Make sure the Python applications that you want to monitor have unique names. The Python data collector handles two different applications with the same name as one application, which might cause data display issues in the Cloud APM console.
  2. Download the data collector package from IBM® Passport Advantage® website. For detailed instructions, see Download instructions.
  3. Configure the data collector package with the make_configuration_packages.sh and configure_agent_images.sh scripts on the system where the Cloud APM server is installed. For detailed instructions, see Configuring the downloaded images.

About this task

The following procedure configures the data collector within your Python application with default settings. To customize data collector configuration, use the environment variables in the data collector configuration files. For more information, see Customizing the Python data collector for on-premises applications.

Procedure

  1. Extract files from the data collector package. The python_datacollector_8.1.4.0.tgz package is included in the extracted directory.
  2. Extract files from the data collector package, for example, by running the following command:
    tar -zxf python_datacollector_8.1.4.0.tgz
  3. From the python_dc directory, run the following command:
    python server.py
  4. Run the following command:
    pip install ibm_python_dc --extra-index-url http://host name or ip:8000/
    python-dc-repos/simple/ --trusted-host host name or ip
    where host name or ip is the name or IP address of the host to run your Python data collector repository.
    Important: Use either the name or the IP address to specify the host for both the URL and the trusted host in this command. For example, if you specify the host by using the IP address and the IP address is 9.42.36.180, the command is as follows:
    pip install ibm_python_dc --extra-index-url http://9.42.36.180:8000/
    python-dc-repos/simple/ --trusted-host 9.42.36.180
  5. In the settings.py file of your Python application, add ibm_python_dc.kpg_plugin.ResourceMiddleware to the MIDDLEWARE_CLASSES section to the format of the following example:
    MIDDLEWARE_CLASSES = (
        "ibm_python_dc.kpg_plugin.ResourceMiddleware", 
        "mezzanine.core.middleware.UpdateCacheMiddleware",
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.common.CommonMiddleware',

Results

The data collector is configured with default settings and connected to the Cloud APM server.

What to do next

You can now log in to the Cloud APM server to view the monitoring data.
Remember: After you add your Python application to the Cloud APM console, you can view its monitoring data in the component named Python Runtime application.

For instructions on how to start the Cloud APM server, see Starting the Cloud APM console. For information about using the Applications editor, see Managing applications.