User Alerting

VSHN Managed PostgreSQL allows to configure alertmanager in spec.paremeters.monitoring. Alertmanager handles alerts sent by client applications. For more details how to configure Alertmanager to your needs, check out APPUiO Alertmanager configuration page. You can enable alerting for your PostgreSQL instance either using an existing alertmanagerConfig or an Alertmanager Template. See below configuration examples for both use cases.

Providing an Alertmanager Template

apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
  name: pgsql-app1-prod
  namespace: prod-app
spec:
  parameters:
    monitoring:
      alertmanagerConfigSecretRef: alert-secret (1)
      alertmanagerConfigTemplate: (2)
        receivers:
          - name: default
            slackConfigs:
            - apiURL:
                key: url
                name: alert-secret (3)
              channel: '#prometheus'
        route:
          groupBy: [alertname, instance]
          receiver: default
    service:
      majorVersion: "16"
  writeConnectionSecretToRef:
    name: postgres-creds
1 Name of the secret used inside alertmanager config.
2 An AlertmanagerConfigSpec object from an AlertmanagerConfig resource.
3 The secret from 1 being used in AlertmanagerConfig template.
The secret must be in the same namespace of PostgreSQL instance. The template approach does not require an existing AlertmanagerConfig resource.

From existing alertmanagerConfig

apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
  name: pgsql-app1-prod
  namespace: prod-app
spec:
  parameters:
    monitoring:
      alertmanagerConfigSecretRef: alert-secret (1)
      alertmanagerConfigRef: my-alert (2)
    service:
      majorVersion: "16"
  writeConnectionSecretToRef:
    name: postgres-creds
1 Name of a secret used inside AlertmanagerConfig resource.
2 Name of an existing AlertmanagerConfig resource.
Both secret and alertmanager configuration must be in the same namespace of PostgreSQL instance. The configuration secret contains keys to sensitive information such as passwords used in alertmanager configuration.

Receive monitoring alerts via E-Mail

You can also receive alerts to any e-mail address, by specifing the address in spec.paremeters.monitoring.email:

apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
  name: pgsql-app1-prod
  namespace: prod-app
spec:
  parameters:
    monitoring:
      email: foo@example.com (1)
    service:
      majorVersion: "16"
  writeConnectionSecretToRef:
    name: postgres-creds
1 E-Mail address to be used to receive alerts.

Alert Specifications

PersistentVolumeFillingUp

This happens if the AppCat service is running out of disk space.

  • Either reduce the amount of data

  • Or increase the allocated disk space for the instance

PersistentVolumeExpectedToFillUp

This indicates that the AppCat service will run out of disk space in 4 days based on the current growth pattern.

  • Either reduce the amount of data

  • Or increase the allocated disk space for the instance

MemoryCritical

The memory usage of the service is above 85%.

  • Either reduce the load for the service

  • Or increase the memory size

PostgreSQLConnectionsCritical

The connections have been over 90% of the configured max_connections setting.

  • Either reduce the amount of connections to the database

  • Or increase the max_connections setting in your instance

Please be aware that changing the max_connection setting can have an impact on the memory usage of PostgreSQL.