Ragas (tracing)
Ragas (tracing)
Ragas is a framework for evaluating LLM and RAG applications. respan-instrumentation-ragas traces Ragas 0.4 metrics, dataset evaluations, and experiments as canonical Respan task spans, preserving the active workflow hierarchy around them.
The adapter covers both the preferred Ragas 0.4 metric collections API and the legacy evaluation surfaces. Nested internal calls are collapsed so one logical metric operation does not produce duplicate sync and async spans.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Example projects
Setup
Set the Respan API key
Metric-specific provider credentials are still required for metrics that call an LLM or embedding model. Deterministic metrics such as exact match do not require a provider key.
View your trace
Open the Traces page to inspect one task span per metric with its inputs, score, timing, and status.
Supported operations
All of these operations emit canonical Respan task spans. Successful spans include status_code=200. Failures are re-raised unchanged after recording OpenTelemetry error status, an exception event, backend-visible status_code, and error.message.
Async metrics
Batch metric methods are traced as one logical operation, without an extra span for each internal sync-to-async delegation.
Dataset evaluation
The legacy evaluate and aevaluate entry points remain supported:
Experiments and rows
Ragas experiments produce a task for the experiment run and a child task for every evaluated row:
Configuration
Disable content capture
With capture disabled, evaluation inputs and outputs are omitted. Operation names, duration, lifecycle, status, and exception type remain visible.
Group evaluations in a workflow
Use a Respan workflow or propagated attributes to group several Ragas operations into one trace: