[GH-ISSUE #166] Add Prometheus Metrics #133

Open
opened 2026-02-26 21:34:34 +03:00 by kerem · 0 comments
Owner

Originally created by @JE4GLE on GitHub (Jan 16, 2026).
Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/166

Introduce Prometheus metrics support in pgbackweb to enable monitoring of key service performance and health metrics (backup counts, durations, errors, database connection stats, queue status, etc.).

Currently pgbackweb provides backup scheduling and monitoring via UI but no native Prometheus metrics endpoint exists. With this enhancement, the app should expose a /metrics HTTP endpoint that Prometheus can scrape. 

Goals

  • Expose a Prometheus-compatible /metrics endpoint.
  • Publish useful metrics such as:
    • total backups executed
    • backup success/failure counts
    • last backup duration
    • backup queue length
    • DB connection status
    • health check results
  • Use Prometheus client library in Go for instrumentation.
  • Provide example Prometheus scrape config and optional Grafana dashboards.

Acceptance Criteria

  • /metrics endpoint returns valid Prometheus format metrics.
  • Metrics cover at minimum backup operations and health.
  • Configurable listen address and path via env vars.
  • Updated README with instructions for enabling metrics and Prometheus scrape config.
  • Tests verifying metrics exposure.

Technical Notes

  • Use the official Prometheus Go client (github.com/prometheus/client_golang/prometheus).
  • Register custom counters/gauges for backup lifecycle events.
  • Ensure metrics don’t adversely impact performance.
Originally created by @JE4GLE on GitHub (Jan 16, 2026). Original GitHub issue: https://github.com/eduardolat/pgbackweb/issues/166 Introduce Prometheus metrics support in pgbackweb to enable monitoring of key service performance and health metrics (backup counts, durations, errors, database connection stats, queue status, etc.). Currently pgbackweb provides backup scheduling and monitoring via UI but no native Prometheus metrics endpoint exists. With this enhancement, the app should expose a /metrics HTTP endpoint that Prometheus can scrape.  ### Goals - Expose a Prometheus-compatible /metrics endpoint. - Publish useful metrics such as: - total backups executed - backup success/failure counts - last backup duration - backup queue length - DB connection status - health check results - Use Prometheus client library in Go for instrumentation. - Provide example Prometheus scrape config and optional Grafana dashboards. ### Acceptance Criteria - /metrics endpoint returns valid Prometheus format metrics. - Metrics cover at minimum backup operations and health. - Configurable listen address and path via env vars. - Updated README with instructions for enabling metrics and Prometheus scrape config. - Tests verifying metrics exposure. ### Technical Notes - Use the official Prometheus Go client (github.com/prometheus/client_golang/prometheus). - Register custom counters/gauges for backup lifecycle events. - Ensure metrics don’t adversely impact performance.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pgbackweb#133
No description provided.