Analytics
Review latency, token usage, and execution trends.
Overview
The Analytics view aggregates trace data across all projects and environments into summary metrics, time-series charts, and breakdowns. Data is fetched from the GET /analytics endpoint, which returns a pre-computed response including summary stats, hourly chart points, and dimension breakdowns.
Summary Metrics
The summary section displays eight key metrics computed from all available traces:
| Metric | Description | Source |
|---|---|---|
| Total traces | Count of all trace documents | collection.count_documents() |
| Success rate | Percentage of traces with status success | traces with status == success / total |
| Average latency | Mean wall-clock time across all traces | sum(latencies) / total |
| P95 latency | 95th percentile latency | Sorted latencies, 95th percentile index |
| Total token usage | Sum of token_count across all traces | sum(trace.token_count) |
| Failed traces | Count of traces with status failed | count where status == failed |
| Warning traces | Count of traces with status warning | count where status == warning |
| Slow requests | Count of traces with latency >= 1500ms | count where slow_request == true |
Time-Series Charts
Traces from the last 24 hours are bucketed by hour. Each bucket provides three data points per hourly window:
- Average latency — mean of all trace latencies in that hour
- Token usage — sum of token counts in that hour
- Trace count — number of traces recorded in that hour
Buckets are computed by grouping traces on their created_at field formatted to HH:00. Traces older than 24 hours are excluded from the chart data.
Breakdowns
The analytics endpoint returns four breakdown dimensions:
| Breakdown | Key Used | Example |
|---|---|---|
| Status breakdown | trace.status | success: 42, failed: 3, warning: 5 |
| Model breakdown | trace.model_name or unknown | gpt-4o: 20, gpt-4.1-mini: 30 |
| Project breakdown | trace.project_name or project_id | default: 40, search-service: 10 |
Info
Recent Failures
The analytics view also surfaces the five most recent traces that have issues — failed traces, warning traces, slow requests, or traces with retries. This provides a quick overview of system health without navigating to the Failures view.