IT-Admin.tech

Monitoring Proxmox with Prometheus and Grafana: Exporters, Dashboards and Alerts

Architekturdiagramm: Prometheus scrapt node_exporter und pve_exporter von Proxmox-Knoten; Alertmanager und Grafana sind...
Topologie: Proxmox-Knoten mit node_exporter und pve_exporter, zentrale Prometheus-Instanz, Alertmanager für Routing und Grafana für Dashboards. Fokus auf Datenfluss und...

Monitoring Proxmox with Prometheus and Grafana is the preferred solution in many IT operations to make hosts, virtual machines (VMs) and cluster state measurable, historical and alertable. This dossier is aimed at administrators, system engineers and operators and explains in practical terms which exporters you need, how to scale Prometheus, operationalize alerts and which check and fallback strategies have proven effective in real operational environments.

Monitoring Proxmox with Prometheus and Grafana: brief prerequisites and terminology check

Before you start: Prometheus is a time-series metric database (TSDB) with a pull mechanism; Grafana is the visualization frontend; Alertmanager controls notifications, grouping and silences. Exporters are small services that expose metrics in Prometheus format — node_exporter provides OS metrics, pve_exporter talks to the Proxmox API. Synchronized clocks (NTP/Chrony), firewall rules and secure tokens are mandatory.

Architecture and scaling decisions

Start with a clear separation between hot store (short retention, fast queries) and long-term store (historical data). For small environments a single Prometheus is sufficient; with growing cardinality requirements and many VMs an edge/central pattern is recommended: local Prometheus instances scrape nodes, remote_write sends data to a central, scalable TSDB such as VictoriaMetrics, Thanos or Cortex.

Why Edge Prometheus?

An edge Prometheus reduces network load, limits API calls to Proxmox and keeps failures localized. Federation or remote_write aggregates only what is required centrally. This minimizes the risk that a single global query will strain your entire infrastructure.

Exporters in detail: running node_exporter and pve_exporter correctly

node_exporter: operational notes

node_exporter should run as a systemd service, with limited collectors (disable unneeded modules) and the textfile collector for local status checks (e.g., backup results). File permissions and user context (dedicated, non-privileged user) are important because node_exporter reads metrics from the system.

Shell
# systemd unit excerpt for node_exporter
[Service]
User=nodeusr
Group=nodeusr
ExecStart=/usr/local/bin/node_exporter 
  --no-collector.wifi 
  --no-collector.mdadm 
  --collector.textfile.directory=/var/lib/node_exporter/textfile_collector

# directory permissions
chown -R nodeusr:nodeusr /var/lib/node_exporter
chmod 750 /var/lib/node_exporter

pve_exporter: auth, cache and API rate limits

pve_exporter uses the Proxmox-REST-API and is therefore dependent on API stability and token permissions. Set a cache duration (e.g., 30–60s) in the exporter to avoid unnecessary API load; Proxmox API endpoints can respond slowly or temporarily block on excessive requests.

Shell
# systemd environment with secure token file
[Service]
User=pveexport
EnvironmentFile=/etc/pve_exporter/env
ExecStart=/usr/local/bin/pve_exporter --listen-address=127.0.0.1:9273 --cache-duration=60s

# /etc/pve_exporter/env (set correctly with 600)
PROXMOX_API_TOKEN_ID=exporter@pve!id
PROXMOX_API_TOKEN_SECRET=longsecret

Important: create tokens with minimal privileges and store secrets in a vault, or at least in files with restrictive permissions (chmod 600). Test API access separately before connecting Prometheus.

Controlling cardinality: label strategy and relabeling

Cardinality refers to the number of unique time series; it explodes quickly when you adopt dynamic metadata as labels (e.g., free-form VM notes). That increases storage requirements, CPU and query latency. Mitigations:

  • Define an allowed label list per job.
  • Drop volatile labels already via relabel_configs.
  • Create service- or role-labels via regex normalization instead of full VM names.
Yaml
relabel_configs:
  - source_labels: [vm_description]
    regex: '.*'
    action: drop
  - source_labels: [vm_name]
    regex: '^(web|db|cache)-.*'
    target_label: service
    replacement: '${1}'

Prometheus operation: retention, compaction and resources

Prometheus stores data in blocks. Recommended configurations are a hot retention window of 15–30 days and remote_write for long-term storage. Monitor TSDB I/O: disk latencies lead to increased scrape durations and to errors.

Shell
# Prometheus Startflags (Beispiel)
prometheus --storage.tsdb.path=/var/lib/prometheus 
  --storage.tsdb.retention.time=30d 
  --storage.tsdb.no-lockfile

Under high load, scale horizontally with Thanos or VictoriaMetrics; also review block size and Wal-Settings if you observe frequent write spikes.

PromQL examples for operational use

Practical queries for diagnostics and dashboards:

Promql
# Aktive VMs pro Node
count by (instance) (pve_vm_info{state="running"})

# Storage-Usage pro Storage-Pool
sum by (storage) (pve_storage_used_bytes) / sum by (storage) (pve_storage_total_bytes)

# Disk-IO-Latenz pro VM (wenn Exporter Metrik liefert)
avg by (vm) (rate(pve_vm_disk_io_time_seconds_total[5m]))

Alerting: proven patterns and Alertmanager integration

Use Alertmanager as the central control for routing, grouping, inhibition and silences. Alerts should be action-oriented: a short summary, a precise cause (where possible) and a linked runbook.

Grouping, Inhibition and example

Grouping reduces notification noise, inhibition prevents duplicate alerts (e.g., when storage down triggers a series of VM alerts).

Yaml
# Beispiel: Inhibit-Regel in alertmanager.yml
inhibit_rules:
  - source_match:
      severity: 'critical'
    target_match:
      severity: 'warning'
    equal: ['instance']

Alert rule: storage high usage with for delay

Yaml
- alert: ProxmoxStorageHighUsage
  expr: (pve_storage_used_bytes / pve_storage_total_bytes) > 0.9
  for: 30m
  labels:
    severity: warning
    team: storage
  annotations:
    summary: "Storage fast voll auf {{ $labels.storage }}"
    runbook: "https://intranet/runbooks/proxmox-storage-full"

Using a longer ‚for‘ delays alerts for transient peaks (e.g., temporary snapshots).

Practical testing and validation steps

Before production rollout, perform the following standardized checks:

  1. Exporter endpoint:
    Shell
    curl -s http://pve-node1:9273/metrics | head
  2. Prometheus /targets: all relevant targets show UP and low scrape durations.
  3. Grafana panels: validate core metrics (CPU, memory, storage).
  4. Alert tests: enable a test rule with a low threshold, verify the Alertmanager route.
  5. Playbook drill: recipients execute the defined steps and report the reset point.

Integration into incident management tools

Alertmanager supports many integrations (Webhook, PagerDuty, Opsgenie, Microsoft Teams, Slack). For Slack/Webhook define a receiver with the appropriate URL and structure labels for routing (team, severity).

Yaml
receivers:
- name: 'slack-main'
  slack_configs:
  - api_url: 'https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX'
    channel: '#infra-alerts'
    title: '{{ template "slack.title" . }}'

Avoid storing sensitive URLs in plaintext repositories; use secrets management.

Security and operational risks

Insufficiently protected exporter endpoints are an attack surface. Protect the following layers:

  • Network: RESTrict firewall rules so only Prometheus can reach exporters.
  • Transport: TLS or mTLS via a reverse proxy when network segments are untrusted.
  • API access: tokens with minimal privileges, rotation, and use of a vault.

Upgrade and migration notes

Exporter and API versions can become incompatible. Recommended procedure:

  • Version pinning: test new exporter versions in staging.
  • Smoke tests: after an upgrade, verify exporter endpoints, Prometheus targets and Grafana dashboards.
  • Rollback: keep configuration versioning (Git) and revert scripts for systemd units.

Fallback strategy for alert storms or system failure

If alerts trigger uncontrollably or Prometheus itself causes problems, there are quick measures:

  1. Set a silence via the Alertmanager API for affected alert groups.
  2. Identify the most expensive Prometheus queries and temporarily disable them (config revert).
  3. Re-enable edge Prometheus instances or separate load from the central instance.
Shell
# Silence per API anlegen (Beispiel)
curl -XPOST -H "Content-Type: application/json" http://alertmanager.example.local/api/v2/silences -d '{
  "matchers": [{"name":"team","value":"storage"}],
  "startsAt":"2026-07-28T10:00:00Z",
  "endsAt":"2026-07-28T10:30:00Z",
  "createdBy":"ops",
  "comment":"Emergency mute while investigating"
}'

Grafana: dashboards, structure and reproducibility

Good dashboard design is more than pretty charts: use variables for environment/node, store dashboards as JSON in Git (export/import), and link runbooks directly in panel annotations. Configure folder permissions to RESTrict editing to a small team.

Practical checklist for rollout

  • Check tokens, firewall, and time synchronization.
  • Run node and PVE exporters as services; store secrets securely.
  • Define Prometheus relabeling; enable cardinality reports.
  • Test Alertmanager routing, silences and inhibition rules.
  • Provide Grafana dashboards with variables, runbook links and versioning.

Conclusion

Monitoring Proxmox with Prometheus and Grafana provides deep insights when introduced iteratively: a lean set of exporters (node_exporter, pve_exporter), a RESTrictive label strategy to limit cardinality, testable alerts with runbooks and a scalable persistence strategy are the core building blocks. Secure API access, automate tests and maintain clear fallback paths — this is how you operate your Proxmox cluster stably, traceably and scalably.

Further checkpoints (brief)

  • Verify automated token rotation.
  • Document TSDB backup and RESTore processes.
  • Conduct alert drills and postmortem processes regularly.

Operational reliability, disaster recovery and „monitoring that monitors“

Beyond basic functionality it is crucial that your monitoring itself is robust, testable and recoverable. Treat Prometheus, Alertmanager and Grafana not as arbitrary tools but as operationally critical services: they require their own SLOs, backup procedures, capacity planning and observability that detects failures in the monitoring pipeline early.

Metrics to monitor your monitoring system

Collect targeted internal metrics from your monitoring instances, such as scrape duration (scrape_duration_seconds), failed scrapes (scrape_samples_post_metric_relabeling), WAL lag and TSDB storage utilization. Define alerts when these indicators exceed thresholds — a high WAL lag often signals I/O bottlenecks, a rapid rise in missing scrapes points to network or API issues.

Recording Rules and aggregations for performance optimization

Recording Rules store pre-aggregated time series as new metrics and offload recurring, expensive PromQL queries. Create rules for frequently used indicators (e.g. average memory usage per node over 5m) instead of recalculating raw data on every dashboard query.

Yaml
groups:
- name: recording_rules
  rules:
  - record: job:node_memory_used_bytes:avg5m
    expr: avg_over_time(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes[5m])

Why it works: queries against precomputed series are considerably faster and reduce CPU load on the central Prometheus instance. When it fails: at very high cardinality Recording Rules must also be limited and carefully designed.

TSDB backup and recovery

Prometheus provides a snapshot API that produces a consistent block. Create regular snapshots and archive them outside the primary storage (e.g. object storage). Example: create a snapshot before changing retention or compaction parameters and test the RESToration in a staging environment.

Shell
# Snapshot per API auslösen und anschließend sichern
curl -s -XPOST http://prometheus.local:9090/api/v1/admin/tsdb/snapshot 
  | jq -r '.data.name' 
  | xargs -I{} tar -C /var/lib/prometheus/snapshots -czf /backup/prom_snap_{}.tar.gz {}

Document RESTore steps explicitly (which version, which config files) and test recoveries at least quarterly.

Canary scrapes and synthetic checks

Deploy a small set of ‚canary‘ VMs or services that are synthetically checked (Blackbox or HTTP exporter). These provide early signals when API changes, network segments or authentication issues affect entire groups of targets.

Multi-tenancy, access control and compliance

If multiple teams use Grafana or you provide Proxmox metrics as a service to third parties, ensure fine-grained RBAC. Use Grafana organizations, folder permissions and variable-based queries to achieve data isolation. Also check whether metrics contain personal data (e.g. usernames in VM metadata) and remove/anonymize them to avoid compliance risks.

Cost planning and reducing operational costs

High-cardinality long-term storage is expensive. Define a data retention policy that balances operational necessity and cost: short retention in the Hot-Store, slow aggregation in the Long-Term-Store (VictoriaMetrics, Thanos). Use sampling and downsampling for historical data.

Automation: Provisioning and Config-as-Code

Version your Prometheus, Alertmanager and Grafana provisioning (Dashboards, Alerts, Datasources) in Git. Automate rollouts via CI/CD, test configuration changes against a test Prometheus instance (promtool check rules) and ensure rollbacks are reproducible via Git-Revert.

Fast fallback and escalation paths

Define clear escalation levels in Alertmanager (e.g. Team → On-call → Management) and keep documented runbooks available. If monitoring itself fails: apply temporary Silences, disable expensive queries and switch to Edge-Prometheus instances to reduce recovery time.

Quick operational checklist: enable monitor metrics, create Recording Rules, automate snapshot backups, set up Canary-Scrapes, review RBAC and data anonymization, version Dashboards and Alerts in Git. With these additional measures you operate your Proxmox monitoring reliably, auditable and legally compliant — prerequisites for sustainable operations and for integrations into custom enterprise software and central operational processes.

Service Discovery, runtime isolation and mTLS hardening

Two complementary aspects are practically important: automatic service discovery for dynamic Proxmox pools and clean runtime isolation of Prometheus. Generate targets via file_sd from your inventory tool (Ansible/CMDB), instead of maintaining them statically – this reduces misconfigurations during scaling.

Yaml
# file_sd example
- targets: ['pve1:9273','pve2:9273']
  labels:
    cluster: 'prod'
    role: 'hypervisor'

Operate Prometheus preferably in a dedicated runtime context (container or VM) with direct, performant block storage; verify cgroup and I/O-QoS to avoid WAL and compaction failures. For exporter endpoints, mTLS via a reverse proxy (Envoy/Nginx) and an internal CA for easy certificate rotation is recommended. This protects data integrity, reduces attack surface and simplifies integration into custom enterprise software via secured webhooks.

Proxmox monitoring and Prometheus alerting are also important for this topic. The article places these aspects in context and shows what matters in everyday operations.