Usage & Metrics
Query job statistics and Prometheus metrics for your organization.
Usage Stats
Returns aggregate job counts and success metrics for the authenticated organization.
GET /usage
Authorization: Bearer <token>Response 200
{
"total": 1240,
"pending": 12,
"processing": 3,
"done": 1200,
"failed": 25,
"success_rate": 97.97,
"jobs_today": 87,
"jobs_week": 540
}| Field | Description |
|---|---|
total | All jobs ever created in this org |
pending | Jobs waiting in the queue |
processing | Jobs currently being executed |
done | Successfully completed jobs |
failed | Jobs that exhausted all retries |
success_rate | done / (done + failed) * 100 |
jobs_today | Jobs created in the last 24 hours |
jobs_week | Jobs created in the last 7 days |
Prometheus Metrics
GET /metricsNo authentication required. Exposes standard Prometheus text format.
Key Metrics
| Metric | Type | Description |
|---|---|---|
jobs_pushed_total | Counter | Total jobs received by the API |
jobs_processed_total | Counter | Total jobs completed by the worker |
jobs_failed_total | Counter | Total jobs that exhausted retries |
job_processing_duration_seconds | Histogram | Worker execution time per job |
Example Scrape Config
scrape_configs:
- job_name: savannah_cloud
static_configs:
- targets: ['localhost:8080']Health Check
GET /healthResponse 200
{ "status": "ok", "postgres": "ok", "redis": "ok" }Use this endpoint for load balancer health checks and uptime monitoring. Returns 500 if postgres or redis is unreachable.
Quick Reference
# Usage stats
curl http://localhost:8080/usage \
-H "Authorization: Bearer YOUR_JWT"
# Prometheus metrics
curl http://localhost:8080/metrics
# Health check
curl http://localhost:8080/health