{"id":51317640,"url":"https://github.com/f18m/prometheus-snapshot-manager","last_synced_at":"2026-07-01T09:02:11.815Z","repository":{"id":365568156,"uuid":"1272722032","full_name":"f18m/prometheus-snapshot-manager","owner":"f18m","description":"A no-frills, no-UI plain simple Prometheus snapshot manager for reliable, fire-and-forget scheduled backups","archived":false,"fork":false,"pushed_at":"2026-06-17T22:06:35.000Z","size":28,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T00:07:34.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f18m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-17T21:57:51.000Z","updated_at":"2026-06-17T21:57:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/f18m/prometheus-snapshot-manager","commit_stats":null,"previous_names":["f18m/prometheus-snapshot-manager"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/f18m/prometheus-snapshot-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Fprometheus-snapshot-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Fprometheus-snapshot-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Fprometheus-snapshot-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Fprometheus-snapshot-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f18m","download_url":"https://codeload.github.com/f18m/prometheus-snapshot-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Fprometheus-snapshot-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34999792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-01T09:02:11.083Z","updated_at":"2026-07-01T09:02:11.810Z","avatar_url":"https://github.com/f18m.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus-snapshot-manager\n\n[![CI](https://github.com/f18m/prometheus-snapshot-manager/actions/workflows/ci.yaml/badge.svg)](https://github.com/f18m/prometheus-snapshot-manager/actions/workflows/ci.yaml)\n[![Release](https://img.shields.io/github/v/release/f18m/prometheus-snapshot-manager)](https://github.com/f18m/prometheus-snapshot-manager/releases)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/f18m/prometheus-snapshot-manager)](./go.mod)\n[![License](https://img.shields.io/github/license/f18m/prometheus-snapshot-manager)](./LICENSE)\n\nA production-ready headless daemon/CLI that periodically triggers Prometheus TSDB snapshots, archives them as `tar.gz`, uploads to one or more backup targets (local/SFTP/S3-compatible), applies retention pruning, and sends success/failure notifications through Apprise.\n\n## Comparison with prombackup\n\n`prombackup` focuses on exposing backup content and workflows through an HTTP interface. `prometheus-snapshot-manager` is intentionally upload-centric and scheduler-driven: no web server, no UI, no download endpoint—just snapshot, archive, upload, prune, notify.\n\n## Quick start\n\nUse the included `docker-compose.example.yml`, or this minimal snippet:\n\n```yaml\nservices:\n  prometheus-snapshot-manager:\n    image: ghcr.io/f18m/prometheus-snapshot-manager:latest\n    volumes:\n      - prometheus_data:/prometheus:ro\n      - ./config.yaml:/etc/prometheus-snapshot-manager/config.yaml:ro\n      - /backup/prometheus:/backup/prometheus\n    command: [\"run\"]\n```\n\n## Configuration reference\n\n| Field | Type | Default | Description |\n|---|---|---|---|\n| `prometheus.url` | string | - | Prometheus base URL |\n| `prometheus.timeout` | duration | `30s` | API and wait timeout |\n| `prometheus.snapshot_dir` | string | - | Filesystem snapshot root |\n| `prometheus.snapshot_archive_temp_dir` | string | `/prometheus/snapshots-mgr-temp` | Temporary directory used to build archive files before upload |\n| `prometheus.tls_skip_verify` | bool | `false` | Skip TLS verification |\n| `prometheus.basic_auth.username` | string | `\"\"` | Optional basic auth username |\n| `prometheus.basic_auth.password` | string | `\"\"` | Optional basic auth password |\n| `schedule.cron` | string | empty | Cron expression (supports seconds) |\n| `schedule.interval` | duration | empty | Alternative fixed interval |\n| `schedule.timezone` | string | `UTC` | Scheduler timezone |\n| `schedule.run_on_startup` | bool | `false` | Run once at startup |\n| `compression.format` | string | `tar.gz` | Archive format (v1 only) |\n| `compression.level` | int | `6` | Gzip level `1-9` |\n| `retention.keep_within` | duration | empty | Keep files newer than now-duration |\n| `retention.keep_minimum` | int | `0` | Always keep newest N |\n| `retention.keep_maximum` | int | `0` | Keep at most N after all rules |\n| `retention.keep_daily` | int | `0` | Keep latest snapshot/day for N days |\n| `retention.keep_weekly` | int | `0` | Keep latest snapshot/week for N ISO weeks |\n| `retention.keep_monthly` | int | `0` | Keep latest snapshot/month for N months |\n| `retention.cleanup_prometheus_snapshots` | bool | `false` | Remove raw snapshot dir after success |\n| `targets[].name` | string | - | Target name |\n| `targets[].type` | string | - | One of `local`, `sftp`, `s3` |\n| `targets[].local.path` | string | - | Local directory path |\n| `targets[].sftp.*` | object | - | SFTP connection/auth options |\n| `targets[].s3.*` | object | - | S3 bucket/credentials/options |\n| `notifications.apprise.enabled` | bool | `false` | Enable notifications |\n| `notifications.apprise.config_file` | string | empty | Apprise config path |\n| `notifications.apprise.urls[]` | list | empty | Inline Apprise URLs |\n| `notifications.apprise.on_success` | bool | `true` | Notify on success |\n| `notifications.apprise.on_failure` | bool | `true` | Notify on failure |\n| `notifications.apprise.title_template` | string | built-in | Go template for title |\n| `notifications.apprise.body_template` | string | built-in | Go template for body |\n| `logging.level` | string | `info` | `debug/info/warn/error` |\n| `logging.format` | string | `json` | `json` or `text` |\n| `logging.output` | string | `stdout` | `stdout` or file path |\n\nMore detailed documentation for the configuration in the form\nof YAML comments in [config.docs.yaml](./config.docs.yaml)\n\n## Secret management\n\nAny secret field can use:\n- `${ENV_VAR_NAME}` to read from environment\n- `file:/path/to/secret` to read from file and trim whitespace\n\n## Retention policy\n\nArchive naming format:\n\n```text\nprom-snapshot_\u003cRFC3339-UTC-timestamp\u003e_\u003crandom-6-chars\u003e.tar.gz\n```\n\nRules are applied in order and a snapshot is kept if any keep rule matches:\n1. `keep_within`\n2. `keep_minimum`\n3. `keep_daily`\n4. `keep_weekly`\n5. `keep_monthly`\n6. `keep_maximum` cap after all keeps\n\n## Notification setup\n\nNotifications use the Apprise CLI. See https://github.com/caronc/apprise for URL formats and advanced config.\n\nMinimal example:\n\n```yaml\nnotifications:\n  apprise:\n    enabled: true\n    urls:\n      - \"tgram://bottoken/chatid\"\n```\n\n## Building from source\n\n```bash\ngo mod tidy\ngo vet ./...\ngo test ./...\ngo build ./cmd/prometheus-snapshot-manager\n```\n\nOr using [Just](https://github.com/casey/just):\n\n```bash\njust build\n```\n\n## Contributing\n\nIssues and PRs are welcome. Please include tests for behavior changes, keep changes focused, and ensure `go vet`, `go test`, and `go build` all pass.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff18m%2Fprometheus-snapshot-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff18m%2Fprometheus-snapshot-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff18m%2Fprometheus-snapshot-manager/lists"}