Metadata-Version: 2.5
Name: pytracer-gateway
Version: 0.1.3
Summary: pyTracer ingestion gateway - receives spans and writes them through to the trace store.
Project-URL: Homepage, https://pytracer.com
Project-URL: Documentation, https://pytracer.com/docs.html
Project-URL: Repository, https://github.com/vi6120/pyTracer
Project-URL: Issues, https://github.com/vi6120/pyTracer/issues
Author: Vikas Ramaswamy, Nagesha Sheshadri
License-Expression: AGPL-3.0-or-later
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.110
Requires-Dist: pydantic>=2.6
Requires-Dist: pytracer-sdk==0.1.3
Requires-Dist: pytracer-stores==0.1.3
Requires-Dist: uvicorn>=0.29
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: prometheus-client>=0.20; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: redis>=5.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: metrics
Requires-Dist: prometheus-client>=0.20; extra == 'metrics'
Provides-Extra: redis
Requires-Dist: redis>=5.0; extra == 'redis'
Description-Content-Type: text/markdown

# pytracer-gateway

Layer 2 of pyTracer: a stateless FastAPI service that receives batched spans from
deployed SDKs, validates them against the span schema, authenticates each
project by API key, and writes them through to the ClickHouse trace store via
an internal queue so a traffic spike never blocks ingestion.

```bash
# Run it (writes to ClickHouse from docker-compose):
PYTRACER_GATEWAY_API_KEYS="devkey:my-app" uvicorn pytracer_gateway.app:build_default_app --factory --port 8080
```

```
POST /v1/spans      body: {"spans": [ <span>, ... ]}   header: X-API-Key: <key>
GET  /healthz       liveness
GET  /readyz        readiness (ingest worker running)
GET  /v1/stats      ingest counters
```

## Compatibility

The gateway ignores span fields it does not recognise instead of rejecting the
span, so a newer SDK that adds an optional field still ingests against an older
gateway. When upgrading a release that adds a span field, upgrade the gateway
before the SDKs that send to it, so the field is understood wherever it lands.
