AWS RDS PostgreSQL
Use the script package series of "Guance Cloud Sync" in the script market to synchronize cloud monitoring and cloud asset data to Guance
Configuration¶
Install Func¶
It is recommended to activate Guance Integration - Extension - Hosted Func: all prerequisites are automatically installed. Please proceed with the script installation.
If you deploy Func on your own, refer to Self-deploy Func
Install Script¶
Note: Please prepare the required Amazon AK in advance (for simplicity, you can directly grant global read-only permission
ReadOnlyAccess
).
Hosted Edition Script Activation¶
- Log in to Guance Console
- Click the 【Integration】 menu and select 【Cloud Account Management】
- Click 【Add Cloud Account】, choose 【AWS】, and fill in the information required on the interface. If you have configured cloud account information before, skip this step.
- Click 【Test】. After a successful test, click 【Save】. If the test fails, check whether the related configuration information is correct and retest.
- In the 【Cloud Account Management】 list, you can see the added cloud account. Click the corresponding cloud account to enter the details page.
- On the cloud account detail page, click the 【Integration】 button. Under the
Not Installed
list, findAWS RDS PostgreSQL
, click the 【Install】 button, and install it via the pop-up installation interface.
Manual Script Activation¶
- Log in to the Func Console, click 【Script Market】, enter the official script market, and search for
guance_aws_rds_postgresql
- After clicking 【Install】, input the corresponding parameters: AWS AK ID, AK Secret, and account name.
- Click 【Deploy Startup Script】, and the system will automatically create a
Startup
script set and configure the corresponding startup script. - After enabling, you can see the corresponding automatic trigger configuration in the 「Management / Automatic Trigger Configuration」. Click 【Execute】 to immediately run once without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.
Verification¶
- Confirm in 「Management / Automatic Trigger Configuration」 whether the corresponding task has an automatic trigger configuration, and at the same time, you can view the corresponding task records and logs to check for any anomalies.
- In Guance, under 「Infrastructure - Resource Catalog」, check if there is any asset information.
- In Guance, under 「Metrics」, check if there is any corresponding monitoring data.
Metrics¶
Configure Amazon - CloudWatch by configuring more metrics Amazon CloudWatch Metric Details
Amazon RDS Amazon CloudWatch Metrics¶
The AWS/RDS
namespace in Amazon CloudWatch includes the following instance-level metrics.
Note: The Amazon RDS console may display metrics in units different from those sent to Amazon CloudWatch. For example, the Amazon RDS console might display a metric in megabytes (MB), while sending that metric to Amazon CloudWatch in bytes.
Metric | Console Name | Description | Unit |
---|---|---|---|
BinLogDiskUsage |
Binary Log Disk Usage (MB) | Size of disk space occupied by binary logs. Binary logs are created if automatic backups are enabled for MySQL and MariaDB instances (including read replicas). | Bytes |
BurstBalance |
Burst Balance (Percentage) | Percentage of available general-purpose SSD (GP2) burst bucket I/O credits. | Percentage |
CheckpointLag |
Checkpoint Lag (Milliseconds) | Time since the last checkpoint. Only applicable to RDS for PostgreSQL. | Milliseconds |
ConnectionAttempts |
Connection Attempts (Count) | Number of attempts to connect to the instance, regardless of success or failure. | Count |
CPUUtilization |
CPU Utilization (Percentage) | Percentage of CPU usage. | Percentage |
CPUCreditUsage |
CPU Credit Usage (Count) | (T2 Instances) CPU credits spent by the instance to maintain CPU utilization. One CPU credit equals one vCPU running at 100% utilization for one minute or equivalent combinations of vCPU, utilization, and time. For example, you could have one vCPU running at 50% utilization for two minutes, or two vCPUs running at 25% utilization for two minutes. CPU credit metrics are only provided every five minutes. If you specify a time period greater than five minutes, use the Sum statistic rather than the Average statistic. |
Credits (vCPU Minutes) |
CPUCreditBalance |
CPU Credit Balance (Count) | (T2 Instances) CPU credits accumulated by the instance since launch. For T2 Standard, CPUCreditBalance also includes accumulated launch credits. After earning credits, they accumulate in the credit balance; after spending credits, they are deducted from the credit balance. The credit balance has a maximum limit determined by the instance size. After reaching the limit, any newly earned credits are discarded. For T2 Standard, launch credits do not count toward the limit. The instance can spend credits in CPUCreditBalance to burst above the baseline CPU utilization. During the instance's operation, credits in CPUCreditBalance do not expire. When the instance stops, CPUCreditBalance is not retained, and all accumulated credits are lost. CPU credit metrics are only provided every five minutes. Launch credits work in Amazon RDS the same way they work in Amazon EC2. For more information, see Launch Credits in the Amazon Elastic Compute Cloud User Guide for Linux Instances. |
Credits (vCPU Minutes) |
DatabaseConnections |
Database Connections (Count) | Number of client network connections to the database instance. The number of database sessions may be higher than the metric value because the metric value does not include the following: sessions that no longer have a network connection but have not yet been cleaned up by the database, sessions created by the database engine for its own purposes, sessions created by the database engine's parallel execution feature, sessions created by the database engine's task scheduler, Amazon RDS connections | Count |
DiskQueueDepth |
Queue Depth (Count) | Number of outstanding I/O (read/write requests) waiting to access the disk. | Count |
EBSByteBalance% |
EBS Byte Balance (Percentage) | Percentage of remaining throughput credits in the RDS database burst bucket. This metric is only available for basic monitoring. The metric value is based on the throughput and IOPS of all volumes, including the root volume, not just the volumes containing database files. To find the instance sizes supporting this metric, see the instance sizes marked with an asterisk () in the Default Optimized EBS Table in the *Amazon EC2 User Guide for Linux Instances. Sum statistics do not apply to this metric. |
Percentage |
EBSIOBalance% |
EBS IO Balance (Percentage) | Percentage of remaining I/O credits in the RDS database burst bucket. This metric is only available for basic monitoring. The metric value is based on the throughput and IOPS of all volumes, including the root volume, not just the volumes containing database files. To find the instance sizes supporting this metric, see the instance sizes marked with an asterisk () in the Default Optimized EBS Table in the *Amazon EC2 User Guide for Linux Instances. This metric differs from BurstBalance . For more information about how to use this metric, see Improving Application Performance and Reducing Costs with Amazon EBS Optimized Instance Burst Capability. |
Percentage |
FailedSQLServerAgentJobsCount |
Failed SQL Server Agent Jobs Count (Count/Minute) | Number of Microsoft SQL Server Agent jobs failed in the past minute. | Count per Minute |
FreeableMemory |
Freeable Memory (MB) | Amount of available random access memory. For MariaDB, MySQL, Oracle, and PostgreSQL database instances, this metric reports the value of the MemAvailable field in /proc/meminfo . |
Bytes |
FreeLocalStorage |
Free Local Storage (MB) | Amount of free local storage space. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. (This does not apply to Aurora Serverless v2.) | Bytes |
FreeStorageSpace |
Free Storage Space (MB) | Amount of free storage space. | Bytes |
MaximumUsedTransactionIDs |
Maximum Used Transaction IDs (Count) | Maximum transaction ID used. Only applicable to PostgreSQL. | Count |
NetworkReceiveThroughput |
Network Receive Throughput (MB/Second) | Incoming (receive) network traffic to the database instance, including customer database traffic and Amazon RDS traffic for monitoring and replication. | Bytes per Second |
NetworkTransmitThroughput |
Network Transmit Throughput (MB/Second) | Outgoing (transmit) network traffic from the database instance, including customer database traffic and Amazon RDS traffic for monitoring and replication. | Bytes per Second |
OldestReplicationSlotLag |
Oldest Replication Slot Lag (MB) | Lag size for the most lagging replica in receiving prewritten log (WAL) data. Applicable to PostgreSQL. | Bytes |
ReadIOPS |
Read IOPS (Count/Second) | Average number of disk read I/O operations per second. | Count per Second |
ReadIOPSLocalStorage |
Read IOPS Local Storage (Count/Second) | Average number of disk read input/output operations per second to local storage. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. | Count per Second |
ReadLatency |
Read Latency (Milliseconds) | Average time required for each disk I/O operation. | Milliseconds |
ReadLatencyLocalStorage |
Read Latency Local Storage (Milliseconds) | Average time required for each disk input/output operation to local storage. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. | Milliseconds |
ReadThroughput |
Read Throughput (MB/Second) | Average number of bytes read from disk per second. | Bytes per Second |
ReadThroughputLocalStorage |
Read Throughput Local Storage (MB/Second) | Average number of bytes read from disk to local storage per second. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. | Bytes per Second |
ReplicaLag |
Replica Lag (Milliseconds) | Amount of time the read replica database instance lags behind the source database instance for read-only replica configurations. Applicable to MariaDB, Microsoft SQL Server, MySQL, Oracle, and PostgreSQL read replicas. For Multi-AZ database clusters, the time difference between the latest transaction on the writer database instance and the latest applied transaction on the reader database instance. | Milliseconds |
ReplicationSlotDiskUsage |
Replication Slot Disk Usage (MB) | Disk space used by replication slot files. Applicable to PostgreSQL. | Bytes |
SwapUsage |
Swap Usage (MB) | Size of swap space used on the database instance. Not available for SQL Server. | Bytes |
TransactionLogsDiskUsage |
Transaction Logs Disk Usage (MB) | Disk space used by transaction logs. Applicable to PostgreSQL. | Bytes |
TransactionLogsGeneration |
Transaction Logs Generation (MB/Second) | Size of transaction logs generated per second. Applicable to PostgreSQL. | Bytes per Second |
WriteIOPS |
Write IOPS (Count/Second) | Average number of disk write I/O operations per second. | Count per Second |
WriteIOPSLocalStorage |
Write IOPS Local Storage (Count/Second) | Average number of disk write I/O operations per second to local storage. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. | Count per Second |
WriteLatency |
Write Latency (Milliseconds) | Average time required for each disk I/O operation. | Milliseconds |
WriteLatencyLocalStorage |
Write Latency Local Storage (Milliseconds) | Average time required for each disk I/O operation on local storage. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. | Milliseconds |
WriteThroughput |
Write Throughput (MB/Second) | Average number of bytes written to disk per second. | Bytes per Second |
WriteThroughputLocalStorage |
Write Throughput Local Storage (MB/Second) | Average number of bytes written to disk to local storage per second. This metric applies only to database instance classes with NVMe SSD instance store volumes. For information about Amazon EC2 instances with NVMe SSD instance store volumes, see Instance Store Volumes. Equivalent RDS database instance classes have the same instance store volumes. For example, db.m6gd and db.r6gd database instance classes have NVMe SSD instance store volumes. | Bytes per Second |
Objects¶
Data structure of collected AWS RDS PostgreSQL objects, which can be viewed in the 「Infrastructure - Resource Catalog」.
{
"measurement": "aws_rds",
"tags": {
"name" : "xxxxx",
"RegionId" : "cn-northwest-1",
"Engine" : "postgres",
"DBInstanceClass" : "db.t3.medium",
"DBInstanceIdentifier" : "xxxxxx",
"AvailabilityZone" : "cn-northwest-1c",
"SecondaryAvailabilityZone": "ap-southeast-1c"
},
"fields": {
"InstanceCreateTime" : "2025-05-19T19:54:07.871Z",
"LatestRestorableTime": "2025-05-19T19:54:07.871Z",
"Endpoint" : "{connection address JSON data}",
"AllocatedStorage" : 100,
"message" : "{instance JSON data}",
}
}
Note: Fields in
tags
andfields
may change with subsequent updates.Tip 1: The value of
tags.name
is the instance ID, used as a unique identifier.Tip 2: Both
fields.message
andfields.Endpoint
are serialized JSON strings.