Metadata-Version: 2.4
Name: lumen-ai-celery
Version: 0.1.2
Summary: LumenAI Celery Instrumentor — background task observability for AI workloads
Project-URL: Homepage, https://github.com/skarL007/-lumen-ai-sdk
Project-URL: Repository, https://github.com/skarL007/-lumen-ai-sdk
Author-email: skarL007 <zpka21@hotmail.com>
License: MIT
Keywords: ai,background-tasks,celery,finops,observability,opentelemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.11
Requires-Dist: celery>=5.3.0
Requires-Dist: lumen-ai-core>=0.1.2
Requires-Dist: opentelemetry-instrumentation-celery>=0.40b0
Description-Content-Type: text/markdown

# lumen-ai-celery

Celery integration for LumenAI.

## Includes

- `CeleryInstrumentor`
- Signal-based instrumentation for `task_prerun`, `task_postrun`, and `task_failure`
- Tenant extraction from task keyword arguments when `tenant_id` is provided
- Task result metadata extraction for `tokens_in`, `tokens_out`, and `cost_usd`

## Install

```bash
pip install lumen-ai-celery
```

## Usage

```python
from lumen_ai import LumenAI
from lumen_ai_celery import CeleryInstrumentor

LumenAI.init(
    service_name="worker",
    redis_url="redis://localhost:6379/0",
    instrumentors=[CeleryInstrumentor()],
)
```

The integration observes task lifecycle spans without changing existing task bodies.
