AWS RDS MySQL¶
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 enable Guance Integration - Extension - Hosted Func: All prerequisites are automatically installed, please continue with script installation.
If you deploy Func manually, refer to Manual Deployment of Func
Install Script¶
Note: Please prepare an Amazon AK that meets the requirements in advance (for simplicity, you can directly grant global read-only permission
ReadOnlyAccess
).
Hosted Edition Script Activation¶
- Log in to the Guance console.
- Click on the 【Integration】menu and select 【Cloud Account Management】.
- Click 【Add Cloud Account】, choose 【AWS】, and fill in the required information on the interface. If you have already configured cloud account information before, skip this step.
- Click 【Test】. After a successful test, click 【Save】. If the test fails, check whether the relevant configuration information is correct and retest.
- In the 【Cloud Account Management】list, you can see the added cloud accounts. Click on the corresponding cloud account to enter the details page.
- Click the 【Integration】 button on the cloud account details page. Under the
Not Installed
list, findAWS RDS MySQL
, click the 【Install】 button, and install it from the 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
. -
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 scripts automatically. -
After enabling, you can see the corresponding automatic trigger configuration under "Management / Automatic Trigger Configuration". Click 【Execute】 to run it immediately without waiting for the scheduled time. Wait a moment, and you can view the execution task records and corresponding logs.
Verification¶
- Confirm under "Management / Automatic Trigger Configuration" whether the corresponding task has an automatic trigger configuration. You can also check the corresponding task records and logs for any abnormalities.
- In Guance, under "Infrastructure / Custom", check if there is asset information.
- In Guance, under "Metrics", check if there is corresponding monitoring data.
Metrics¶
After configuring Amazon-CloudWatch, the default metric sets are as follows. You can collect more metrics through configuration. Amazon CloudWatch Metrics Details
Amazon RDS Instance-Level Metrics in Amazon CloudWatch¶
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 the same 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 made to connect to the instance, regardless of success. | Count |
CPUUtilization |
CPU Utilization (Percentage) | Percentage of CPU usage. | Percentage |
CPUCreditUsage |
CPU Credit Usage (Count) | (T2 Instances) Number of CPU credits spent by the instance to maintain CPU usage. 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. The CPU credit metric is only provided every five minutes. If you specify a time period greater than five minutes, use the Sum statistic instead of the Average statistic. |
Credits (vCPU Minutes) |
CPUCreditBalance |
CPU Credit Balance (Count) | (T2 Instances) Number of CPU credits accumulated by the instance since launch. For T2 Standard, CPUCreditBalance also includes accumulated launch credits. After gaining 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 gained credits are discarded. For T2 Standard, launch credits do not count towards the limit. The instance can spend credits in CPUCreditBalance to burst above the baseline CPU usage. During instance operation, credits in CPUCreditBalance do not expire. When the instance stops, CPUCreditBalance is not retained, and all accumulated credits are lost. The CPU credit metric is only provided every five minutes. Launch credits work the same way in Amazon RDS as they do 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 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 parallel execution feature of the database engine, or sessions created by the task scheduler of the database engine. 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 throughput credits remaining 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, rather than just the volumes containing the database files. To find instance sizes that support this metric, see the table of Default Optimized EBS Instances marked with an asterisk (*) in the Amazon EC2 User Guide for Linux Instances. The Sum statistic does not apply to this metric. |
Percentage |
EBSIOBalance% |
EBS IO Balance (Percentage) | Percentage of I/O credits remaining 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, rather than just the volumes containing the database files. To find instance sizes that support this metric, see the table of Default Optimized EBS Instances marked with an asterisk (*) in the Amazon EC2 User Guide for Linux Instances. This metric differs from BurstBalance . For more information on 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 that failed in the past one minute. | Count per Minute |
FreeableMemory |
Freeable Memory (MB) | Available random-access memory size. 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) | Size of available local storage space. This metric only applies 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) | Size of available 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 (received) network traffic for 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 (transmitted) network traffic for 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 of the replica that is farthest behind 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 only applies 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 only applies 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 only applies 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 a 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 only applies 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 to local storage. This metric only applies 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 per second to local storage. This metric only applies 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 |
Amazon RDS Usage Metrics in Amazon CloudWatch¶
The AWS/Usage
namespace in Amazon CloudWatch includes account-level usage metrics for Amazon RDS service quotas. CloudWatch automatically collects usage metrics for all AWS regions.
For more information, see CloudWatch Usage Metrics in the Amazon CloudWatch User Guide. For more information about quotas, see Quotas and Limits for Amazon RDS and Requesting an Increase in Quota in the Service Quotas User Guide.
Metric | Description | Unit* |
---|---|---|
AllocatedStorage |
Total storage space for all database instances. The sum excludes temporary migration instances. | Gigabytes |
DBClusterParameterGroups |
Number of DB cluster parameter groups in your AWS account. This count excludes default parameter groups. | Count |
DBClusters |
Number of Amazon Aurora DB clusters in your AWS account. | Count |
DBInstances |
Number of DB instances in your AWS account. | Count |
DBParameterGroups |
Number of DB parameter groups in your AWS account. This count excludes default DB parameter groups. | Count |
DBSecurityGroups |
Number of security groups in your AWS account. This count excludes default security groups and default VPC security groups. | Count |
DBSubnetGroups |
Number of DB subnet groups in your AWS account. This count excludes default subnet groups. | Count |
ManualClusterSnapshots |
Number of manual DB cluster snapshots in your AWS account. This count excludes invalid snapshots. | Count |
ManualSnapshots |
Number of manual DB snapshots in your AWS account. This count excludes invalid snapshots. | Count |
OptionGroups |
Number of option groups in your AWS account. This count excludes default option groups. | Count |
ReservedDBInstances |
Number of reserved DB instances in your AWS account. This count excludes disabled or rejected instances. | Count |
- Amazon RDS does not publish the units of usage metrics to CloudWatch. These units appear only in the documentation.
Objects¶
Data structure of collected AWS RDS MySQL objects, which can be viewed under "Infrastructure - Custom".
{
"measurement": "aws_rds",
"tags": {
"name" : "xxxxx",
"RegionId" : "cn-northwest-1",
"Engine" : "mysql",
"DBInstanceClass" : "db.t3.medium",
"DBInstanceIdentifier" : "xxxxxx",
"AvailabilityZone" : "cn-northwest-1c",
"SecondaryAvailabilityZone": "cn-northwest-1d"
},
"fields": {
"InstanceCreateTime" : "2018-03-28T19:54:07.871Z",
"LatestRestorableTime": "2018-03-28T19:54:07.871Z",
"Endpoint" : "{JSON connection address data}",
"AllocatedStorage" : 100,
"message" : "{JSON serialized instance data}",
}
}
Note: Fields in
tags
andfields
may change with subsequent updates.Tip 1: The value of
tags.name
is the instance ID, serving as unique identification.Tip 2:
fields.message
andfields.Endpoint
are JSON serialized string data.