Updated on 2025-03-25 GMT+08:00

Viewing Metric Details on PoWA

After PoWA is deployed and PoWA-collector and PoWA-web are started, you can log in to PoWA using a browser to view metric details of the monitored instances.

Accessing PoWA

  1. Use a browser to access PoWA.

    • There is no port option in the powa-web.conf file. The default value 8888 is used.
    • URL: http://ECS_IP_address:8888/
    Figure 1 Accessing PoWA

  2. Enter the username and password, and click Login.

    Figure 2 PoWA home page

    In this example, PoWA collects information about two PostgreSQL instances.

    • <local>: PostgreSQL database built on an ECS, which is used as the powa-repository database.
    • myinstance: RDS for PostgreSQL instance, which is used as the target for performance data collection. (myinstance is the instance alias registered in powa-repository.)

  3. Click an instance to view its performance metrics.

Viewing Metric Details

PoWA can collect and display various performance metrics. The following describes how to view the slow SQL metric.

  1. Log in to the management console.
  2. Click in the upper left corner and select a region.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, locate the target DB instance and click Log In in the Operation column.

    Alternatively, click the instance name on the Instances page. On the displayed page, click Log In in the upper right corner of the page.

  5. On the displayed login page, enter the username and password and click Log In.
  6. In the database list of the Home page, click Create Database.
  7. On the displayed page, enter a database name (for example, test) and select a character set.
  8. Choose SQL Operations > SQL Query to execute a slow SQL statement, for example, SELECT pg_sleep($1), in the test database.
  9. After about 5 minutes, on the PoWA home page, select the target DB instance and select the test database.

    Figure 3 PoWA home page

    In Details for all queries, check that the execution time of the SELECT pg_sleep($1) statement is 20s.

Installing Other Extensions to Collect Performance Metrics

The following steps take pg_track_settings as an example.

  1. Log in to the management console.
  2. Click in the upper left corner and select a region.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, locate the target DB instance and click Log In in the Operation column.

    Alternatively, click the instance name on the Instances page. On the displayed page, click Log In in the upper right corner of the page.

  5. On the displayed login page, enter the username and password and click Log In.
  6. Select the powa database and run the following SQL command to create pg_track_settings:

    select control_extension('create', 'pg_track_settings');

  7. Create a PostgreSQL database (powa-repository) on the ECS, and install and activate pg_track_settings to collect performance metrics.

    # pg_track_settings
    cd /home/postgres/env
    wget https://github.com/rjuju/pg_track_settings/archive/refs/tags/2.0.1.tar.gz
    mv 2.0.1.tar.gz pg_track_settings.2.0.1.tar.gz
    tar -xzvf pg_track_settings.2.0.1.tar.gz
    cd pg_track_settings-2.0.1
    make && make install	
    # powa-repository
    psql -d powa
    powa=# create extension pg_track_settings ;
    CREATE EXTENSION
    # Activate pg_track_settings for the target instance.
    dbpowa=# select powa_activate_extension(1, 'pg_track_settings');
    powa_activate_extension
    -------------------------
    t
    (1 row)

  8. Verify the pg_track_settings extension.

    Change the value of the autovacuum_analyze_threshold parameter on the target instance to 55. The default value is 50. After about 5 minutes, you can view the modification record on the PoWA page, as shown in the following figure:

    The contents in the three boxes in the preceding figure include:

    • The time when pg_track_settings was activated and the database parameter value at that time.
    • The time when the autovacuum_analyze_threshold parameter was modified, its original value, and new value.
    • The time when pg_track_settings was canceled and the database parameter value at that time.