Database Metrics
Monitor resource usage, connections, and performance in real-time.
Current Metrics
Get the latest snapshot of database metrics:
curl -X GET https://api.lordbase.com/e/v1/developer/databases/{database_id}/metrics/ \
-H "Authorization: Bearer lb_pat_your_token"
Response:
{
"timestamp": "2026-01-15T12:00:00Z",
"storage_used_mb": 128,
"active_connections": 5,
"transactions_total": 150432,
"cache_hit_ratio": 0.987,
"tuples_returned": 982341,
"tuples_inserted": 45210,
"tuples_updated": 12340,
"tuples_deleted": 1230
}
Available Metrics
| Metric | Description |
|---|---|
storage_used_mb | Current disk usage in megabytes |
active_connections | Number of active database connections |
transactions_total | Total transactions since last reset |
cache_hit_ratio | Percentage of queries served from cache (target: > 0.95) |
tuples_returned | Total rows returned by queries |
tuples_inserted | Total rows inserted |
tuples_updated | Total rows updated |
tuples_deleted | Total rows deleted |
Historical Metrics
View metrics over time for trend analysis:
curl -X GET "https://api.lordbase.com/e/v1/developer/databases/{database_id}/metrics/history/?hours=24" \
-H "Authorization: Bearer lb_pat_your_token"
Health Check
Quick health check for a specific database:
curl -X GET https://api.lordbase.com/e/v1/developer/databases/{database_id}/health/ \
-H "Authorization: Bearer lb_pat_your_token"
Response:
{
"status": "healthy",
"connection": true,
"accepting_connections": true,
"message": "Database is responding normally"
}
Key Indicators
| Indicator | Healthy | Warning |
|---|---|---|
| Cache Hit Ratio | > 95% | < 90% |
| Active Connections | < 80% of max | Near max limit |
| Storage Usage | < 80% of quota | Near limit |
Next Steps
- Query Analytics — Identify slow and expensive queries
- Audit Logs — Review user activity