Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots metrics not showing completely - Missing snapshot data #34

Open
artemis-mike opened this issue Nov 14, 2024 · 2 comments
Open
Labels
question Further information is requested

Comments

@artemis-mike
Copy link

When querying the exporter, I only get the data of five snapshots in the repository. The latest (which is nice), the three oldest, and then the latest snapshot of the second-oldest month. The repository is remote at backblaze, if that matters.

$ restic -r ... snapshots -c
ID        Time                 Host      Tags
-----------------------------------------------
[redacted]  2024-06-17 23:12:22  host1
[redacted]  2024-07-08 00:42:55  host1
[redacted]  2024-07-08 01:27:21  host1
[redacted]  2024-07-08 11:29:47  host1
[redacted]  2024-07-08 12:26:29  host1
[redacted]  2024-07-09 00:51:40  host1
[redacted]  2024-07-16 00:04:21  host1
[redacted]  2024-07-18 22:14:21  host1
[redacted]  2024-07-21 02:00:12  host1
[redacted]  2024-07-28 02:00:11  host1
[redacted]  2024-08-04 18:00:02  host1
[redacted]  2024-08-25 02:00:12  host1
[redacted]  2024-09-29 02:00:12  host1
[redacted]  2024-10-06 02:00:11  host1
[redacted]  2024-10-13 02:00:10  host1
[redacted]  2024-10-20 02:00:10  host1
[redacted]  2024-10-27 02:00:11  host1
[redacted]  2024-11-03 02:00:12  host1
[redacted]  2024-11-10 02:00:11  host1
-----------------------------------------------
19 snapshots

But the exporter only shows these five snapshots (I converted the unix timestamp to something readable in parentheses)

$ curl restic-exporter:8001
# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 213.0
python_gc_objects_collected_total{generation="1"} 66.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable objects found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 33.0
python_gc_collections_total{generation="1"} 2.0
python_gc_collections_total{generation="2"} 0.0
# HELP python_info Python platform information
# TYPE python_info gauge
python_info{implementation="CPython",major="3",minor="12",patchlevel="1",version="3.12.1"} 1.0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 3.086336e+07
# HELP process_resident_memory_bytes Resident memory size in bytes.
# TYPE process_resident_memory_bytes gauge
process_resident_memory_bytes 2.0414464e+07
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1.73157723095e+09
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.49
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 6.0
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1.048576e+06
# HELP restic_check_success Result of restic check operation in the repository
# TYPE restic_check_success gauge
restic_check_success 1.0
# HELP restic_locks_total Total number of locks in the repository
# TYPE restic_locks_total counter
restic_locks_total 0.0
# HELP restic_snapshots_total Total number of snapshots in the repository
# TYPE restic_snapshots_total counter
restic_snapshots_total 19.0
[...]
# HELP restic_backup_timestamp Timestamp of the last backup
# TYPE restic_backup_timestamp gauge
restic_backup_timestamp{client_hostname="host1",client_username="user",client_version="restic 0.16.4",snapshot_hash="[redacted]",snapshot_paths="",snapshot_tag="",snapshot_tags=""} 1.718651542e+09 (2024-06-17T23:12)
restic_backup_timestamp{client_hostname="host1",client_username="user",client_version="restic 0.16.4",snapshot_hash="[redacted]",snapshot_paths="",snapshot_tag="",snapshot_tags=""} 1.720394841e+09 (2024-07-08T01:27)
restic_backup_timestamp{client_hostname="host1",client_username="user",client_version="restic 0.16.4",snapshot_hash="[redacted]",snapshot_paths="",snapshot_tag="",snapshot_tags=""} 1.720434389e+09 (2024-07-08T12:26)
restic_backup_timestamp{client_hostname="host1",client_username="user",client_version="restic 0.16.4",snapshot_hash="[redacted]",snapshot_paths="",snapshot_tag="",snapshot_tags=""} 1.722124811e+09 (2024-07-28T02:00)
restic_backup_timestamp{client_hostname="host1",client_username="user",client_version="restic 0.16.4",snapshot_hash="[redacted]",snapshot_paths="",snapshot_tag="",snapshot_tags=""} 1.731200411e+09 (2024-11-10T02:00)
[...]
# HELP restic_scrape_duration_seconds Amount of time each scrape takes
# TYPE restic_scrape_duration_seconds gauge
restic_scrape_duration_seconds 58.340163707733154

I really would like to be able to see all snapshot data exported. Can you help me?

@artemis-mike
Copy link
Author

This might be due to the context deadline being exceeded. Is there a way to increase it?

@ngosang
Copy link
Owner

ngosang commented Feb 15, 2025

Getting the stats is costly in time and in money if you are using a cloud provider:

I'm not exporting all snapshots, just the last with different triplet: hostname / username / paths

text = snapshot["hostname"] + snapshot["username"] + ",".join(snapshot["paths"])

I think the exporter is working well, just checkout your snapshots.

@ngosang ngosang added the question Further information is requested label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants