Observability
Full visibility into every AI request with traces, sessions, and analytics dashboards.
Observability
Bastio provides complete observability for your AI stack. Every request is captured as a trace, conversations are grouped into sessions, and analytics dashboards show you patterns across your usage.
Observability features are available on all plans with different retention limits. See the pricing table below for details.
Traces
Every request that flows through Bastio is captured as a trace with full context.
What Gets Captured
Each trace includes:
| Field | Description |
|---|---|
| Trace ID | Unique identifier (e.g., tr_7kL9mN2pQr) |
| Status | success, error, blocked, or cached |
| Latency | Request duration in milliseconds |
| Input Tokens | Number of tokens in the request |
| Output Tokens | Number of tokens in the response |
| Cost | Actual cost in USD based on model pricing |
| Session ID | Which session this trace belongs to |
| Model | Which model was used |
| Security | Threats detected, risk score, block status |
Example Trace
{
"trace_id": "tr_7kL9mN2pQr",
"status": "success",
"latency_ms": 847,
"tokens": {
"input": 1234,
"output": 567
},
"cost_usd": 0.0023,
"session_id": "sess_abc123",
"model": "gpt-4o",
"security": {
"risk_score": 0.1,
"threats": [],
"blocked": false
},
"created_at": "2025-01-13T10:30:00Z"
}Viewing Traces
Access traces in your dashboard under Observe > Traces:
- Real-time updates: Dashboard polls every 5 seconds for new traces
- Filtering: Filter by status, model, time range, or session
- Search: Find specific traces by ID
- Export: Download traces as CSV for external analysis
Sessions
Sessions group related requests into conversations for easier analysis.
How Sessions Work
Bastio supports two methods for session management:
1. Auto-Sessions (Default)
- Requests grouped by
end_user_idor device fingerprint - 30-minute inactivity timeout creates new session
- Zero configuration required
2. Explicit Sessions
- Pass
X-Session-IDheader to group requests - Same session ID always groups together regardless of timing
- Perfect for multi-turn conversations
For detailed session configuration and code examples, see the Sessions documentation.
Session View
Click into any session to see:
- Timeline: All traces in chronological order
- Metrics: Total tokens, cost, and average latency
- Duration: Time from first to last request
- Security Events: Any threats or blocks during the session
Analytics Dashboard
The analytics dashboard shows trends and patterns across your usage.
Available Charts
- Request Volume: Requests per hour, day, or week
- Cost Breakdown: Spending by model and over time
- Latency Distribution: P50, P95, P99 response times
- Security Metrics: Threats detected, requests blocked, average risk scores
- Session Statistics: Average session length, turns per session
Time Ranges
Select from different time windows based on your plan:
| Plan | Analytics History |
|---|---|
| Free | 7 days |
| Starter | 30 days |
| Professional | 90 days |
| Enterprise | Unlimited |
CSV Export
Export any chart data to CSV for:
- External reporting tools
- Custom analysis
- Compliance documentation
- Cost allocation
CSV export is available on Starter plans and above.
Evaluation
Run quality tests on your AI outputs to measure performance.
What You Can Test
- Accuracy: Does the response answer the question correctly?
- Relevance: Is the response on-topic?
- Safety: Does the response avoid harmful content?
- Custom Metrics: Define your own scoring criteria
Running Evaluations
- Select sessions or individual traces to evaluate
- Choose evaluation criteria
- Run automated scoring
- Review results and trends over time
Evaluation helps you:
- Compare model performance on similar inputs
- Track quality metrics over time
- Identify problematic responses for review
- Build confidence in your AI outputs
Pricing and Limits
Observability features are included in all plans:
| Feature | Free | Starter | Pro | Enterprise |
|---|---|---|---|---|
| Trace Retention | 24 hours | 7 days | 30 days | 90 days |
| Session Retention | 24 hours | 7 days | 30 days | 90 days |
| Analytics History | 7 days | 30 days | 90 days | Unlimited |
| CSV Export | No | Yes | Yes | Yes |
| Real-time Updates | Yes | Yes | Yes | Yes |
| Evaluation Tools | Basic | Full | Full | Full |
Next Steps
- Sessions Documentation - Detailed session configuration and code examples
- API Reference - Programmatic access to traces and analytics
- Security Features - Understanding threat detection in traces