LogDrop
Backend TracingPython

Your Packages and the Agent's

How the LogDrop Python agent's packages sit next to your service's, and when the agent stays off.

Python loads every package of a process from one import path, so the agent's packages and your service's meet there. The agent is built so that your service never changes: on Kubernetes it brings its own copies and keeps out of your packages' way, and it stays off rather than run with packages it cannot use.

On Kubernetes

The agent image brings two sets of packages and puts them on the import path around yours:

PackagesWhereEffect
OpenTelemetry (opentelemetry-api, opentelemetry-sdk and the instrumentations)Before your packagesEvery library in your service uses the agent's OpenTelemetry API
typing_extensions, wrapt, packaging, asgirefAfter your packagesWhere your image has one of them, your copy is used

Libraries that depend on opentelemetry-api keep working: FastAPI does, for example, and the API stays backwards compatible across 1.x.

The agent stays off, with one line in your service's log that says why, in these cases:

Your image installsLine
Its own OpenTelemetry SDK (opentelemetry-sdk), so it sets up its own pipelinethe application installs its own OpenTelemetry SDK (opentelemetry-sdk <version>)
An opentelemetry-api newer than the agent'sthe application's opentelemetry-api <version> is newer than the agent's (<version>)
typing_extensions older than 4.5, wrapt 3 or newer, packaging older than 18, or asgiref outside 3.xthe application's <package> <version> does not fit the agent (it needs …)

Your service then runs exactly as without the agent: the agent leaves the import path as it found it.

Outside Kubernetes

pip install logdrop-agent installs the agent's packages into your service's environment, in the exact versions the agent was tested with. If your service pins other versions of them, pip reports the conflict when you install, before anything runs. The same rules apply: a service that sets up its own OpenTelemetry SDK should not also run the agent.

Check an image before you opt it in

This command lists the packages in an image that decide whether the agent runs. Run it before a rollout to know whether the service will be traced or the agent will stay off.

docker run --rm --entrypoint python <image> -m pip list 2>/dev/null | grep -iE '^(opentelemetry|typing.extensions|wrapt|packaging|asgiref) '

No line, or only opentelemetry-api in version 1.45.2 or older together with the four packages in the versions above, means the agent can run.

On this page