Skip to content

Alibaba Cloud RDS MySQL

Alibaba Cloud RDS MySQL Metrics display, including CPU usage, memory usage, IOPS, network bandwidth, InnoDB, TPS, QPS, etc.

Configuration

Install Func

It is recommended to activate the Guance Integration - Extension - DataFlux Func (Automata)

For self-deploying Func, refer to Self-deploying Func

Activate Script

Note: Please prepare the Alibaba Cloud AK that meets the requirements in advance (for simplicity, you can directly grant the global read-only permission ReadOnlyAccess)

Activate Script on Managed Version

  1. Log in to the Guance console.
  2. Click the [Integration] menu, select [Cloud Account Management].
  3. Click [Add Cloud Account], select [Alibaba Cloud], fill in the required information on the interface. If the cloud account information has been configured before, ignore this step.
  4. Click [Test]. After the test is successful, click [Save]. If the test fails, please check if the relevant configuration information is correct and test again.
  5. Click on the cloud account list in [Cloud Account Management] to see the added cloud account. Click on the corresponding cloud account to enter the details page.
  6. Click the [Integration] button on the cloud account details page. Under the Not Installed list, find Alibaba Cloud RDS MySQL, click the [Install] button, and install it in the pop-up installation interface.

Activate Script Manually

  1. Log in to the Func console, click [Script Market], enter the Guance script market, search for: integration_alibabacloud_rds.

  2. Click [Install], then enter the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.

  3. Click [Deploy Startup Script]. The system will automatically create the Startup script set and automatically configure the corresponding startup script.

  4. After activation, you can see the corresponding automatic trigger configuration in [Management / Automatic Trigger Configuration]. Click [Execute] to execute immediately once without waiting for the scheduled time. Wait a moment, you can view the execution task records and corresponding logs.

Verification

  1. In [Management / Automatic Trigger Configuration], confirm whether the corresponding task has the corresponding automatic trigger configuration. You can also check the corresponding task records and logs to see if there are any exceptions.
  2. In Guance, check [Infrastructure / Custom] to see if there is asset information.
  3. In Guance, check [Metrics] to see if there is corresponding monitoring data.

Metrics

After configuring Alibaba Cloud CloudMonitor, the default Measurement is as follows. More Metrics can be collected through configuration. Alibaba Cloud CloudMonitor Metric Details

Metric Id Metric Name Dimensions Statistics Unit
ConnectionUsage Connection Usage Rate userId,instanceId Average,Minimum,Maximum %
CpuUsage CPU Usage userId,instanceId Average,Minimum,Maximum %
DiskUsage Disk Usage Rate userId,instanceId Average,Minimum,Maximum %
IOPSUsage IOPS Usage Rate userId,instanceId Average,Minimum,Maximum %
MemoryUsage Memory Usage Rate userId,instanceId Average,Minimum,Maximum %
MySQL_ComDelete MySQL Deletes Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ComInsert MySQL Inserts Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ComInsertSelect MySQL InsertSelects Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ComReplace MySQL Replaces Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ComReplaceSelect MySQL ReplaceSelects Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ComSelect MySQL Selects Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ComUpdate MySQL Updates Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_DataDiskSize MySQL_Data Disk Usage userId,instanceId Average,Maximum,Minimum Megabytes
MySQL_IbufDirtyRatio MySQL_BP Dirty Page Percentage userId,instanceId Average,Maximum,Minimum %
MySQL_IbufReadHit MySQL_BP Read Hit Rate userId,instanceId Average,Maximum,Minimum %
MySQL_IbufRequestR MySQL Logical Reads Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_IbufRequestW MySQL Logical Writes Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_IbufUseRatio MySQL_BP Utilization Rate userId,instanceId Average,Maximum,Minimum %
MySQL_InnoDBDataRead MySQL_InnoDB Data Read Per Second userId,instanceId Average,Maximum,Minimum Kbyte
MySQL_InnoDBDataWritten MySQL_InnoDB Data Written Per Second userId,instanceId Average,Maximum,Minimum Kbyte
MySQL_InnoDBLogFsync MySQL_InnoDB Log Fsyncs Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InnoDBLogWriteRequests MySQL_InnoDB Log Write Requests Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InnoDBLogWrites MySQL_InnoDB Log Physical Writes Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InnoDBRowDelete MySQL_InnoDB Rows Deleted Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InnoDBRowInsert MySQL_InnoDB Rows Inserted Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InnoDBRowRead MySQL_InnoDB Rows Read Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InnoDBRowUpdate MySQL_InnoDB Rows Updated Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_InstanceDiskSize MySQL_Instance Disk Usage userId,instanceId Average,Maximum,Minimum Megabytes
MySQL_LogDiskSize MySQL_Log Disk Usage userId,instanceId Average,Maximum,Minimum Megabytes
MySQL_NetworkInNew MySQL Network Inbound Bandwidth userId,instanceId Average,Minimum,Maximum bits/s
MySQL_NetworkOutNew MySQL Network Outbound Bandwidth userId,instanceId Average,Minimum,Maximum bits/s
MySQL_OtherDiskSize MySQL_Other Disk Usage userId,instanceId Average,Maximum,Minimum Megabytes
MySQL_QPS MySQL Queries Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_SlowQueries MySQL Slow Queries Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_TPS MySQL Transactions Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_TempDiskTableCreates MySQL Temporary Tables Created Per Second userId,instanceId Average,Maximum,Minimum countSecond
MySQL_ThreadsConnected MySQL_Thread Connections userId,instanceId Average,Maximum,Minimum count
MySQL_ThreadsRunning MySQL_Active Threads userId,instanceId Average,Maximum,Minimum count

Object

The collected Alibaba Cloud SLB object data structure can be seen from [Infrastructure - Custom].

{
  "measurement": "aliyun_rds",
  "tags": {
    "name"                 : "rm-xxxxx",
    "DBInstanceType"       : "Primary",
    "PayType"              : "Prepaid",
    "Engine"               : "MySQL",
    "DBInstanceClass"      : "rds.mysql.s2.large",
    "DBInstanceId"         : "rm-xxxxx",
    "ZoneId"               : "cn-shanghai-h",
    "RegionId"             : "cn-shanghai",
    "DBInstanceDescription": "Business System",
    "LockMode"             : "Unlock",
    "Category"             : "Basic",
    "ConnectionMode"       : "Standard",
    "DBInstanceNetType"    : "Intranet",
    "DBInstanceStorageType": "local_ssd",
  },
  "fields": {
    "CreationTime"     : "2022-12-13T16:00:00Z",
    "ExpireTime"       : "2022-12-13T16:00:00Z",
    "DiskUsed"         : "10000",
    "BackupSize"       : "10000",
    "LogSize"          : "10000",
    "BackupLogSize"    : "10000",
    "BackupDataSize"   : "10000",
    "ConnectionString" : "{Connection Address JSON Data}",
    "DBInstanceStorage": "100",
    "accounts"         : "{User Permission Information JSON Data}",
    "databases"        : "{Database Information JSON Data}",
    "SSLExpireTime"    : "2022-10-11T08:16:43Z",
    "message"          : "{Instance JSON Data}",
  }
}

Logging

Slow Query Details

Slow Query Details Prerequisites

Note: The code operation of this script depends on the RDS instance object collection. If the custom object collection for RDS is not configured, the slow log script cannot collect slow log data.

Slow Query Details Installation Script

On the previous basis, you need to install another script package for RDS Slow Query Details Log Collection.

In [Management / Script Market], click and install the corresponding script package:

  • [Guance Integration (Alibaba Cloud-RDS Slow Query Details Log Collection)] (ID: integration_alibabacloud_rds_slowlog_record)

After the data is synchronized normally, you can view the data in [Logging] of Guance.

The reported data example is as follows:

{
  "measurement": "aliyun_rds_slowlog_record",
  "tags": {
    "name"                 : "rm-xxxxx",
    "DBName"               : "cloudcare_core",
    "DBInstanceId"         : "rm-bp1xxxxxxxxxx",
    "RegionId"             : "cn-hangzhou",
    "DBInstanceType"       : "Primary",
    "PayType"              : "Prepaid",
    "Engine"               : "MySQL",
    "DBInstanceClass"      : "rds.mysql.s2.large",
    "ZoneId"               : "cn-shanghai-h",
    "DBInstanceDescription": "Business System",
    "HostAddress"          : "xxxx",
    "UserName"             : "xxxx",
    "ClientHostName"       : "xxxx",
    "ApplicationName"      : "xxxx",

  },
  "fields": {
    "SQLHASH"                      : "436f9dd030e0a87920bbcd818b34f271",
    "SQLText"                      : "{SQL Statement}",
    "QueryTimes"                   : 0,
    "QueryTimesMS"                 : 0,
    "ReturnRowCounts"              : 0,
    "ParseRowCounts"               : 0,
    "ExecutionStartTime"           : "2022-02-02T12:00:00Z",
    "CpuTime"                      : 1,
    "RowsAffectedCount"            : 0,
    "LastRowsAffectedCount"        : 0,
    "message"                      : "{Log JSON Data}"
  }
}

Some parameter descriptions are as follows:

Field Type Description
QueryTimes int Execution duration. Unit: second (s)
QueryTimesMS int Execution duration. Unit: millisecond (ms)
ReturnRowCounts int Rows returned
ParseRowCounts int Rows parsed
ExecutionStartTime str Execution start time
CpuTime int CPU processing time
RowsAffectedCount int Rows affected
LastRowsAffectedCount int Rows affected by the last statement

Note: Fields such as CpuTime, RowsAffectedCount, LastRowsAffectedCount are only supported by SQL Server instances. Note: Fields in tags and fields may change with subsequent updates. Note: fields.message is a JSON serialized string.

Feedback

Is this page helpful? ×