Skip to content

Feature Request: Expose additional backup storage metrics from PBS API #183

Description

@gowtham418p-rgb

Hello,

We are currently using the pbs-exporter to monitor our Proxmox Backup Server environment and integrate the metrics into Grafana dashboards.

The exporter already exposes several useful metrics such as:

  • pbs_size
  • pbs_used
  • pbs_available
  • pbs_snapshot_count
  • pbs_snapshot_vm_count
  • pbs_snapshot_vm_last_timestamp

However, for deeper monitoring and capacity planning we require additional metrics that appear to be available via the Proxmox Backup Server API but are not currently exported.

Required metrics

  1. Snapshot size

To analyze backup storage usage and backup growth trends, we need the size of each snapshot.

Proposed metric:

pbs_snapshot_size_bytes{datastore, namespace, vm_id, vm_name, backup_time}

API source:
/api2/json/admin/datastore//snapshots

  1. First backup timestamp per VM

Currently the exporter exposes only the last backup timestamp:

pbs_snapshot_vm_last_timestamp

To display the full backup history of a VM, we would also need the first backup timestamp.

Proposed metric:

pbs_snapshot_vm_first_timestamp{datastore, namespace, vm_id, vm_name}

API source:
/api2/json/admin/datastore//snapshots

  1. Total backup storage used per VM

To identify which VMs consume the most backup storage, we propose the following aggregated metric:

pbs_vm_backup_total_size_bytes{datastore, namespace, vm_id, vm_name}

API source:
/api2/json/admin/datastore//snapshots

  1. Detect backup growth trend per VM

pbs_vm_backup_growth_bytes

API source:
/api2/json/admin/datastore/{store}/snapshots

  1. Needed for alerting: disk full in X days

pbs_datastore_estimated_days_until_full

API source:
/api2/json/admin/datastore/{store}/status

  1. Used for capacity monitoring dashboards

pbs_datastore_usage_percent

API source:
/api2/json/admin/datastore/{store}/status

Use case

These metrics would allow us to:

  • visualize storage usage per backup
  • track backup storage trends
  • identify VMs consuming the most backup storage
  • enrich Grafana dashboards with VM backup statistics
  • improve capacity planning for Proxmox Backup Server storage

API documentation

https://pbs.proxmox.com/docs/api-viewer/index.html

Contribution

We are currently evaluating the possibility of extending the exporter ourselves to expose these metrics.

Since the required information appears to be available through the PBS API (for example via /api2/json/admin/datastore//snapshots), we are exploring adding these metrics directly in the exporter code.

Before proceeding with implementation, we wanted to check with the maintainers if exposing these metrics would be aligned with the project's scope and design.

If this enhancement is acceptable, we would be happy to work on a pull request.

Thank you for maintaining this exporter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions