Metadata-Version: 2.4
Name: dravyn-sentinel
Version: 0.1.0
Summary: Python SDK for Dravyn Sentinel - error tracking, performance monitoring, and security event capture.
License: MIT
Project-URL: Homepage, https://sentinel.dravyn.it.com
Project-URL: Documentation, https://dravyn.it.com/docs/dravyn-sentinel/
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27
Provides-Extra: fastapi
Requires-Dist: starlette>=0.37; extra == "fastapi"

# dravyn-sentinel

Python SDK for [Dravyn Sentinel](https://sentinel.dravyn.it.com) — application
monitoring and security-event detection. Captures request timing, unhandled
exceptions, and manual log events, and ships them to your Sentinel ingestion API.

## Install

```bash
pip install dravyn-sentinel
# for the FastAPI middleware:
pip install "dravyn-sentinel[fastapi]"
```

## Usage

```python
import dravyn_sentinel as sentinel
from dravyn_sentinel.fastapi import SentinelMiddleware

sentinel.init(
    api_key=os.environ["SENTINEL_API_KEY"],
    project_id="my-app",
    ingest_url="https://sentinel.dravyn.it.com",  # or your own ingestion API
)

app.add_middleware(SentinelMiddleware)  # auto-records requests + unhandled exceptions

try:
    process_payout(batch)
except Exception as exc:
    sentinel.capture_exception(exc, {"batch_id": batch.id})
    raise
```

The client flushes on a background daemon thread and registers an `atexit`
hook — a final flush runs on normal interpreter shutdown, but not on
`SIGKILL` or a hard crash.

Full docs: https://dravyn.it.com/docs/dravyn-sentinel/
