This topic lists the Python versions, third-party components, and frameworks supported by the Python agent.
Supported Python versions
Supported Protobuf versions
The Python agent uses Protobuf to encode data during reporting, which might conflict with the Protobuf version used by your application. The Python agent currently supports the following range of Protobuf versions:
"protobuf>=3.20.0, < 6.0"Supported OpenTelemetry API versions
The Python agent follows the OpenTelemetry API specification. However, different versions of the OpenTelemetry API may vary slightly. The Python agent currently supports the following OpenTelemetry API version range:
"opentelemetry-api <= 1.39.0"Notes
If your application starts with uvicorn, choose one of the following configuration methods.
Method 1: Add the following statement to the first line of the uvicorn entry file to import the Python agent.
from aliyun.opentelemetry.instrumentation.auto_instrumentation import sitecustomizeMethod 2: Replace uvicorn with gunicorn and add the
aliyun-instrumentprefix to the gunicorn command.Example:
uvicorn app:app --workers 4 --port=9090 --host 0.0.0.0Change the command to:
aliyun-instrument gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 app:appNoteThe aliyun-instrument instruction handles the initialization and non-intrusive instrumentation of the ARMS Python agent.
If your application starts with uWSGI, see Install the Python agent for a Django or Flask project that starts with uWSGI.
If you use gevent coroutines, you must set the
GEVENT_ENABLE=trueenvironment variable.For example, if your program contains the following code:
from gevent import monkey monkey.patch_all()You must set the environment variable as follows:
GEVENT_ENABLE=true
Database frameworks
Supported plugin versions
LLM (large language model) applications
Component | PyPI/GitHub repository URL | Minimum version | Later versions |
OpenAI | v1.0.0 | v2.14.0 | |
Dashscope | v1.0.0 | v1.2.1 | |
Llama-index | v0.10.5 | v0.10.43 | |
Langchain | v0.1.0 | v0.3.27 | |
Dify | v0.12.8 | v1.11.2 | |
Dify Plugin | No restriction | No restriction | |
MCP | v1.3.0 | v1.12.4 | |
Google ADK | v1.2.1 | v1.21.0 | |
RagFlow | v0.14.0 | v0.21.1 | |
AgentScope | v1.0 | v1.0.10 | |
CrewAI | v0.1.0 | v1.7.2 | |
LiteLLM | v1.0.0 | v1.79.0 |
LLM (large language model) services
Component | PyPI/GitHub repository URL | Earlier versions | Maximum version |
vLLM V0 | v0.5.0 | v0.8.4 | |
vLLM V1 | V0.8.2 | V0.10.0 | |
SGLang | v0.4.6 | v0.4.9.post6 |
HTTP/RPC frameworks
Component | PyPI/GitHub repository URL | Minimum version | Maximum version |
FastAPI | v0.58 | No restriction | |
asgiref | v3.0 | No restriction | |
aiohttp | v3.0 | No restriction | |
Django | v1.10 | No restriction | |
WSGI | None | No restriction | No restriction |
Flask | v1.0 | No restriction | |
Requests | v2.0 | No restriction | |
gRPC | v1.42.0 | No restriction | |
Jinja2 | v2.7 | < 4.0 | |
Click | v8.1.3 | < 9.0.0 | |
Tornado | v5.1.1 | No restriction | |
BlackSheep | v1.2.0 | No restriction |
Vector databases
Component | PyPI/GitHub repository URL | Minimum version | Maximum version |
milvus | v2.4.1 | No restriction |
Database frameworks
Component | PyPI/GitHub repository URL | Minimum version | Maximum version |
SQLAlchemy | v1.0.0 | < 2.1.0 | |
AsyncPG | v0.12.0 | No restriction | |
aiopg | v0.13.0 | < 2.0.0 | |
PyMySQL | No specific version requirement | < 2 | |
PyMSSQL | v2.1.5 | < 3 | |
psycopg | v3.1.0 | No restriction | |
psycopg2 | v2.7.3.1 | No restriction | |
MySQL | v8.0 | < 10.0 | |
MySQLClient | No specific version requirement | < 3 | |
PyMongo | v3.1 | < 5.0 | |
TortoiseORM | v0.17.0 | No restriction | |
Pydantic | v1.10.2 | No restriction | |
DBAPI | No specific dependency | No specific version requirement | No restriction |
SQLite3 | No specific dependency | No specific version requirement | No restriction |
Cache plugins
Component | PyPI/GitHub repository URL | Minimum version | Maximum version |
Redis | v2.6 | No restriction | |
PyMemcache | v1.3.5 | < 5 | |
Elasticsearch | v6.0 | No restriction | |
Cassandra | v3.25 | No restriction | |
Scylla | v3.25 | No restriction |
Message queue plugins
Component | PyPI/GitHub repository URL | Minimum version | Later versions |
Confluent Kafka | v1.8.2 | v2.7.0 | |
Kafka Python | No specific version requirement | No restriction | |
aiokafka | No specific version requirement | No restriction | |
Pika | No specific version requirement | No restriction | |
aio-pika | No specific version requirement | No restriction | |
Celery | v4.0 | < 6.0 | |
Remoulade | v0.50 | No restriction |
Other plugins
Component | PyPI/GitHub repository URL | Earlier versions | Maximum version |
Threading | No specific dependency | No specific version requirement | No restriction |
Logging | No specific dependency | No specific version requirement | No restriction |
Loguru | v0.5.0 | v1.0 | |
asyncio | No specific dependency | No specific version requirement | No restriction |