Api V 2 Experiments Logs List List
List experiment traces (root spans) using optimized CTE-based aggregation.
GET/POST /evaluations/experiments/<experiment_id>/logs/
Query params:
- page: Page number
- page_size: Page size (default 100)
- sort_by: Sort field (e.g., "-cost", "-start_time", "name")
- start_time: Filter start time
- end_time: Filter end time
- detail: Include span tree (1 or True)
- export: Set to 1 or True to export results to CSV/Excel
POST body (optional):
- filters: Advanced filter payload for complex filtering (including comparison_key filters)
Uses ExperimentTracesQueryBuilder for optimized querying:
1. Filter by experiment_id + org first (reduces rows 99.9%)
2. Aggregate into traces (GROUP BY trace_unique_id)
3. Join with root spans for details
4. Apply final filters and sort
Uses SpanTreeSerializerContextMixin to automatically handle:
- Span tree inclusion based on ?detail=1
- Storage enrichment based on authentication type (JWT vs API key)
- Dynamic serializer configuration
Uses ExportingMixin to handle:
- CSV/Excel export functionality via ?export=1
- Async export processing with email notifications
Authentication
AuthorizationBearer
JWT access token or Respan API key
Path parameters
experiment_id
Query parameters
page
A page number within the paginated result set.
page_size
Number of results to return per page.
Response
count
results
next
previous
total_count
current_filters
Pydantic model for FilterParamDict. A dictionary that maps metric names to their filter parameters.
Each key is a metric name (str), and each value can be:
- A single MetricFilterParamPydantic (one condition)
- A List[MetricFilterParamPydantic] (multiple conditions for same metric)
- A FilterBundlePydantic (nested filter bundle with connector)
Note: Uses extra=“allow” for dynamic metric name fields. The pydantic_extra annotation tells Pydantic what types to expect for extra fields, and generates typed additionalProperties in JSON Schema.
filters_data