Step 3: Add environment variables to the system service file
In your systemd service file (e.g., /etc/systemd/system/your-app.service), insert the following Environment line before the ExecStart directive.
Environment="S247_LICENSE_KEY=your_device_key" "APM_APP_NAME=your_app_name" "PYTHONPATH=/custom/path/apminsight:/custom/path/apminsight/bootstrap"
ExecStart=/usr/bin/python3 /path/to/your/flask/app/app.py
Note:
1. Replace your_device_key with the unique license key (see step 1).
2. Replace your_app_name with the custom name for your application monitor as it will appear in the Site24x7 portal.
3. Ensure custom/path matches the directory used during agent installation in step 2.
Step 4: Start the application service
- Reload systemd and start your Python application service to activate the installed agent.
- Trigger a few transactions in your Python application to initiate data collection.
Once the service is running and transactions are triggered, the Python agent will begin sending telemetry data to Site24x7. You can then view the metrics in the Site24x7 > APM > Applications section.
An example systemd service file