Python
Trace Python services with the LogDrop Python agent.
LogDrop traces Python services without code changes. On Kubernetes, one pod annotation adds the LogDrop Python agent; outside Kubernetes, you start your service with logdrop-run.
The agent is a distribution of OpenTelemetry Python. It records the requests your service handles and its calls to databases, caches, message brokers and other services, removes everything that could carry personal or secret data, and sends the spans to LogDrop over HTTPS with a traces ingest key. It removes the same data as the Java agent and the Node.js agent, so a request that crosses Java, Node.js and Python services appears as one trace.
Current release: LogDrop Python agent 0.1.0-alpha1 (the image registry.logdrop.io/logdrop-python-agent, and logdrop-agent and logdrop-api 0.1.0a1 on PyPI) and Helm chart logdrop-infrastructure 0.1.1-alpha15.
Requirements
Before you install the agent, check that you have the LogDrop project and key, and that your platform, Python version and libraries are supported.
- The project, the traces ingest key and the endpoint from Before you start.
- Kubernetes 1.28 or newer with Helm 3.8 or newer, or any host that runs Python. On Kubernetes, the agent image
0.1.0-alpha1runs on linux/amd64 nodes only. - CPython 3.10 or newer. Python 3.10 to 3.14 are tested, on Debian and Alpine images. On an older Python the agent prints one line and your service runs untraced.
- Traced libraries: Django, Flask and FastAPI; outgoing HTTP with
requests,httpx,urllib3,urllibandaiohttp; PostgreSQL (psycopg,psycopg2,asyncpg), MySQL (PyMySQL,mysqlclient,mysql-connector), MongoDB (pymongo), Redis (redis), RabbitMQ (pika,aio-pika), Kafka (kafka-python,confluent-kafka), Celery and gRPC. SQLAlchemy is traced through its database driver. - Servers: tested with gunicorn, with sync and uvicorn workers. Worker processes forked by the server are traced.
- Not supported yet: gevent and eventlet workers, PyPy, frozen applications (PyInstaller) and Python started with
-Ior-E(both ignorePYTHONPATH).
Install the agent
Choose the guide for where your service runs. Both add the same agent, configured with the same LOGDROP_* settings.
Kubernetes
Install the LogDrop Helm chart and opt workloads in with one pod annotation.
Outside Kubernetes
Install the agent from PyPI and start your service with logdrop-run, on a host, with systemd or in a container.
Reference
These pages hold the details behind the install guides. Use them to add your own spans, change a setting, plan for limits or fix a problem.
Your packages and the agent's
How the agent's packages sit next to your service's, and when the agent stays off.
Custom spans
Add spans for business operations with the optional logdrop-api package.
Agent settings
Every LOGDROP_* setting, its default and its range.
Limits
What LogDrop accepts per request, per key and per project.
Rotate the ingest key
Replace a key without losing traces.
What LogDrop records
The data a span carries, and what never leaves your service.
Verify what you install
Check the signatures of the agent image, the chart and the PyPI packages.
Licences
The licences of the agent and the API package.
Troubleshooting
Agent messages and what to do about them.
.png)