Note
This API has been deprecated. For information about how to query metrics, see DescribeMetricsData.
Overview
You can call this API to query OceanBase node metrics.
API details
Constraints
You must have an AccessKey to use APIs. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/nodes/{nodeId}/metrics
Request parameters
Query
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | string | Required | The ID of the OceanBase cluster. | ob317v4uif**** |
| node ID | string | required | The ID of the node. | i-bp16niirq4zdmgvm** |
Body
| Name | Type | Required | Description | Example Value |
|---|---|---|---|---|
| startTime | string | Required | The start time of the monitoring data. The time must be in UTC and in the following format: YYYY-MM-DDThh:mm:ssZ. | 2021-06-13T15:40:43Z |
| endTime | string | Yes | The end time for the metrics. This time can be only in the UTC format, and must be in the format of: YYYY-MM-DDThh:mm:ssZ. | 2021-09-13T15:40:43Z |
| metrics | List |
Yes | The name of the metric. | total_sessions_tenant |
| tenantIdList | List |
No | The list of tenant IDs. | t4tx6u5tc**** |
| nodeIdList | List |
No | The ID list of the nodes. | i-0104c6fb57e6e**** |
Response parameters
| Name | Type | Description | Example value |
|---|---|---|---|
| data | object | The return result of the request. | |
| RequestId | string | Request ID. | EE205C00-30E4-xxxx-xxxx-87E3A8A2AA0C |
| data | List | The node metrics. | For more information, see the code example. |
data example:
"data":[
{
"nodeId":"ins-122dhae",
"ip":"xx.xxx.xxx.xx",
"obInstanceId":"xx.xx.xxx.xxx",
"metrics":[
{
"total_sessions_tenant":0,
"timestamp":1687640160
},
{
"total_sessions_tenant":1,
"timestamp":1687661700
},
{
"total_sessions_tenant":1,
"timestamp":1687661760
}
]
}
]
Examples
Request example
curl --digest -u 'AccessKeyID:AccessKeySecret' \
--request POST \
--url https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/nodes/{nodeId}/metrics \
-H 'X-Ob-Project-Id: <Project ID>'
--data \
'{"nodeIdList":["i-011******","i-0f3******"],"refreshId":0,"metricKeys":["traffic_bytin_instance"],"drillDown":false,"startTime":"2023-06-19T00:33:07Z","endTime":"2023-06-19T06:33:07Z","metrics":["traffic_bytin_instance"]}'
Note
- A project ID uniquely identifies a project. For information about how to obtain the project ID of an instance, see Manage projects.
- Make sure that the project ID of the instance specified by the instance ID parameter is consistent with the specified project ID.
Response example
JSON format:
{
"RequestId": "EE205C00-30E4-xxxx-xxxx-87E3A8A2AA0C",
"data":[
{
// node name
"nodeId":"ins-122dhae",
//IP address of the node
"ip":"xx.xxx.xxx.xx",
"metrics":[
{
//k: metric name, v: value
"total_sessions_tenant":0,
// Timestamp
"timestamp":1687640160
},
{
"total_sessions_tenant":1,
"timestamp":1687661700
},
{
"total_sessions_tenant":1,
"timestamp":1687661760
}
]
}
]
}