Configure Grafana
This topic describes how to configure Grafana to monitor your Portworx Backup clusters. Grafana enables you to visualize metrics, create custom dashboards, set up alerting, and aggregate data from multiple Portworx Backup instances for a multi-tenant view.
Prerequisites
- Portworx Backup 2.10.1 or later. For earlier versions (2.7.x or earlier), see Monitor Portworx Backup Clusters.
- Prometheus configured and scraping Portworx Backup metrics. You can use either:
- A running Grafana instance that can reach your Portworx Backup cluster. Installing and operating Grafana is outside the scope of Portworx Backup. For setup instructions, see the Grafana installation documentation.
kubectlaccess to your Portworx Backup cluster
Use cases
Grafana provides several powerful capabilities for monitoring Portworx Backup:
| Use Case | Description |
|---|---|
| Custom Dashboards | Visualize backup, restore, and cluster metrics with pre-built or custom dashboards |
| Custom Querying | Use PromQL to query specific metrics and create custom visualizations |
| Alerting | Configure Grafana alerts for backup failures, cluster disconnections, and other critical events |
| Multi-Tenant View | Scrape and aggregate metrics from multiple Portworx Backup instances for centralized monitoring and alerting |
Configure a Prometheus data source
-
In Grafana, add a Prometheus data source. The configuration depends on your Prometheus setup:
-
If you are using Portworx Backup Prometheus: You must first expose the Prometheus metrics endpoint. Follow the instructions in Expose Portworx Backup Prometheus to create a NodePort service and retrieve the authentication credentials.
-
If you are using your own Prometheus stack: Ensure that your Prometheus instance is accessible from Grafana. For details on exposing the metrics endpoint, see Configure your Own Prometheus.
After configuring the endpoint, follow the instructions in the Prometheus documentation to create a Prometheus data source named
px-backup. Replace the HTTP URLhttp://localhost:9090/with the appropriate URL for your setup:- For Portworx Backup Prometheus, use the exposed metrics endpoint constructed using the master node IP and NodePort (e.g.,
http://<master-ip>:<nodeport>). - For your own Prometheus, use the exposed metrics endpoint where your Prometheus instance is accessible.
-
Import dashboards
-
Follow the instructions in the Grafana documentation to import the Portworx Backup dashboard JSON into your Grafana instance.
noteIf you previously imported the old
Portworx_Backup_Overview.jsonorgrafana-dashboard.jsonGrafana dashboards, remove them from Grafana before importing the new dashboards below.noteNamespace / App Protection Dashboard and VM / KubeVirt Protection Dashboard require the
pxbackup_backup_object_infofamily of metrics. These are only emitted whenBACKUP_INFO_METRICS_BACKFILL_HOURSis set to a non-zero value in the px-backup deployment (default varies by install). If those panels appear empty, verify this environment variable is set.Additionally, these metrics are excluded from the built-in px-backup Prometheus by default (ServiceMonitor drop rules). To use Namespace / App Protection Dashboard and VM / KubeVirt Protection Dashboard, point Grafana at an external Prometheus scraping the px-backup metrics endpoint directly.
- Global Operations Overview
Click here to download a sample Grafana dashboard JSON for the Portworx Backup Global Operations Overview, which provides a fleet-wide view of cluster health, backup location status, backup and restore operation trends, schedule and policy inventory, and cloud credentials - ready for import into your Grafana instance. - Namespace / App Protection
Click here to download a sample Grafana dashboard JSON for Portworx Backup Namespace and Application Protection, which covers per-application backup health, namespace-level status and failure drilldowns, Kubernetes resource type breakdowns, and PVC/volume protection details - ready for import into your Grafana instance. - VM / KubeVirt Protection
Click here to download a sample Grafana dashboard JSON for Portworx Backup VM and KubeVirt Protection, which covers virtual machine backup status, OS inventory, VM disk and PVC health, auto-exec rule governance, and restore failure drilldowns - ready for import into your Grafana instance.
- Global Operations Overview
Custom querying in Grafana
Grafana allows you to create custom queries using PromQL to visualize specific Portworx Backup metrics. You can:
- Build custom panels with specific metrics from the Portworx Backup metrics endpoint
- Create calculated fields and aggregations
- Filter data by labels such as cluster name, backup name, or namespace
For a complete list of available metrics, see the Portworx Backup Metrics Reference.
Example queries
| Query | Description |
|---|---|
px_backup_total_backups | Total number of backups |
px_backup_failed_backups | Number of failed backups |
rate(px_backup_total_backups[1h]) | Backup rate over the last hour |
Alerting in Grafana
Grafana can alert you when backup metrics cross defined thresholds. To configure alerting:
- Navigate to Alerting > Alert rules in Grafana.
- Create a new alert rule based on Portworx Backup metrics.
- Define conditions (for example, alert when
px_backup_failed_backups > 0). - Configure notification channels (email, Slack, PagerDuty, and so on).
Multi-tenant monitoring
For organizations running multiple Portworx Backup instances across different clusters or environments, Grafana can aggregate metrics for a unified view.
Architecture overview
Configure multiple data sources
-
In Grafana, navigate to Configuration > Data Sources.
-
Add each Prometheus instance as a separate data source. The URL and authentication settings depend on your Prometheus setup:
-
For Portworx Backup Prometheus instances: Follow the instructions in Expose Portworx Backup Prometheus to expose each instance and retrieve the authentication credentials.
-
For your own Prometheus instances: Use the URL where each Prometheus instance is accessible. Authentication depends on your Prometheus configuration.
Example data source configuration:
- Name:
pxb-cluster-a, URL:http://<prometheus-1-endpoint>:<port> - Name:
pxb-cluster-b, URL:http://<prometheus-2-endpoint>:<port> - Name:
pxb-cluster-c, URL:http://<prometheus-3-endpoint>:<port>
-
-
Use dashboard variables to switch between clusters or create mixed queries.
Create aggregated dashboards
Use Grafana's Mixed data source to query multiple Prometheus instances in a single panel, enabling:
- Cross-cluster backup status overview
- Aggregated success/failure rates across all environments
- Unified alerting for all Portworx Backup instances