Custom metric monitoring

Updated at:

To create a custom view of your database or compare the performance of multiple instances, use a monitoring dashboard. You can select the instances and metrics you want to monitor, compare performance between instances, and correlate different metrics to get a comprehensive overview of your database's health.

Prerequisites

Your ApsaraDB RDS for PostgreSQL instance must be the High-availability Edition.

Note

Database Autonomy Service (DAS) has been rolling out the monitoring dashboard feature for ApsaraDB RDS for PostgreSQL since May 20, 2022.

Add a monitoring dashboard

  1. Log in to the ApsaraDB RDS console.

  2. In the left-side navigation pane, click Maintenance & Monitoring > Performance Monitoring.

  3. On the Performance Monitoring page, click the Monitoring Dashboard tab.

  4. On the tab for your target database engine, click Add Monitoring Dashboard.

  5. Enter a name for the New Monitoring Dashboard, and click OK.

  6. Click Select Instances and Metrics, select the target instances and metrics, and then click ‪选择.

    Note
    • You can monitor up to 32 instances.

    • For more information about the metrics, see Metrics.

    In the Select Instances and Metrics dialog box, select the target instances. In the Select Metrics area, select the PostgreSQL metrics to monitor (including host metrics and basic PostgreSQL monitoring). Then click Confirm.

  7. Click Confirm.

    Note

    To modify the instances or metrics on the dashboard, click Add Instances and Metrics.

View metric trends

  1. Log on to the ApsaraDB RDS console.

  2. In the left-side navigation pane, choose Maintenance & Monitoring > Performance Monitoring.

  3. Click the Monitoring Dashboard tab.

  4. Click the tab for the database engine, select the monitoring dashboard you want to view, then set a time range to display metric trend charts for that period.

    The end time must be later than the start time, and the time range cannot exceed seven days.

The following options are available on the dashboard:

Option Description
Instance filtering Filter by one or more RDS instances to compare their metrics side by side.
Auto Refresh (Every 5 Seconds) Automatically refresh all trend charts every 5 seconds — useful for monitoring active workloads in real time.
Linkage Chart Synchronize chart cursors so you can see the values of different metrics at the same point in time, making it easier to correlate anomalies across metrics.
Chart Layout Set the number of trend charts displayed per row.
Add Instances and Metrics Add or change the instances and metrics shown in the dashboard.
Details (in a trend chart) Expand the chart and adjust the time range for a closer look at a specific metric.
Delete (in a trend chart) Remove the chart from the dashboard.

Metrics

Category

Parameter

Description

host metrics

cpu_sys_ratio

The CPU utilization of the PostgreSQL process in kernel mode.

cpu_user_ratio

The CPU utilization of the PostgreSQL process in user mode.

cpu_usage

The CPU utilization of the PostgreSQL process.

mem_usage

The memory usage of the PostgreSQL process.

data.r_s

The read IOPS for the disk containing the data directory.

data.iops

The IOPS for the disk containing the data directory.

data.w_s

The write IOPS for the disk containing the data directory.

local_fs_size_total

The total disk space.

data.fs.used

The used space on the disk containing the data directory.

data.fs.usage

The disk usage of the disk containing the data directory.

network_out_io

The outbound network traffic of the PostgreSQL process.

network_io

The network traffic of the PostgreSQL process.

network_in_io

The inbound network traffic of the PostgreSQL process.

basic PostgreSQL monitoring

waiting_connection

The number of waiting connections.

idle_in_transaction

The number of sessions that are idle within a transaction.

active_session

The number of active sessions.

total_session

The total number of sessions.

tup_inserted

The number of rows inserted per second.

tup_deleted

The number of rows deleted per second.

tup_updated

The number of rows updated per second.

tup_returned

The number of rows returned by sequential scans per second.

tup_fetched

The number of rows fetched by index scans per second.

tps

The number of transactions per second (TPS).

xact_rollback

The number of transactions rolled back per second.

xact_commit

The number of transactions committed per second.

deadlocks

The number of deadlocks per second.

oldest_snapshot

The oldest transaction snapshot point. Dead tuples created before this point can be reclaimed.

max_sent_delay

The data send latency on the secondary RDS instance.

max_replay_delay

The data replay latency on the secondary RDS instance.

long_query_5s

The number of SQL queries that run for 5 seconds or longer.

long_query_1s

The number of SQL queries that run for 1 second or longer.

long_query_3s

The number of SQL queries that run for 3 seconds or longer.

long_idle_in_transaction_3s

The number of transactions that are idle for 3 seconds or longer.

long_idle_in_transaction_5s

The number of transactions that are idle for 5 seconds or longer.

long_idle_in_transaction_1s

The number of transactions that are idle for 1 second or longer.

long_2pc_1s

The number of two-phase commit (2PC) transactions running for 1 second or longer.

long_2pc_5s

The number of two-phase commit (2PC) transactions running for 5 seconds or longer.

long_2pc_3s

The number of two-phase commit (2PC) transactions running for 3 seconds or longer.

Note

You can also view a metric's description by clicking the 问号 icon next to its name on the monitoring dashboard.