Metadata-Version: 2.4
Name: respan-instrumentation-crewai
Version: 0.1.0
Summary: Respan instrumentation plugin for CrewAI
License: Apache 2.0
Author: Respan
Author-email: team@respan.ai
Requires-Python: >=3.11,<3.14
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: crewai (>=0.80.0)
Requires-Dist: opentelemetry-instrumentation-crewai (>=0.40.0)
Requires-Dist: respan-tracing (>=2.15.2,<3.0.0)
Description-Content-Type: text/markdown

# respan-instrumentation-crewai

Respan instrumentation plugin for CrewAI. Wraps `opentelemetry-instrumentation-crewai` to automatically trace agent runs, task executions, and tool calls.

## Configuration

### 1. Install

```bash
pip install respan-instrumentation-crewai
```

### 2. Set Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `RESPAN_API_KEY` | Yes | Your Respan API key. |
| `RESPAN_BASE_URL` | No | Defaults to `https://api.respan.ai`. |

## Quickstart

### 3. Run Script

```python
from dotenv import load_dotenv

load_dotenv()

from respan import Respan
from respan_instrumentation_crewai import CrewAIInstrumentor

respan = Respan(instrumentations=[CrewAIInstrumentor()])

from crewai import Agent, Task, Crew

agent = Agent(
    role="Poet",
    goal="Write a short haiku about recursion in programming",
    backstory="You are a programmer who writes haikus.",
)

task = Task(
    description="Write a haiku about recursion in programming.",
    expected_output="A single haiku (3 lines: 5-7-5 syllables).",
    agent=agent,
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result.raw)

respan.flush()
```

### 4. View Dashboard

After running the script, traces appear on your [Respan dashboard](https://platform.respan.ai).

## Further Reading

See the [examples/crewai/](../../examples/crewai/) directory for runnable examples.

