Savannah Cloud

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
}
FieldDescription
totalAll jobs ever created in this org
pendingJobs waiting in the queue
processingJobs currently being executed
doneSuccessfully completed jobs
failedJobs that exhausted all retries
success_ratedone / (done + failed) * 100
jobs_todayJobs created in the last 24 hours
jobs_weekJobs created in the last 7 days

Prometheus Metrics

GET /metrics

No authentication required. Exposes standard Prometheus text format.

Key Metrics

MetricTypeDescription
jobs_pushed_totalCounterTotal jobs received by the API
jobs_processed_totalCounterTotal jobs completed by the worker
jobs_failed_totalCounterTotal jobs that exhausted retries
job_processing_duration_secondsHistogramWorker execution time per job

Example Scrape Config

scrape_configs:
  - job_name: savannah_cloud
    static_configs:
      - targets: ['localhost:8080']

Health Check

GET /health

Response 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

On this page