Python agent
The Python Agent discovers, maps, and tracks metrics for transactions, app services, and backend in your web application by injecting instrumentation into the Python application at runtime. You can also extend your performance monitoring to collect and analyze business data to help you improve the customer experience and to make data-driven business decisions. With flexible options for custom instrumentation and APIs, it offers multiple building blocks to customize the data you need.
System Requirements for Installation
- Python3 (version 3.5 and above) is required
Prerequisites
- For prerequisite checks for agent installation, see Prerequisite checks for agent installation.
- SixthSense Python Agent See Installing the agent.
- URL/IP of the Sixthsense collector (your tenant URL which will be provided by Customer Support)
- Access token - For accessing the token, see Accessing your Access Token under Getting started with the Observability Portal.
- Variables
- PACKAGE_TOKEN - Access Token required for downloading SixthSense Package provided by Customer Support.
- PACKAGE_TOKEN_USERNAME - Username for Access Token provided by Customer Support.
- TOKEN - Access Token from the SixthSense portal. See Accessing your Access Token under Getting started with the Observability Portal.
Installing the agent
Use the variables mentioned to install the agent.
- Get Access token from Sixthsense portal. See Accessing your Access Token under Getting started with the Observability Portal.
Configuring the Python agent
Copy and paste the below configuration to the top of your main application file. Add the $TOKEN to the environment file or add it manually to the configuration.
Naming an application
- Name your application.
Example:
Example:
For OneCloud Platform, use the following example:
Installing on Docker
- Before you build your Docker image, follow all the instructions mentioned earlier and deploy the Docker.
Example:
Python Frameworks and Protocols
Library | Version | Plugin Name | |
---|---|---|---|
1 | http.server | Python 3.5 ~ 3.8 | sw_http_server |
2 | urllib.request | Python 3.5 ~ 3.8 | sw_urllib_request |
3 | requests | >= 2.9.0 < 2.15.0, >= 2.17.0 <= 2.24.0 | sw_requests |
4 | Flask | >=1.0.4 <= 1.1.2 | sw_flask |
5 | PyMySQL | 0.10.0 | sw_pymysql |
6 | Django | >=2.0 <= 3.1 | sw_django |
7 | redis-py | 3.5.3 | sw_redis |
8 | kafka-python | 2.0.1 | sw_kafka |
9 | tornado | 6.0.4 | sw_tornado |
10 | pika | 1.1.0 | sw_rabbitmq |
11 | pymongo | 3.11.0 | sw_pymongo |
12 | elasticsearch | 7.9.0 | sw_elasticsearch |
13 | urllib3 | >= 1.25.9 <= 1.25.10 | sw_urllib3 |