Skip to content

feat: add Prometheus and StatsD metrics support#1316

Open
kneemaa wants to merge 1 commit intoicloud-photos-downloader:masterfrom
kneemaa:feature/prometheus-statsd-metrics
Open

feat: add Prometheus and StatsD metrics support#1316
kneemaa wants to merge 1 commit intoicloud-photos-downloader:masterfrom
kneemaa:feature/prometheus-statsd-metrics

Conversation

@kneemaa
Copy link

@kneemaa kneemaa commented Feb 4, 2026

As I run icloudpd to continuously backup for myself and family accounts, I wanted a way to monitor and or alert if the runs began to fail. Auth failure metrics could be a work-around to using smtp if you have a method to alert on prometheus metrics.

Potentially relates to #1072 and #183

Add observability support with two metrics backends:

  • Prometheus: HTTP server exposing /metrics endpoint
  • StatsD: UDP push to StatsD-compatible servers

Metrics tracked:

  • Download operations (count, bytes, duration, retries)
  • Photos and videos processed (separate counters)
  • Sync runs (count, duration, status)
  • API requests (count, duration, errors)
  • Authentication attempts and MFA requests

New CLI options:

  • --metrics-backend (none|prometheus|statsd|both)
  • --prometheus-host, --prometheus-port
  • --statsd-host, --statsd-port, --statsd-prefix
  • --metrics-instance (for multi-instance deployments)

Also includes:

  • Documentation with configuration examples
  • Example Grafana dashboard
  • Dockerfile exposes port 9090 for Prometheus

Dashboard Example -
Screenshot 2026-02-04 at 12 08 22 AM

Add observability support with two metrics backends:
- Prometheus: HTTP server exposing /metrics endpoint
- StatsD: UDP push to StatsD-compatible servers

Metrics tracked:
- Download operations (count, bytes, duration, retries)
- Photos and videos processed (separate counters)
- Sync runs (count, duration, status)
- API requests (count, duration, errors)
- Authentication attempts and MFA requests

New CLI options:
- --metrics-backend (none|prometheus|statsd|both)
- --prometheus-host, --prometheus-port
- --statsd-host, --statsd-port, --statsd-prefix
- --metrics-instance (for multi-instance deployments)

Also includes:
- Documentation with configuration examples
- Example Grafana dashboard
- Dockerfile exposes port 9090 for Prometheus
@kneemaa kneemaa force-pushed the feature/prometheus-statsd-metrics branch from 61dd0b6 to e34f8a0 Compare February 4, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant