Complete Workflows
This page shows how to structure an end-to-end trace in a real app: one root span per request/job, and a few child spans for the steps that matter. Keep most of your code descriptive and add spans only where they provide signal.The recommended structure
- Entry point: wrap your request handler / worker job with
start_observe. - Key steps: add
observespans for major stages (retrieval, generation, tools). - Provider calls: rely on auto-instrumentation when possible (OpenAI, vector DBs, frameworks).
- Quality: attach evaluators at the root (optionally sampled).
Example: minimal RAG workflow
Where prompts fit
Fetch a prompt once per generation step, then call your LLM withprompt.text and prompt.model: