Example metrics
Here are some helpful queries for monitoring the health of your BigAnimal database. This is not a complete list and is only intended as a starting point.
The examples are in PromQL with variables suitable for use in a Grafana dashboard.
Status
This query shows if the pods are up as provided by Kube State Metrics:
CPU
The query below shows CPU usage as provided by Kubernetes metrics:
Memory
This query shows memory usage in megabytes as provided by Kubernetes metrics:
Storage
This query shows the percentage of available storage used as provided by Kubernetes metrics:
Replication lag
This query shows the replication lag as provided by the CNP Replication Lag Metric filtered by the Postgres Instance ($instance)
pod:
Connections used
To calculate the connections used as a percentage we leverage the cnp_backends_total and cnp_pg_settings_setting metrics. This query calculates the percentage of connections used filtered by the Postgres Instance ($instance)
pod:
Transaction ID age
This query shows the database transaction ID age as provided by the CNP Database xid Metric filtered by the Postgres Instance ($instance)
pod:
The age is relative to the workloads being run on your database and the following settings. Refer to the Postgres documentation for details:
- autovacuum_freeze_max_age, the default is 200000000
- vacuum_multixact_failsafe_age, the default is 1600000000