Skip to content

Monitoring & Alerting ​

OsuRender API exports comprehensive Prometheus metrics and ships with pre-configured alert rules.

Metrics Inventory ​

Queue Metrics ​

MetricTypeLabelsDescription
queue_depthGaugestatusCurrent jobs in each state (queued, rendering, downloading)
outbox_pending_eventsGauge—Pending events awaiting dispatch
outbox_dispatched_eventsGauge—Events dispatched, awaiting worker confirmation
outbox_failed_eventsGauge—Failed events (Dead Letter Queue)

Render Metrics ​

MetricTypeLabelsDescription
render_duration_secondsHistogram—End-to-end render time. Buckets: 30s, 60s, 120s, 180s, 300s, 600s
render_failures_totalCounterreasonFailures by phase (init, download, osu_api, render)
active_render_workersGauge—Currently active workers
jobs_completed_totalCounter—Successfully completed jobs
jobs_failed_totalCounter—Failed jobs
zombie_jobs_reaped_totalCounter—Jobs recovered by zombie reaper

Dispatch Metrics ​

MetricTypeLabelsDescription
outbox_dispatch_totalCounter—Events dispatched to Celery
dispatch_latency_secondsHistogram—Time from event creation to dispatch
listener_reconnects_totalCounterreasonDispatcher reconnections
stuck_processing_events_totalCounter—Events rescued by sweeper

API Metrics ​

MetricTypeLabelsDescription
job_submit_totalCounter—Jobs accepted by the API
webhook_failures_totalCounterreasonWebhook auth failures
rate_limit_violations_totalCounter—Rate limit hits
upload_validation_failures_totalCountertypeUpload validation failures

Storage Metrics ​

MetricTypeLabelsDescription
storage_operation_duration_secondsHistogramoperationStorage operation latency
storage_failures_totalCounteroperationStorage operation failures

HTTP Metrics (auto-instrumented) ​

The prometheus-fastapi-instrumentator automatically exports standard HTTP metrics:

  • http_requests_total
  • http_request_duration_seconds
  • http_request_size_bytes
  • http_response_size_bytes

Alert Rules ​

Alerts are defined in monitoring/alerts.yml:

Critical Alerts ​

AlertConditionDuration
QueueDepthCriticalQueued jobs > 902 min
NoActiveWorkersNo workers + queue > 05 min
SLOApiAvailabilityBreachAPI availability < 99.9%15 min

Warning Alerts ​

AlertConditionDuration
QueueDepthHighQueued jobs > 505 min
OutboxPendingHighPending events > 105 min
HighRenderFailureRateFailures > 0.5/sec5 min
RenderDurationHighP95 > 300s10 min
HighErrorRate5xx rate > 5%5 min
HighLatencyP95 latency > 5s5 min
StorageFailuresAny storage failures5 min
DeadLetterQueueGrowingFailed events > 015 min

Accessing Metrics ​

bash
# Raw Prometheus endpoint
curl http://localhost:8727/metrics

# Prometheus UI
open http://localhost:9090

# Grafana dashboards
open http://localhost:3727  # Default: admin/admin

SLO Recording Rules ​

yaml
# API availability (target: 99.9%)
osurender:api_availability:ratio_5m

# Render success rate
osurender:render_success_rate:ratio_5m

Live Dashboard ​

Since browser security policies prevent embedding the live dashboard directly in the documentation, you can view the real-time production metrics by opening the public dashboard directly:

Open Live Grafana Dashboard ↗

Built with VitePress