diff --git a/README.md b/README.md index f3158a6..b1c432a 100644 --- a/README.md +++ b/README.md @@ -164,16 +164,16 @@ restic_locks_total 1.0 restic_snapshots_total 100.0 # HELP restic_backup_timestamp Timestamp of the last backup # TYPE restic_backup_timestamp gauge -restic_backup_timestamp{client_hostname="product.example.com",client_username="root",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 1.666273638e+09 +restic_backup_timestamp{client_hostname="product.example.com",client_username="root",client_version="restic 0.16.0",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 1.666273638e+09 # HELP restic_backup_files_total Number of files in the backup # TYPE restic_backup_files_total counter -restic_backup_files_total{client_hostname="product.example.com",client_username="root",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 8.0 +restic_backup_files_total{client_hostname="product.example.com",client_username="root",client_version="restic 0.16.0",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 8.0 # HELP restic_backup_size_total Total size of backup in bytes # TYPE restic_backup_size_total counter -restic_backup_size_total{client_hostname="product.example.com",client_username="root",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 4.3309562e+07 +restic_backup_size_total{client_hostname="product.example.com",client_username="root",client_version="restic 0.16.0",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 4.3309562e+07 # HELP restic_backup_snapshots_total Total number of snapshots # TYPE restic_backup_snapshots_total counter -restic_backup_snapshots_total{client_hostname="product.example.com",client_username="root",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 1.0 +restic_backup_snapshots_total{client_hostname="product.example.com",client_username="root",client_version="restic 0.16.0",snapshot_hash="20795072cba0953bcdbe52e9cf9d75e5726042f5bbf2584bb2999372398ee835",snapshot_tag="mysql",snapshot_paths="/mysql/data,/mysql/config"} 1.0 # HELP restic_scrape_duration_seconds Amount of time each scrape takes # TYPE restic_scrape_duration_seconds gauge restic_scrape_duration_seconds 166.9411084651947 diff --git a/restic-exporter.py b/restic-exporter.py index 744c073..74d5526 100644 --- a/restic-exporter.py +++ b/restic-exporter.py @@ -40,6 +40,7 @@ class ResticCollector(object): common_label_names = [ "client_hostname", "client_username", + "client_version", "snapshot_hash", "snapshot_tag", "snapshot_paths", @@ -94,6 +95,7 @@ class ResticCollector(object): common_label_values = [ client["hostname"], client["username"], + client["version"], client["snapshot_hash"], client["snapshot_tag"], client["snapshot_paths"], @@ -179,6 +181,7 @@ class ResticCollector(object): { "hostname": snap["hostname"], "username": snap["username"], + "version": snap["program_version"] if "program_version" in snap else "", "snapshot_hash": snap["hash"], "snapshot_tag": snap["tags"][0] if "tags" in snap else "", "snapshot_paths": ",".join(snap["paths"]) if self.include_paths else "",