Skip to main content
Version 4.0.0

PostgreSQL Metrics Exporter Configuration via PgSmart Web

The PostgreSQL Metrics Exporter collects information about transactions, query latency, memory usage by processes, database usage statistics, among others. This helps administrators monitor the health and performance of their PostgreSQL instances, enabling optimizations and adjustments.

Through this configuration option, it will be possible to specify the exposure port for PostgreSQL metrics to be collected by Prometheus.

warning

To perform this operation, PgSmart automatically creates the "PgSmart" user in the monitored PostgreSQL instances. If preferred, this operation can be done manually. To do so, follow the steps below:

  1. Connect to the desired PostgreSQL instance.

  2. Execute the following command to create the PgSmart user:

    Terminal input
          CREATE USER pgsmart ENCRYPTED PASSWORD 'QWEpgTecSmartnisysRTY';
  3. Execute the following command to grant the pg_monitor role (only privileges to read and execute monitoring views and functions) to the pgsmart user.

    Terminal input
          GRANT pg_monitor TO pgsmart;

The PostgreSQL Metrics Exporter will be configured, whether or not the PgSmart user exists. However, it will only start exporting metrics once the user exists with the required privileges in the monitored PostgreSQL instance.

Prerequisites
  1. Select the desired Environment from the dropdown in the top bar.

  2. Select the Banco de Dados option from the side menu. The installed Database Services will be displayed in cards format.

  3. From the list of cards, select the instance for which you want to configure the Metrics Exporter.

  4. Select the Métricas tab.

  5. Adjust the value of the metrics exposure port and web interface.

  6. Adjust the Access User (Optional). 6.1. Enter the Superuser for the PostgreSQL Instance. 6.2. Enter the Password for the PostgreSQL Instance Superuser.

  7. Click Salvar.

    Figure 1 - PostgreSQL Exporter Configuration - Edit Port
    Figure 1 - PostgreSQL Exporter Configuration - Edit Port