Batch Query Monitoring Data Interface V2
API description
Monitor data for cloud products within a specified time range can be retrieved based on various dimensions, metrics, and statistics.
API restriction
- For any metric of a specific instance, the number of data points returned in one response cannot exceed 1,440.
- Each query can include up to 100 dimension combinations.
Request structure
- method:POST
- Request URL: /csm/api/v2/data/metricAllData
Request parameters
| Name |
Types |
Description |
Required or not |
Parameter location |
| userId |
String |
User ID |
Yes |
Body |
| scope |
String |
Cloud product identifier. For values, please refer to [Cloud Product Identifier List](BCM/Cloud Product Monitor List/Cloud Product Monitor Object Type List.md) |
Yes |
Body |
| region |
String |
Region identifier. For values, please refer to [Region List](BCM/API Reference/Service domain.md) |
Yes |
Body |
| type |
String |
Monitor object type, default value: Instance. For values, please refer to [Cloud Product Monitor Object Type List](BCM/Cloud Product Monitor List/Cloud Product Monitor Object Type List.md) |
Yes |
Body |
| metricNames |
List<String> |
List of Monitor Metrics |
Yes |
Body |
| statistics |
List<String> |
List of Statistic Method Types, options: average, maximum, minimum, sum, sampleCount. |
Yes |
Body |
| dimensions |
List<List<Dimension>> |
Dimension list |
Yes |
Body |
| cycle |
int |
Statistical period, unit: second, default value: 60 |
No |
Body |
| startTime |
String |
Monitor data start time, please refer to [Date and Time](BCM/API Reference/General Description.md), in UTC format |
Yes |
Body |
| endTime |
String |
Monitor data end time, please refer to [Date and Time](BCM/API Reference/General Description.md), expressed in UTC date |
Yes |
Body |
Dimension
| Name |
Types |
Description |
Required or not |
| name |
String |
Dimension key |
Yes |
| value |
String |
Dimension value |
Yes |
Parameter explanation
- For concepts like Scope, Metric, Statistic, and Dimension, please refer to [Core Concepts](BCM/Product Description/Core concepts.md).
Response parameters
| Name |
Types |
Description |
| requestId |
String |
Request identifier ID |
| code |
String |
Return code |
| message |
String |
Error message |
| metrics |
List<AllDataMetric> |
Monitor Metric data |
AllDataMetric
| Name |
Types |
Description |
| region |
String |
Region |
| scope |
String |
Cloud product name |
| userId |
String |
User ID |
| resourceId |
String |
Resource ID |
| metricName |
String |
Monitor Metric name |
| dimensions |
List<Dimensions> |
List of Monitor Metric Dimensions |
| dataPoints |
List<DataPoint> |
Monitor Metric data |
DataPoint
| Name |
Types |
Description |
| average |
double |
Average of Metrics within the statistical period |
| sum |
double |
Sum of Metrics within the statistical period |
| minimum |
double |
Minimum value of Metrics within the statistical period |
| maximum |
double |
Maximum value of Metrics within the counting cycle |
| sampleCount |
int |
Number of DataPoints for the Metric within the statistical period |
| timestamp |
String |
Time corresponding to the monitor data |
Request example
1{
2 "userId": "453bf9********************9090dc",
3 "scope": "BCE_MQ_KAFKA",
4 "region": "bj",
5 "type": "Node",
6 "metricNames": ["CpuUsedPercent"],
7 "statistics": ["average", "sum", "sampleCount"],
8 "dimensions": [
9 [
10 {
11 "name": "ClusterId",
12 "value": "efe456d667******b890652c93812a79"
13 },
14 {
15 "name": "NodeId",
16 "value": "i-Um1V8Haq"
17 }
18 ]
19 ],
20 "cycle": 60,
21 "startTime": "2024-03-21T06:33:50Z",
22 "endTime": "2024-03-21T07:33:50Z"
23}
Response example
1{
2 "requestId": "f6cb4648-26bd-****-****-4f68afa9d2e6",
3 "code": "success",
4 "message": "",
5 "metrics": [
6 {
7 "region": "bj",
8 "scope": "BCE_MQ_KAFKA",
9 "userId": "453bf9********************9090dc",
10 "resourceId": "i-Um1V8Haq",
11 "metricName": "CpuUsedPercent",
12 "dimensions": [
13 {
14 "name": "ClusterId",
15 "value": "efe456d667******b890652c93812a79"
16 },
17 {
18 "name": "NodeId",
19 "value": "i-Um1V8Haq"
20 }
21 ],
22 "dataPoints": [
23 {
24 "average": 0.959692898272,
25 "sum": 0.959692898272,
26 "sampleCount": 1,
27 "timestamp": "2024-03-21T06:33:50Z"
28 }
29 ]
30 }
31 ]
32}
![]()