You can call the DescribeAvailableMetrics operation to query the Enhanced Monitoring metrics that are available for an ApsaraDB RDS for PostgreSQL instance.
Prerequisites
Before you call this operation, make sure that the instance runs PostgreSQL.
For more information, see View the Enhanced Monitoring metrics of an ApsaraDB RDS for PostgreSQL instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeAvailableMetrics |
The operation that you want to perform. Set the value to DescribeAvailableMetrics. |
DBInstanceName | String | Yes | pgm-bp1s1j103lo6**** |
The ID of the instance. You can call the DescribeDBInstances operation to query the IDs of instances. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Items | Array of Metrics |
An array that consists of the Enhanced Monitoring metrics that are available for the instance. |
|
Description | String | OS CPU utilization, equal to the number of OS-consumed CPUs divided by the total number of CPUs |
The description of the Enhanced Monitoring metric. |
Dimension | String | os |
The category of the Enhanced Monitoring metric. Valid values:
|
GroupKey | String | os.cpu_usage |
The key of the group to which the Enhanced Monitoring metric belongs. |
GroupKeyType | String | CPU utilization |
The name of the group to which the Enhanced Monitoring metric belongs. |
Method | String | avg |
The method that is used to aggregate the monitoring data of the Enhanced Monitoring metric. Valid values:
|
MetricsKey | String | os.cpu_usage.sys.avg |
The key of the Enhanced Monitoring metric. |
MetricsKeyAlias | String | cpu_sys_per_core |
The alias of the Enhanced Monitoring metric. |
SortRule | Integer | 1 |
The serial number of the Enhanced Monitoring metric. |
Unit | String | % |
The unit of the Enhanced Monitoring metric. |
RequestId | String | 5CD61041-35F7-10F7-BE94-33A48B221218 |
The ID of the request. |
TotalRecordCount | Integer | 4 |
The total number of Enhanced Monitoring metrics that are available for the instance. |
Examples
Sample requests
http(s)://rds.aliyun.cs/?Action=DescribeAvailableMetrics
&DBInstanceName=pgm-bp1s1j103lo6****
&<Common request parameters>
Sample success responses
XML
format
<DescribeAvailableMetricsResponse>
<TotalRecordCount>2</TotalRecordCount>
<RequestId>A467D279-68A8-57B3-BDA4-35F8B3DDB1B7</RequestId>
<Items>
<Description>OS CPU utilization, equal to the number of OS-consumed CPUs divided by the total number of CPUs</Description>
<MetricsKey>os.cpu_usage.sys.avg</MetricsKey>
<GroupKeyType>CPU utilization</GroupKeyType>
<GroupKey>os.cpu_usage</GroupKey>
<Method>avg</Method>
<Dimension>os</Dimension>
<Unit>%</Unit>
<SortRule>1</SortRule>
<DbType>pgsql</DbType>
<MetricsKeyAlias>os.cpu_usage.sys</MetricsKeyAlias>
</Items>
<Items>
<Description>User CPU utilization, equal to the number of user-consumed CPUs divided by the total number of CPUs</Description>
<MetricsKey>os.cpu_usage.user.avg</MetricsKey>
<GroupKeyType>CPU utilization</GroupKeyType>
<GroupKey>os.cpu_usage</GroupKey>
<Method>avg</Method>
<Dimension>os</Dimension>
<Unit>%</Unit>
<SortRule>2</SortRule>
<DbType>pgsql</DbType>
<MetricsKeyAlias>os.cpu_usage.user</MetricsKeyAlias>
</Items>
</DescribeAvailableMetricsResponse>
JSON
format
{
"TotalRecordCount": 2,
"RequestId": "A467D279-68A8-57B3-BDA4-35F8B3DDB1B7",
"Items": [
{
"Description": "OS CPU utilization, equal to the number of OS-consumed CPUs divided by the total number of CPUs",
"MetricsKey": "os.cpu_usage.sys.avg",
"GroupKeyType": "CPU utilization",
"GroupKey": "os.cpu_usage",
"Method": "avg",
"Dimension": "os",
"Unit": "%",
"SortRule": 1,
"DbType": "pgsql",
"MetricsKeyAlias": "os.cpu_usage.sys"
},
{
"Description": "User CPU utilization, equal to the number of user-consumed CPUs divided by the total number of CPUs",
"MetricsKey": "os.cpu_usage.user.avg",
"GroupKeyType": "CPU utilization",
"GroupKey": "os.cpu_usage",
"Method": "avg",
"Dimension": "os",
"Unit": "%",
"SortRule": 2,
"DbType": "pgsql",
"MetricsKeyAlias": "os.cpu_usage.user"
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
404 | InvalidDBInstanceName.NotFound | The database instance does not exist. | The error message returned because the instance name that you specify cannot be found. Check whether the instance name is correct. |
For a list of error codes, visit the API Error Center.