Prometheus Metrics Catalog & PromQL Reference
RUSEON Core exposes standard Prometheus metrics at GET /metrics for ingestion by Prometheus, VictoriaMetrics, and Grafana.
1. Official Metrics Catalog Table
The following 12 metrics are defined in pkg/metrics/metrics.go:
| Metric Name | Type | Labels | Description |
|---|---|---|---|
ruseon_active_streams | Gauge | camera_id | Number of currently active camera streams (1 = active, 0 = inactive) |
ruseon_stream_reconnects_total | Counter | camera_id | Total number of stream reconnection attempts |
ruseon_frames_received_total | Counter | camera_id | Total number of video frames received from camera |
ruseon_key_frames_total | Counter | camera_id | Total number of KeyFrames (I-frames) received |
ruseon_network_receive_bytes_total | Counter | camera_id | Total network payload bytes received from RTSP source |
ruseon_disk_write_bytes_total | Counter | camera_id | Total bytes written to persistent fMP4 disk storage |
ruseon_archive_segments_written_total | Counter | camera_id | Total completed hourly archive segments written |
ruseon_archive_errors_total | Counter | camera_id | Total archive write and filesystem errors |
ruseon_ringbuffer_drops_total | Counter | camera_id | Total video frames dropped due to buffer overflow |
ruseon_eventbus_drops_total | Counter | (none) | Total events dropped due to full worker queues |
ruseon_webrtc_peers_active | Gauge | camera_id | Number of active WebRTC peer connections per stream |
ruseon_hls_requests_total | Counter | camera_id | Total HLS playlist and segment requests served |
2. Essential PromQL Alert Queries
promql
# Alert: Camera Ingest Lost (Stream Offline)
ruseon_active_streams == 0
# Alert: Ingest Reconnect Flapping (> 5 reconnects in 5m)
increase(ruseon_stream_reconnects_total[5m]) > 5
# Alert: RingBuffer Frame Drops (Slow Consumer or Network Bottleneck)
rate(ruseon_ringbuffer_drops_total[5m]) > 0
# Alert: Disk Archive Write Failures
increase(ruseon_archive_errors_total[5m]) > 0
# Alert: High Ingress Bitrate (Mbps per camera)
rate(ruseon_network_receive_bytes_total[1m]) * 8 / 1000000