Skip to content

Huawei Cloud RDS PostgreSQL

Collect Huawei Cloud RDS PostgreSQL Metrics

Configuration

Install Func

It is recommended to activate the TrueWatch integration - Extensions - DataFlux Func (Automata): All prerequisites are automatically installed. Please proceed with the script installation.

If deploying Func manually, refer to Manual Deployment of Func

Install Script

Note: Please prepare the Huawei Cloud AK with the required permissions in advance (for simplicity, you can grant the global read-only permission ReadOnlyAccess)

  1. Log in to the Func console, click 【Script Market】, and enter the TrueWatch script market. Search for ID: integration_huaweicloud_rds_postgresql

  2. Click 【Install】, then enter the corresponding parameters: Huawei Cloud AK, SK, and account name

  3. Click 【Deploy Startup Script】, the system will automatically create the Startup script set and configure the corresponding startup scripts

  4. After enabling, you can see the corresponding automatic trigger configuration in 「Manage / Automatic Trigger Configuration」. Click 【Execute】 to immediately execute it once without waiting for the scheduled time. After a while, you can check the execution task records and corresponding logs

Verification

  1. In 「Manage / Automatic Trigger Configuration」, confirm whether the corresponding task has the automatic trigger configuration. You can also check the corresponding task records and logs for any exceptions
  2. In TrueWatch, check if the asset information exists in 「Infrastructure - Resource Catalog」
  3. In TrueWatch, check if there are corresponding monitoring data in 「Metrics」

Metrics

Collect Huawei Cloud RDS PostgreSQL Metrics. More metrics can be collected through configuration Huawei Cloud RDS PostgreSQL Metrics Details

Instance Monitoring Metrics

RDS for PostgreSQL instance performance monitoring metrics are shown in the table below. For more metrics, refer to Table 1

Metric ID Metric Name Metric Description Value Range Monitoring Period (Raw Metric)
swap_total_size Total Swap Size This metric counts the total swap size. ≥ 0 MB 1 minute
swap_usage Swap Usage Rate This metric counts the swap usage rate. 0-100% 1 minute
rds005_bytes_out Network Output Throughput This metric counts the average traffic output from all network adapters of the measured object, in bytes per second. ≥ 0 bytes/s 1 minute
rds004_bytes_in Network Input Throughput This metric counts the average traffic input from all network adapters of the measured object, in bytes per second. ≥ 0 bytes/s 1 minute
rds003_iops IOPS This metric counts the average number of I/O requests processed by the system per second for the current instance. ≥ 0 counts/s 1 minute
read_count_per_second Read IOPS This metric counts the average number of read I/O requests processed by the system per second for the current instance. ≥ 0 counts/s 1 minute
write_count_per_second Write IOPS This metric counts the average number of write I/O requests processed by the system per second for the current instance. ≥ 0 counts/s 1 minute
rds042_database_connections Database Connections The number of backends currently connected to the database. ≥ 0 counts 1 minute
rds083_conn_usage Connection Usage Rate This metric counts the percentage of used PgSQL connections out of the total connections. 0-100% 1 minute
active_connections Active Connections This metric counts the current number of active database connections. ≥ 0 1 minute
rds082_tps TPS This metric counts the number of transactions executed per second, including committed and rolled back transactions. ≥ 0 transactions/s 1 minute
rds046_replication_lag Replication Lag The lag time of the replica. ≥ 0 ms 1 minute
synchronous_replication_blocking_time Synchronous Replication Blocking Time This metric gets the blocking duration of synchronous replication between the primary and standby. ≥ 0 s 1 minute
inactive_logical_replication_slot Inactive Logical Replication Slots This metric counts the number of inactive logical replication slots in the current database. ≥ 0 1 minute
rds041_replication_slot_usage Replication Slot Usage The disk capacity occupied by replication slot files. ≥ 0 MB 1 minute
rds043_maximum_used_transaction_ids Maximum Used Transaction IDs The maximum used transaction ID. ≥ 0 counts 1 minute
idle_transaction_connections Idle Transaction Connections This metric counts the current number of idle database connections. ≥ 0 1 minute
oldest_transaction_duration Longest Transaction Duration This metric counts the duration of the longest transaction currently existing in the database. ≥ 0 ms 1 minute
oldest_transaction_duration_2pc Longest Unresolved Transaction Duration This metric counts the duration of the longest unresolved transaction currently existing in the database. ≥ 0 ms 1 minute
rds040_transaction_logs_usage Transaction Log Usage The disk capacity occupied by transaction logs. ≥ 0 MB 1 minute
lock_waiting_sessions Sessions Waiting for Locks This metric counts the number of sessions currently in a blocked state. ≥ 0 1 minute
slow_sql_log_min_duration_statement SQLs Executed Longer Than log_min_duration_statement This metric counts the number of slow SQLs whose execution time exceeds the parameter log_min_duration_statement, which can be adjusted according to business needs. ≥ 0 1 minute
slow_sql_one_second SQLs Executed Longer Than 1 Second This metric counts the number of SQLs whose execution time exceeds 1 second. ≥ 0 1 minute
slow_sql_three_second SQLs Executed Longer Than 3 Seconds This metric counts the number of SQLs whose execution time exceeds 3 seconds. ≥ 0 1 minute
slow_sql_five_second SQLs Executed Longer Than 5 Seconds This metric counts the number of SQLs whose execution time exceeds 5 seconds. ≥ 0 1 minute

Object

The collected Huawei Cloud RDS PostgreSQL object data structure can be seen in 「Infrastructure - Resource Catalog」

{
  "measurement": "huaweicloud_rds_postgresql",
  "tags": {
    "name"                   : "1d0c91561f4644daxxxxx68304b0520din01",
    "id"                     : "1d0c91561f4644dxxxxxxd68304b0520din01",
    "instance_name"          : "rds-df54-xxxx",
    "status"                 : "ACTIVE",
    "port"                   : "5432",
    "type"                   : "Single",
    "RegionId"               : "cn-north-4",
    "security_group_id"      : "d13ebb59-d4fe-xxxx-xxxx-c22bcea6f987",
    "switch_strategy"        : "xxx",
    "project_id"             : "c631f046252dxxxxxxxf253c62d48585",
    "time_zone"              : "UTC+08:00",
    "enable_ssl"             : "False",
    "charge_info.charge_mode": "postPaid",
    "engine"                 : "PostgreSQL",
    "engine_version"         : "14"
  },
  "fields": {
    "created_time"    : "2022-06-21T06:17:27+0000",
    "updated_time"    : "2022-06-21T06:20:03+0000",
    "alias"           : "xxx",
    "private_ips"     : "[\"192.xxx.x.144\"]",
    "public_ips"      : "[]",
    "datastore"       : "{Database Information}",
    "cpu"             : "2",
    "mem"             : "4",
    "volume"          : "{Volume Information}",
    "nodes"           : "[{Primary and Standby Instance Information}]",
    "related_instance": "[]",
    "backup_strategy" : "{Backup Strategy}",
    "message"         : "{Instance JSON Data}"
  }
}

Note: The fields in tags and fields may change with subsequent updates

Tip 1: The value of tags.name is the instance ID, used as the unique identifier

Tip 2: The following fields are JSON serialized strings

  • fields.message
  • fields.private_ips
  • fields.public_ips
  • fields.volume
  • fields.nodes
  • fields.related_instance
  • fields.backup_strategy

Tip 3: The type value can be “Single”, “Ha”, “Replica”, or "Enterprise", corresponding to single instance, primary-standby instance, read-only instance, and distributed instance (Enterprise Edition) respectively.