Skip to content

[Phase 7.1] Add Prometheus metrics for monitoring #21

@zhexuany

Description

@zhexuany

Summary

Implement Prometheus metrics for monitoring conversion throughput, error rates, and resource utilization.

Parent Epic

Dependencies

Tasks

7.1.1 Add Metrics Infrastructure

  1. Add prometheus crate to dependencies
  2. Create src/metrics/mod.rs
  3. Define static metric registry
  4. Create metrics initialization function
  5. Feature-gate under metrics flag (optional)

7.1.2 Define Conversion Metrics

  1. roboflow_episodes_processed_total - Counter with labels: dataset_id, status
  2. roboflow_episode_processing_duration_seconds - Histogram
  3. roboflow_frames_processed_total - Counter
  4. roboflow_bytes_read_total - Counter with source label
  5. roboflow_bytes_written_total - Counter with destination, type labels

7.1.3 Define Upload Metrics

  1. roboflow_upload_duration_seconds - Histogram with file_type label
  2. roboflow_upload_retries_total - Counter with reason label
  3. roboflow_upload_bytes_total - Counter
  4. roboflow_pending_uploads - Gauge

7.1.4 Define Resource Metrics

  1. roboflow_buffer_usage_bytes - Gauge
  2. roboflow_cache_hit_total - Counter
  3. roboflow_cache_miss_total - Counter
  4. roboflow_active_conversions - Gauge

7.1.5 Define Video Encoding Metrics

  1. roboflow_video_encoding_duration_seconds - Histogram
  2. roboflow_video_frames_encoded_total - Counter with camera label

7.1.6 Instrument Code

  1. Add metrics to conversion loop
  2. Add metrics to storage operations
  3. Add metrics to upload coordinator
  4. Add metrics to video encoder

7.1.7 Create Metrics Endpoint

  1. Add axum dependency for HTTP server
  2. Create /metrics endpoint
  3. Create /health endpoint
  4. Start metrics server in background

Acceptance Criteria

  • All metrics defined and registered
  • Conversion code instrumented
  • Storage code instrumented
  • Metrics endpoint serves Prometheus format
  • Health endpoint works
  • All tests pass

Files to Create

  • src/metrics/mod.rs
  • src/metrics/conversion.rs
  • src/metrics/storage.rs
  • src/metrics/server.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions