A Prometheus exporter to gather consumption insights of Proxmox-based private clouds by customer.
Variable | Description | Default |
---|---|---|
PROXMOX_ENDPOINT |
The URL of the Proxmox API | 10.10.10.10:8006 |
PROXMOX_USER |
The Proxmox username | root@pam |
PROXMOX_PASSWORD |
The Proxmox password | password |
PROXMOX_VERIFY_SSL |
Verify SSL certificate | true |
PROXMOX_BACKUP_STORAGE |
The name of the backup storage | local |
- Set the environment variables or use the defaults.
- Run the Docker container:
docker build -t flexporter .
docker run -p 8000:8000 flexporter
The exporter will be available at http://localhost:8000
.
The following metrics are exported:
# HELP flexporter_vm_count Number of VMs
# TYPE flexporter_vm_count gauge
flexporter_vm_count{pool="pool_name}
# HELP flexporter_vm_cpu_cores CPU cores
# TYPE flexporter_vm_cpu_cores gauge
flexporter_vm_cpu_cores{id="vm_id",name="vm_name",pool="pool_name"}
# HELP flexporter_vm_vcpus VM vCPUs
# TYPE flexporter_vm_vcpus gauge
flexporter_vm_vcpus{id="vm_id",name="vm_name",pool="pool_name"}
# HELP flexporter_vm_memory_gb VM memory in GB
# TYPE flexporter_vm_memory_gb gauge
flexporter_vm_memory_gb{id="vm_id",name="vm_name",pool="pool_name"}
# HELP flexporter_vm_total_disk_gb VM disk in GB
# TYPE flexporter_vm_total_disk_gb gauge
flexporter_vm_total_disk_gb{id="vm_id",name="vm_name",pool="pool_name"}
# HELP flexporter_vm_total_backup_gb VM backup in GB
# TYPE flexporter_vm_total_backup_gb gauge
flexporter_vm_total_backup_gb{id="vm_id",name="vm_name",pool="pool_name"}
# HELP flexporter_vm_running VM running status
# TYPE flexporter_vm_running gauge
flexporter_vm_running{id="vm_id",name="vm_name",pool="pool_name"}
# HELP flexporter_vm_info VM info
# TYPE flexporter_vm_info gauge
flexporter_vm_info{id="vm_id",name="vm_name",pool="pool_name",ip="vm_ip",os_type="vm_os_type",tags="vm_tags"}
# HELP flexporter_cluster_tags Unique tags used across the cluster
# TYPE flexporter_cluster_tags gauge
flexporter_cluster_tags{tag="tag_name"}
To add new metrics:
- Update the
MetricsCollector
class insrc/metrics_collector.py
. - Add new Gauge metrics in the
PrometheusExporter
class insrc/prometheus_exporter.py
. - Update the
update_metrics
method insrc/prometheus_exporter.py
to set the new metrics.