[GH-ISSUE #139] Backup job metrics #15

Open
opened 2026-03-03 16:27:43 +03:00 by kerem · 0 comments
Owner

Originally created by @fsackur on GitHub (Jul 23, 2025).
Original GitHub issue: https://github.com/natrontech/pbs-exporter/issues/139

I'm new to prometheus. Prom may not be the ideal choice to alert on backup jobs, but I have it already.

I am new to go, but I'd be willing to contribute a PR. I'm open to being talked out of the feature, if there's a better way to get what I need.

Is your feature request related to a problem? Please describe.
I want a gauge of age (or finish time) of last backup, and ideally also backup size.

Describe the solution you'd like

  • api calls:
    • /admin/datastore to get datastores
    • admin/datastore/{store}/groups to get backup set (which includes last finish time)
    • possibly, admin/datastore/{store}/files to get files with sizes, which can be summed for total backup size
  • export backup_last_finish_time gauge (timestamp in seconds)
    • add sample yml showing how to rewrite backup_last_finish_time to backup_age on prometheus server
  • alternatively: do the calculation in pbs-exporter and export backup_age metric (in seconds)
    • likely more useful, low effort, and easier for users?
  • pbs gui shows backups as, e.g., vm/103. I suggest using {store}/{type}/{id} as label, e.g. backup_age{instance=backup03,backup=local_pool/vm/103}

Describe any alternatives you've considered

  • Webhooks on the PBS servers
    • configuring servers is more work, I prefer containers
  • cron job on PBS servers to generate .prom file
    • configuring servers is more work, I prefer containers
  • see if PBS metrics server will do what I want
    • don't want to also learn and run influxdb

Additional context
I've thrown something together in python - see github.com/fsackur/pbs-sentient-exporter@fa52f21/pbs_sentient_exporter/pbs.py

That is working for me right now. However, i think Go is a better choice and I would prefer to improve your project than create something that only I will use.

Originally created by @fsackur on GitHub (Jul 23, 2025). Original GitHub issue: https://github.com/natrontech/pbs-exporter/issues/139 I'm new to prometheus. Prom may not be the ideal choice to alert on backup jobs, but I have it already. I am new to go, but I'd be willing to contribute a PR. I'm open to being talked out of the feature, if there's a better way to get what I need. **Is your feature request related to a problem? Please describe.** I want a gauge of age (or finish time) of last backup, and ideally also backup size. **Describe the solution you'd like** - api calls: - /admin/datastore to get datastores - admin/datastore/{store}/groups to get backup set (which includes last finish time) - possibly, admin/datastore/{store}/files to get files with sizes, which can be summed for total backup size - export `backup_last_finish_time` gauge (timestamp in seconds) - add sample yml showing how to rewrite backup_last_finish_time to backup_age on prometheus server - alternatively: do the calculation in pbs-exporter and export `backup_age` metric (in seconds) - likely more useful, low effort, and easier for users? - pbs gui shows backups as, e.g., `vm/103`. I suggest using `{store}/{type}/{id}` as label, e.g. `backup_age{instance=backup03,backup=local_pool/vm/103}` **Describe any alternatives you've considered** - Webhooks on the PBS servers - configuring servers is more work, I prefer containers - cron job on PBS servers to generate .prom file - configuring servers is more work, I prefer containers - see if PBS metrics server will do what I want - don't want to also learn and run influxdb **Additional context** I've thrown something together in python - see https://github.com/fsackur/pbs-sentient-exporter/blob/fa52f21/pbs_sentient_exporter/pbs.py That is working for me right now. However, i think Go is a better choice and I would prefer to improve your project than create something that only I will use.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pbs-exporter#15
No description provided.