Provider Health
Provider Health monitors the reliability and performance of each AI provider you use. Track success rates, error counts, rate limit hits, and average latency — all in one place.
Access
Navigate to /ai-orbit/usage/health.
Health Metrics
For each provider, Orbit displays:
| Metric | Description | Healthy Threshold |
|---|---|---|
| Total Requests | Number of API calls in the period | N/A |
| Success Rate | Percentage of requests without errors | >= 95% |
| Error Count | Total failed requests | 0 ideal |
| Rate Limit Count | 429 / rate limit errors | 0 ideal |
| Avg Latency | Mean response time in milliseconds | < 2000ms |
| Status | Overall health badge | Healthy / Degraded / Unhealthy |
Status Levels
| Status | Success Rate | Color |
|---|---|---|
| Healthy | >= 95% | Green |
| Degraded | 80% – 94% | Yellow |
| Unhealthy | < 80% | Red |
Time Periods
Switch between analysis windows:
- Last 24 Hours — Immediate issue detection
- Last 7 Days — Weekly trend analysis
- Last 30 Days — Monthly reliability review
How It Works
Data Source
Provider Health reads from the agent_conversation_messages table, extracting provider information from the meta JSON column:
{
"provider": "openai",
"model": "gpt-4",
"latency_ms": 1240,
"error": null
}Error Detection
Errors are detected by:
- Messages with
role = 'tool'(tool execution failures) - Messages where
meta.erroris not null - Rate limits detected via error message patterns (
rate limit,429,too many)
Latency Calculation
Average latency is calculated from the meta.latency_ms field:
AVG(JSON_EXTRACT(meta, '$.latency_ms'))If latency data is not available, it shows as 0.
Provider Extraction
The provider name is extracted from metadata:
REPLACE(JSON_EXTRACT(meta, '$.provider'), '"', '')Programmatic Access
use Ashrafic\AiOrbit\Services\ProviderHealthChecker;
$checker = app(ProviderHealthChecker::class);
// Get health metrics for the last 7 days
$metrics = $checker->getHealthMetrics('7d');
foreach ($metrics as $metric) {
$metric['provider']; // 'openai'
$metric['total_requests']; // 1523
$metric['success_rate']; // 98.5
$metric['error_count']; // 23
$metric['rate_limit_count'];// 2
$metric['avg_latency_ms']; // 1240.50
$metric['status']; // 'healthy'
}Use Cases
Provider Downtime Detection
Check the 24-hour view to see if a provider is currently experiencing issues. Switch to an alternative provider if success rates drop.
Latency Comparison
Compare average latency across providers to identify the fastest option for your use case.
Rate Limit Monitoring
If rate limit counts are high, consider implementing request throttling or upgrading your provider plan.
Historical Reliability
Use the 30-day view to choose a primary provider based on long-term reliability rather than short-term performance.
Alert Integration
Combine Provider Health with Budget Alerts — if error rates spike, your costs may also spike due to retries.
Notifications
Orbit includes a ProviderDown notification that can be integrated into your monitoring:
use Ashrafic\AiOrbit\Notifications\ProviderDown;
// Send notification when a provider's error rate exceeds a threshold
$errorRate = 15.0; // 15%
Notification::route('mail', config('mail.from.address'))
->notify(new ProviderDown('openai', $errorRate));The email includes:
- Provider name
- Current error rate
- A link to the Provider Health page
Customization
Override the provider health view:
php artisan vendor:publish --tag=ai-orbit-viewsThen edit resources/views/vendor/laravel-ai-orbit/livewire/provider-health.blade.php.
Best Practices
- Check daily — Review the 24-hour view each morning
- Set up alerts — Integrate
ProviderDownnotifications with your monitoring stack - Track trends — Use the 7-day and 30-day views to identify degrading providers
- Compare providers — Use latency and success rate to choose the best provider for each agent
- Investigate rate limits — High rate limit counts indicate you need throttling or a plan upgrade