Retrieves monitoring metrics for a lightweight database instance.
Operation description
After you create a lightweight database instance, you can retrieve its detailed monitoring metrics. These metrics include CPU and memory usage, disk space, IOPS (Input/Output Operations Per Second), and the number of connections.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
swas-open:DescribeDatabaseInstanceMetricData |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the lightweight database instance. You can call the ListRegions operation to get the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| DatabaseInstanceId |
string |
Yes |
The ID of the lightweight database instance. |
db-38263fa955774501a2ae1bdaed6f**** |
| MetricName |
string |
Yes |
The name of the metric. Valid values:
|
MySQL_MemCpuUsage |
| StartTime |
string |
Yes |
The start of the time range to query. Specify the time in the ISO 8601 standard in the Note
The time in the console is displayed in UTC+8. |
2022-09-06T04:04Z |
| EndTime |
string |
Yes |
The end of the time range to query. Specify the time in the ISO 8601 standard in the Note
The time in the console is displayed in UTC+8. |
2022-09-07T04:04Z |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The request ID. |
30637AD6-D977-4833-A54C-CC89483E**** |
| MetricName |
string |
The name of the metric. Valid values:
|
MySQL_MemCpuUsage |
| Unit |
string |
The unit of the metric data.
|
% |
| DataFormat |
string |
The format of the metric data. Valid values:
|
cpuusage&memusage |
| MetricData |
string |
The metric data details. |
[ { \"date"\: " 2022-09-06T04:04:00Z",\"value\":\"0.77&3.69\" } ] |
Examples
Success response
JSON format
{
"RequestId": "30637AD6-D977-4833-A54C-CC89483E****",
"MetricName": "MySQL_MemCpuUsage",
"Unit": "%",
"DataFormat": "cpuusage&memusage",
"MetricData": "[ { \\\"date\"\\: \" 2022-09-06T04:04:00Z\",\\\"value\\\":\\\"0.77&3.69\\\" } ]"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.