You can call this operation to query single-dimensional or multi-dimensional metric data of an OceanBase cluster.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| oceanbase:DescribeMetricsData | get | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| InstanceId | string | Yes | The ID of the OceanBase cluster. | ob317v4uif**** |
| StartTime | string | Yes | The start time for querying metric data. The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| EndTime | string | Yes | The end time for querying metric data. The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| Metrics | string | Yes | The metrics. Separate multiple metrics with commas (,). Example: "sql_all_count,sql_all_rt...". | tps |
| Labels | string | Yes | A string of key-value pairs separated with commas (,). Each key and its value are separated with a colon (:). Example: "app:OB,clusterId:ob*****,tenantId:t******,serverId:*****,zoneId:cn-hangzhou-j". The string can contain only the following fixed keys: * app: the application type. At present, only OceanBase Database is supported. * clusterId: the ID of the OceanBase cluster. * tenantId: the ID of the OceanBase Database tenant. * zoneId: the ID of the zone. * serverId: the ID of the OBServer node. | app:OB,clusterId:ob*** | app:OB,clusterId:ob*** |
| GroupByLabels | string | Yes | The one or more keys used for grouping. Separate multiple keys with commas (,). Example: "app,clusterId,tenantId". | app,clusterId |
| SortMetricKey | string | No | The sort column. | tps |
| SortOrder | string | No | The sorting rule. Valid values:
| DESC |
| Limit | string | No | The length of the data array returned after sorting. | 5 |
| ReplicaType | string | No | The type of the replica. Node filtering conditions are configured based on the replica type when you query the monitoring data of the OceanBase cluster.
| FULL |
| MetricScope | string | No | The dimensions of the performance metric. | cluster |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
"Data": "[\n {\n \"sql_select_count\":75.****15****1515,\n \"timestamp\":165079****\n },\n ......\n ]"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-07-03 | The request parameters of the API has changed | View Change Details |
| 2024-04-15 | The response structure of the API has changed | View Change Details |
| 2023-12-26 | The request parameters of the API has changed | View Change Details |
