Metadata-Version: 2.4
Name: yaol
Version: 0.1.1
Summary: Yet another observability library
License-Expression: MIT
Requires-Python: >=3.14
Requires-Dist: opentelemetry-api>=1.36
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.36
Requires-Dist: opentelemetry-instrumentation-aiohttp-client>=0.57b0
Requires-Dist: opentelemetry-instrumentation-asyncpg>=0.57b0
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.57b0
Requires-Dist: opentelemetry-instrumentation-system-metrics>=0.57b0
Requires-Dist: opentelemetry-sdk>=1.36
Requires-Dist: pyroscope-io>=0.8.8
Requires-Dist: sqlalchemy[asyncio]>=2.0
Requires-Dist: structlog>=25.4
Description-Content-Type: text/markdown

# yaol

Yet another observability library. Wires OpenTelemetry traces, metrics and logs
plus structlog and Pyroscope profiling from a single config object.

## Usage

```python
from yaol import ObservabilityConfig, setup, shutdown, instrument_asyncpg

config = ObservabilityConfig(
    service_name="bot",
    service_version="0.1.7",
    environment="prod",
    otlp_endpoint="http://172.17.0.1:4317",
    logger_levels={"sqlalchemy.engine": "WARNING"},
)

setup(config)
instrument_asyncpg()
...
shutdown()
```

`from_env` builds the same object from environment variables:
`ENV`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `LOG_LEVEL`, `YAOL_JSON_LOGS`,
`YAOL_EXPORT_LOGS`, `YAOL_EXPORT_METRICS`, `YAOL_METRIC_INTERVAL_MILLIS`,
`YAOL_PROFILING_ENABLED`, `PYROSCOPE_ADDRESS`, `PYROSCOPE_SAMPLE_RATE`.

## Signals

- Traces — OTLP gRPC, `BatchSpanProcessor`.
- Metrics — OTLP gRPC, `PeriodicExportingMetricReader`.
- Logs — OTLP gRPC alongside the stdout handler; both are attached to the root logger.
- Profiles — Pyroscope push, off by default.

`shutdown()` flushes every provider, which the previous ad-hoc setup did not do.
