Metadata-Version: 2.5
Name: logfire-fleet-otel
Version: 0.2.0
Summary: OpenTelemetry auto-instrumentation under an OpAMP server: install it, and opentelemetry-instrument takes its SDK settings (sampling, what to send, which instrumentations run) from the server
Project-URL: Repository, https://github.com/pydantic/opamp-clients
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: logfire-fleet-client==0.2.0
Requires-Dist: opentelemetry-exporter-otlp>=1.43
Requires-Dist: opentelemetry-instrumentation>=0.64b0
Requires-Dist: opentelemetry-sdk>=1.43
Provides-Extra: logfire
Requires-Dist: logfire<6,>=5.1; extra == 'logfire'
Description-Content-Type: text/markdown

# 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:

```bash
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](https://github.com/pydantic/opamp-clients/blob/main/docs/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](https://github.com/pydantic/opamp-clients/blob/main/docs/python-otel.md).
