*View the monitoring data of multiple indicators at a certain point in time
Requests
HTTP request
POST /v2/metrics/{cluster}/query
Query cpaas indicator
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| cluster | string | True | Cluster name |
Request body
Content-Type
application/json
Sample request
Query body for metrics query.
{
"queries": [
{
"id": "cpu_usage_rate_top5",
"indicator": "platform.node.cpu.utilization.topk",
"variables": {
"top": "5"
}
}
],
"time": 1640674801
}Parmeters
| Name | Type | Required | Description |
|---|---|---|---|
| queries | array | True |
Queries to execute.
Path: queries |
| queries[] | object | True |
A query item.
Path: queries[] |
| queries[].id | string | True |
An id to distinguish queries.
Path: queries[].id |
| queries[].indicator | string | True |
indicator name.
Path: queries[].indicator |
| queries[].variables | object | True |
key/value pair for variables
Path: queries[].variables |
| time | number | True |
Unix timestamp in seconds.
Path: time |
Responses
Content-Type
application/json
Status code: 200
OK
Sample response
Query result from prometheus.
[
{
"id": "cpu_usage_rate_top5",
"result": [
{
"metric": {
"cluster": "global",
"node": "192.168.130.169"
},
"value": [
1640674801,
"43.64428816141409"
]
},
{
"metric": {
"cluster": "global",
"node": "192.168.130.193"
},
"value": [
1640674801,
"43.10089975981735"
]
},
{
"metric": {
"cluster": "global",
"node": "192.168.130.187"
},
"value": [
1640674801,
"36.711805555597586"
]
}
],
"resultType": "vector"
}
]Parameters
| Name | Type | Description |
|---|---|---|
| [] | object |
Query result data from prometheus.
Path: [] |
| [].id | string |
Query id.
Path: [].id |
| [].result | array |
Value in result from prometheus.
Path: [].result |
| [].resultType | string |
Metrics type.
Path: [].resultType |
| [].result[] | object |
Value of query result
Path: [].result[] |
| result[].metric | object |
Metrics in result from prometheus.
Path: [].result[].metric |