Add Prometheus exporter for DBLab metrics

Summary

Add a Prometheus exporter to expose DBLab Engine metrics for monitoring.

Metrics to expose

  • Free disk space
  • Number of clones, snapshots, branches
  • Max age of clones
  • Max age of snapshots
  • Max diff for snapshots (physical mode)
  • Non-busy disk slots (datasets) in logical mode
  • CPU load and RAM usage per clone
  • Disk usage (extra) per snapshot
  • Disk usage (extra) per clone

Benefits

  • Enable integration with Prometheus-based monitoring systems
  • Support alerting on key metrics (disk space, clone count, data freshness)
  • Provide visibility into resource usage per clone

Acceptance Criteria

  • A Prometheus exporter endpoint (e.g., /metrics) is exposed by the DBLab Engine serving metrics in Prometheus text format
  • All specified metrics are exported: free disk space, clone count, snapshot count, branch count, max clone age, max snapshot age, max snapshot diff, non-busy disk slots, CPU/RAM per clone, disk usage per snapshot and per clone
  • Metrics are labeled with appropriate dimensions (clone ID, snapshot ID, etc.) for filtering and aggregation
  • The exporter works alongside the existing DBLab API without port conflicts
  • Prometheus can scrape the endpoint and visualize metrics in Grafana

Definition of Done

  • Prometheus exporter implemented and merged
  • All listed metrics emit correct values verified against DBLab API responses
  • Grafana dashboard template created for DBLab metrics visualization
  • Documentation updated with Prometheus scrape configuration examples
  • Tested with a real Prometheus instance scraping metrics over a sustained period
Edited by Nikolay Samokhvalov