Metadata-Version: 2.5
Name: pydantic-opamp-otel
Version: 0.1.1
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: opentelemetry-exporter-otlp>=1.43
Requires-Dist: opentelemetry-instrumentation>=0.64b0
Requires-Dist: opentelemetry-sdk>=1.43
Requires-Dist: pydantic-opamp-client==0.1.1
Provides-Extra: logfire
Requires-Dist: logfire<6,>=5.1; extra == 'logfire'
Description-Content-Type: text/markdown

# pydantic-opamp-otel

OpenTelemetry auto-instrumentation for Python, under an OpAMP server.

## Quickstart

From the repository root (until it is published), fetch the core, install it with the client and
this package next to the instrumentations the application needs, then run the application under
`opentelemetry-instrument` with the server's address and enrollment key:

```bash
scripts/fetch_core.py fetch               # the core release the lock pins, verified
pip install ./python/core ./python ./python/otel opentelemetry-instrumentation-flask
OTEL_SERVICE_NAME=checkout \
OTEL_OPAMP_ENDPOINT=https://opamp.example.com/v1/opamp \
OTEL_OPAMP_HEADERS="Authorization=Bearer%20<enrollment key>" \
opentelemetry-instrument python app.py
```

When it works, the `pydantic_opamp_otel` logger says, at INFO:

```
OpAMP: connected to https://opamp.example.com/v1/opamp; this SDK is managed as checkout, instance <uid>
```

INFO shows where the application's logging shows it (`logging.basicConfig(level=logging.INFO)`,
say). When it can't connect, it warns once, with what to check; warnings show without any setup.
The instance keeps its UID across restarts with no configuration
([default-state-dir.md](../../docs/default-state-dir.md)).

An application on the Logfire SDK calls `pydantic_opamp_otel.configure_logfire()` in place of
`logfire.configure()` (install `./python/otel[logfire]`).

Everything else, including setting the SDK up in code with `pydantic_opamp_otel.configure()`, is in
[docs/python-otel.md](../../docs/python-otel.md).
