{"id":20770871,"url":"https://github.com/codemonauts/dbbackup-textfileexporter","last_synced_at":"2025-12-16T10:35:35.311Z","repository":{"id":82653751,"uuid":"305402819","full_name":"codemonauts/dbbackup-textfileexporter","owner":"codemonauts","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-19T14:02:09.000Z","size":1,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-18T07:12:04.434Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codemonauts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-10-19T14:00:09.000Z","updated_at":"2023-12-11T02:50:53.000Z","dependencies_parsed_at":"2023-03-14T23:01:30.696Z","dependency_job_id":null,"html_url":"https://github.com/codemonauts/dbbackup-textfileexporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonauts%2Fdbbackup-textfileexporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonauts%2Fdbbackup-textfileexporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonauts%2Fdbbackup-textfileexporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonauts%2Fdbbackup-textfileexporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonauts","download_url":"https://codeload.github.com/codemonauts/dbbackup-textfileexporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104204,"owners_count":20236943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-17T12:12:36.787Z","updated_at":"2025-12-16T10:35:35.280Z","avatar_url":"https://github.com/codemonauts.png","language":"Python","readme":"# dbbackup-textfileexporter\n\nExport metrics about your local database backups to Prometheus.\n\n# Requirements \u0026 Assumptions\n 1) This scripts needs Python \u003e= 3.6 without any additional librarys\n 2) All backup files need to be written to one folder\n 3) All filenames must match the pattern `\u003cdatabase name\u003e-YYYY-MM-DD.\u003cfile extension\u003e`\n\n\n# Usage\nChange the path where your backup files are create in the top part of the script (`BACKUP_DIR`).\n\nThe metrics get written to stdout so you can pipe the ouput into a file which gets then served by the node-exporter\n```\ndbbackup_exporter.py \u003e /var/lib/prometheus/node-exporter/databases.prom\n```\n\n\n# Example metric\n\n```\n# HELP database_backup_file_size Size of latest backup file in bytes\n# TYPE database_backup_file_size gauge\ndatabase_backup_file_size{database=\"my_database\"} 160464896\n# HELP database_backup_file_timestamp Timestamp of latest backup file\n# TYPE database_backup_file_timestamp gauge\ndatabase_backup_file_timestamp{database=\"my_database\"} 1603054802\n```\n\n# Example rules\n\n```\n  # Alert after 30h for daily backups to avoid false-positives due to timezone mismatch\n  - alert: NoDatabaseBackup\n    expr: (time() - database_backup_file_timestamp) / 3600 \u003e 30\n    for: 5m\n    annotations:\n      description: 'Es wurd kein tägliches Backup erzeugt'\n      summary: 'Kein Backup für {{ $labels.database }} auf {{ $labels.instance }} angelegt'\n\n  # Less than 1Kb is considered empty\n  - alert: EmptyDatabaseBackup\n    expr: database_backup_file_size \u003c 1024\n    for: 5m\n    annotations:\n      description: 'Die Backupdatei ist leer'\n      summary: 'Leeres Backup für {{ $labels.database }} auf {{ $labels.instance }} angelegt'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonauts%2Fdbbackup-textfileexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonauts%2Fdbbackup-textfileexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonauts%2Fdbbackup-textfileexporter/lists"}