Skip to main content
Version: 3.0

Configure Portworx Backup Prometheus

Applicable to both Classic and Federated modes

You can configure Portworx Backup's Prometheus and Alertmanager's default storage limit and the number of replicas either during fresh installation or upgrade. You can either use set command or update values.yaml to modify the default limits with the desired values that suits your cluster environment.

  • By default, Portworx Backup Prometheus comes with 5 Gi storage and you can modify this storage limit as shown in the below example based on the storage requirements of your environment.

    Here is an example to set Prometheus storage to 8 Gi:

    persistentStorage.prometheus.storage=8Gi,
    persistentStorage.prometheus.retentionSize=7360MB
    note

    Set retentionSize to approximately 92% of the prometheus.storage value expressed in megabytes. For 8 Gi storage (8192 MB), 92% is approximately 7360 MB.

  • By default, Alertmanager comes with 2 Gi storage. If you need to modify this limit, you can use the following example:

    Here is an example to set the storage of Alertmanager to 1 Gi:

    persistentStorage.alertManager.storage=1Gi
  • By default, Prometheus and Alertmanager come with 2 replicas. If you need to modify this, use the following example to set Prometheus and Alertmanager to 3 replicas:

    pxbackup.prometheus.replicas=3
    pxbackup.alertmanager.replicas=3

Expose Portworx Backup Prometheus

If you want to access Portworx Backup Prometheus metrics externally, you must expose the Prometheus metrics endpoint and retrieve the authentication credentials. This enables integration with external tools such as Grafana for visualization, or other monitoring solutions.

Exposing metrics endpoint

  1. Create a NodePort service to expose Prometheus:

    apiVersion: v1
    kind: Service
    metadata:
    name: prometheus-nodeport
    namespace: central
    spec:
    type: NodePort
    selector:
    prometheus: px-backup-dashboard-prometheus
    ports:
    - name: http
    port: 9090
    targetPort: 9090
    nodePort: 30090
  2. Retrieve the NodePort of the exposed service:

    kubectl get svc prometheus-nodeport -n central \
    -o jsonpath='{.spec.ports[0].nodePort}'
  3. Construct the Prometheus URL using the master node IP and the NodePort:

    http://<master-ip>:<nodeport>

Retrieve Prometheus credentials

Portworx Backup Prometheus is configured with basic authentication. Retrieve the credentials to add Prometheus as a data source in external Grafana.

  1. Run the following command to retrieve the password:

    echo "$(kubectl get secret pxc-backup-metrics -n central -o jsonpath='{.data.password}' | base64 -d)"
  2. Use the following credentials when adding the Prometheus as data source:

    • Username: admin
    • Password: The password retrieved from the previous step
    note

    The password is randomly generated and unique for each installation. You must retrieve it using the command above.

Next steps

After exposing the Portworx Backup Prometheus metrics endpoint, you can configure Grafana to visualize your backup and restore metrics. For more information, see Configure Grafana for Portworx Backup.