Summary
Implement Prometheus metrics for monitoring conversion throughput, error rates, and resource utilization.
Parent Epic
Dependencies
Tasks
7.1.1 Add Metrics Infrastructure
- Add
prometheus crate to dependencies
- Create
src/metrics/mod.rs
- Define static metric registry
- Create metrics initialization function
- Feature-gate under
metrics flag (optional)
7.1.2 Define Conversion Metrics
roboflow_episodes_processed_total - Counter with labels: dataset_id, status
roboflow_episode_processing_duration_seconds - Histogram
roboflow_frames_processed_total - Counter
roboflow_bytes_read_total - Counter with source label
roboflow_bytes_written_total - Counter with destination, type labels
7.1.3 Define Upload Metrics
roboflow_upload_duration_seconds - Histogram with file_type label
roboflow_upload_retries_total - Counter with reason label
roboflow_upload_bytes_total - Counter
roboflow_pending_uploads - Gauge
7.1.4 Define Resource Metrics
roboflow_buffer_usage_bytes - Gauge
roboflow_cache_hit_total - Counter
roboflow_cache_miss_total - Counter
roboflow_active_conversions - Gauge
7.1.5 Define Video Encoding Metrics
roboflow_video_encoding_duration_seconds - Histogram
roboflow_video_frames_encoded_total - Counter with camera label
7.1.6 Instrument Code
- Add metrics to conversion loop
- Add metrics to storage operations
- Add metrics to upload coordinator
- Add metrics to video encoder
7.1.7 Create Metrics Endpoint
- Add
axum dependency for HTTP server
- Create
/metrics endpoint
- Create
/health endpoint
- Start metrics server in background
Acceptance Criteria
Files to Create
src/metrics/mod.rs
src/metrics/conversion.rs
src/metrics/storage.rs
src/metrics/server.rs
Summary
Implement Prometheus metrics for monitoring conversion throughput, error rates, and resource utilization.
Parent Epic
Dependencies
Tasks
7.1.1 Add Metrics Infrastructure
prometheuscrate to dependenciessrc/metrics/mod.rsmetricsflag (optional)7.1.2 Define Conversion Metrics
roboflow_episodes_processed_total- Counter with labels: dataset_id, statusroboflow_episode_processing_duration_seconds- Histogramroboflow_frames_processed_total- Counterroboflow_bytes_read_total- Counter with source labelroboflow_bytes_written_total- Counter with destination, type labels7.1.3 Define Upload Metrics
roboflow_upload_duration_seconds- Histogram with file_type labelroboflow_upload_retries_total- Counter with reason labelroboflow_upload_bytes_total- Counterroboflow_pending_uploads- Gauge7.1.4 Define Resource Metrics
roboflow_buffer_usage_bytes- Gaugeroboflow_cache_hit_total- Counterroboflow_cache_miss_total- Counterroboflow_active_conversions- Gauge7.1.5 Define Video Encoding Metrics
roboflow_video_encoding_duration_seconds- Histogramroboflow_video_frames_encoded_total- Counter with camera label7.1.6 Instrument Code
7.1.7 Create Metrics Endpoint
axumdependency for HTTP server/metricsendpoint/healthendpointAcceptance Criteria
Files to Create
src/metrics/mod.rssrc/metrics/conversion.rssrc/metrics/storage.rssrc/metrics/server.rs