logfire-fleet-otel
OpenTelemetry auto-instrumentation for Python, under an OpAMP server.
Quickstart
Install it next to the instrumentations the application needs, then run the application under
opentelemetry-instrument with the server's address and key:
pip install logfire-fleet-otel opentelemetry-instrumentation-flask
OTEL_SERVICE_NAME=checkout \
OTEL_OPAMP_ENDPOINT=https://opamp.example.com/v1/opamp \
OTEL_OPAMP_HEADERS="Authorization=Bearer%20<key>" \
opentelemetry-instrument python app.py
In Logfire, Fleet → Connect an application gives the endpoint and the key. When it works, it says so once, with no logging setup:
OpAMP: connected to https://opamp.example.com/v1/opamp; this SDK is managed as checkout, instance <uid>
When it can't connect, it warns once, with what to check. The instance keeps its UID across restarts with no configuration (default-state-dir.md).
An application on the Logfire SDK calls logfire_fleet_otel.configure_logfire() in place of
logfire.configure() (pip install 'logfire-fleet-otel[logfire]'). One that sets its
OpenTelemetry SDK up in code already keeps that setup and calls logfire_fleet_otel.manage()
after it.
Everything else, including setting the SDK up in code with logfire_fleet_otel.configure(), is in
docs/python-otel.md.