LogDrop
Backend Tracing

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-alpha1 runs 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, urllib and aiohttp; 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 -I or -E (both ignore PYTHONPATH).

Install the agent

Choose the guide for where your service runs. Both add the same agent, configured with the same LOGDROP_* settings.

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.

On this page