For each PostgreSQL instance, the operator provides an exporter of metrics for
Prometheus via HTTP, on port 9187.
The operator comes with a predefined set of metrics, as well as a highly
configurable and customizable system to define additional queries via one or
ConfigMap objects - and, future versions,
The exporter can be accessed as follows:
All monitoring queries are:
- transactionally atomic (one transaction per query)
- executed with the
Please refer to the
"Default roles" section in PostgreSQL documentation
for details on the
Users will be able to define metrics through the available interface
that the operator provides. This interface is currently in beta state and
only supports definition of custom queries as
using a YAML file that is inspired by the queries.yaml file
of the PostgreSQL Prometheus Exporter.
Queries must be defined in a
ConfigMap to be referenced in the
section of the
Cluster definition, as in the following example:
monitoring section looks for an array with the name
customQueriesConfigMap, which, as the name suggests, needs a list of
ConfigMap key references to be used as the source of custom queries.
The object must have a name and be in the same namespace as the
Note that the above query will be executed on the
primary node, with the
This framework enables the definition of custom metrics to monitor the database or the application inside the PostgreSQL cluster.
- On this page
- User defined metrics