Alibaba Cloud RDS SQLServer¶
Alibaba Cloud RDS SQLServer Metrics display, including CPU usage, memory usage, IOPS, network bandwidth, InnoDB, TPS, QPS, etc.
Configuration¶
Install Func¶
Recommended to activate Guance Integration - Extensions - DataFlux Func (Automata)
For self-deploying Func, refer to Self-deploying Func
Activate Script¶
Note: Please prepare Alibaba Cloud AK that meets the requirements in advance (for simplicity, you can directly grant the global read-only permission
ReadOnlyAccess)
Managed Version Activation Script¶
- Log in to the Guance console
- Click the [Integration] menu, select [Cloud Account Management]
- 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.
- Click [Test], after a successful test, click [Save]. If the test fails, please check whether the relevant configuration information is correct and test again.
- Click [Cloud Account Management] list to see the added cloud accounts, click the corresponding cloud account to enter the details page.
- Click the [Integration] button on the cloud account details page, find
Alibaba Cloud RDS SQLServerunder theNot installedlist, click the [Install] button, and install it in the pop-up installation interface.
Manual Activation Script¶
-
Log in to the Func console, click [Script Market], enter the Guance script market, search:
integration_alibabacloud_rds -
After clicking [Install], enter the corresponding parameters: Alibaba Cloud AK ID, AK Secret, and account name.
-
Click [Deploy Startup Script], the system will automatically create a
Startupscript set and automatically configure the corresponding startup scripts. -
After activation, you can see the corresponding automatic trigger configuration in "Management / Automatic Trigger Configuration". Click [Execute] to execute it immediately once without waiting for the scheduled time. Wait a moment, you can view the execution task records and corresponding logs.
Verification¶
- In "Management / Automatic Trigger Configuration", confirm whether the corresponding task has the corresponding automatic trigger configuration, and you can also check the corresponding task records and logs to see if there are any exceptions.
- In Guance, check whether asset information exists in "Infrastructure / Custom".
- In Guance, check whether there is corresponding monitoring data in "Metrics".
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 |
|---|---|---|---|---|
| SQLServer_CpuUsage | SQLServer CPU Usage | userId,instanceId | Average,Maximum,Minimum | % |
| SQLServer_DiskUsage | SQLServer Disk Usage | userId,instanceId | Average,Maximum,Minimum | % |
| SQLServer_IOPS | SQLServer IOPS | userId,instanceId | Average,Maximum,Minimum | countSecond |
| SQLServer_NetworkRead | SQLServer Network Outbound Bandwidth | userId,instanceId | Average,Maximum,Minimum | bits/s |
| SQLServer_NetworkWrite | SQLServer Network Inbound Bandwidth | userId,instanceId | Average,Maximum,Minimum | bits/s |
| SQLServer_QPS | SQLServer Queries Per Second | userId,instanceId | Average,Maximum,Minimum | countSecond |
| SQLServer_TPS | SQLServer Transactions Per Second | userId,instanceId | Average,Maximum,Minimum | countSecond |
| SQLServer_TotaConn | SQLServer Total Connections | userId,instanceId | Average,Maximum,Minimum | count |
Object¶
The collected Alibaba Cloud RDS object data structure can be seen in "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 corresponding to 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 the "Log" section of Guance.
The reported data example is as follows:
{
"measurement": "aliyun_rds_slowlog",
"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}"
}
}
Partial parameter descriptions are as follows:
| Field | Type | Description |
|---|---|---|
QueryTimes |
int | Execution duration. Unit: seconds (s) |
QueryTimesMS |
int | Execution duration. Unit: milliseconds (ms) |
ReturnRowCounts |
int | Returned rows |
ParseRowCounts |
int | Parsed rows |
ExecutionStartTime |
str | Execution start time |
CpuTime |
int | CPU processing duration |
RowsAffectedCount |
int | Affected rows |
LastRowsAffectedCount |
int | Last statement affected rows |
Note: Fields such as
CpuTime,RowsAffectedCount,LastRowsAffectedCountare only supported by SQL Server instances. Note: Fields intagsandfieldsmay change with subsequent updates. *Tip:fields.messageis a JSON serialized string.