
Content is empty
If you don't find the content you expect, please try another search term
Cloud Monitor
API Reference
API catalog
Cloud Service Monitoring
GetMetricStatisticsBatch
Last updated:2026-03-18 14:12:49
Here is the full English translation, formatted consistently with the previous two pages:
Call the GetMetricStatisticsBatch API to query real-time monitoring data from within the last 15 minutes (within the past 30 days).
Field | Value |
|---|---|
API Name | GetMetricStatisticsBatch |
Request Method | POST |
Endpoint |
|
VPC Internal Endpoint |
|
Version |
|
Rate Limit & Constraint Notice:
The number of monitoring metrics per request must not exceed 200.
Per-user API call limit: up to 180 requests per minute (except for special data centers).
Maximum records returned per single request: 6,000.
If the query interval exceeds 30 minutes, some queries may be slow and result in a timeout. When a metric query fails, the response will include the failure reason alongside data for any successfully queried instances.
The table below lists the API-specific request parameters only. When making actual API calls, you must also include the common request parameters. Refer to the Common Request Parameters page for details.
The Action field for this API is GetMetricStatisticsBatch.
Parameter | Required | Type | Description |
|---|---|---|---|
| Yes | String | Identifies a category of cloud product. Specifies the namespace. |
| Yes | String | Local start time timestamp. Format: |
| Yes | String | Local end time timestamp. Format: |
| No | Integer | Statistical granularity in seconds; must be an integer multiple of 60. Inconsistency with the console setting may cause data discrepancies. When left empty (default), no downsampling is applied — data is returned at the product's native push frequency. |
| Yes | []String | Data aggregation methods. Supported values: |
| Yes | Array of MetricObject | List of monitored instances and their corresponding metric names. See the Metrics sub-table below. |
Parameter | Required | Type | Description |
|---|---|---|---|
| Yes | String | The ID of the monitored instance. Note: For MongoDB, prefix the instance ID with |
| Yes | String | The name of the monitoring metric. |
Field | Type | Description |
|---|---|---|
| Array | Monitoring data retrieved using the specified aggregation method. |
| String | The monitoring metric name. |
| String | The ID of the monitored instance. |
| String | Unique request ID. |
Replace
${region}with the appropriate region code. See: Region Reference.
https://monitor.${region}.api.ksyun.com?Action=GetMetricStatisticsBatch&Version=2018-11-14POST Body:
{
"Namespace": "kec",
"StartTime": "2018-10-18T15:00:00Z",
"EndTime": "2018-10-18T15:01:00Z",
"Period": 60,
"Aggregate": ["Max", "Min", "Avg", "sum", "count"],
"Metrics": [
{
"InstanceID": "55e38556-8f92-4c7a-99d4-8b746a340d79",
"MetricName": "cpu.utilizition.total"
},
{
"InstanceID": "dab25452-9426-4e4e-870d-4491f638a598",
"MetricName": "net.if.in"
},
{
"InstanceID": "9e00656d-ba3b-427c-b1e8-0d43a9f1fc0f",
"MetricName": "net.if.in1"
}
]
}The response supports XML format. If certain metrics fail to query (e.g., due to an invalid metric name), the failed items are reported in ErrorMessages, while successfully queried instances still return their data.
XML Format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetMetricStatisticsBatchV2Response xmlns="https://ksyun.kingeyes.com/">
<ErrorMessages>
<ErrorMessage>No such name for 'metrics': 'net.if.in1.9e00656d-ba3b-427c-b1e8-0d43a9f1fc0f'</ErrorMessage>
</ErrorMessages>
<GetMetricStatisticsBatchResults>
<GetMetricStatisticsBatchResult>
<Datapoints>
<member>
<Average>0.06</Average>
<Max>0.06</Max>
<Min>0.06</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2018-10-18T15:00:00Z</Timestamp>
</member>
<member>
<Average>0.062</Average>
<Max>0.062</Max>
<Min>0.062</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2018-10-18T15:01:00Z</Timestamp>
</member>
</Datapoints>
<Instance>55e38556-8f92-4c7a-99d4-8b746a340d79</Instance>
<Label>cpu.utilizition.total</Label>
</GetMetricStatisticsBatchResult>
<GetMetricStatisticsBatchResult>
<Datapoints>
<member>
<Average>170914.5</Average>
<Max>339183.0</Max>
<Min>2646.0</Min>
<SampleCount>2</SampleCount>
<Sum>341829</Sum>
<Timestamp>2018-10-18T15:00:00Z</Timestamp>
</member>
<member>
<Average>176691.5</Average>
<Max>350734.0</Max>
<Min>2649.0</Min>
<SampleCount>2</SampleCount>
<Sum>353383</Sum>
<Timestamp>2018-10-18T15:01:00Z</Timestamp>
</member>
</Datapoints>
<Instance>dab25452-9426-4e4e-870d-4491f638a598</Instance>
<Label>net.if.in</Label>
</GetMetricStatisticsBatchResult>
</GetMetricStatisticsBatchResults>
<ResponseMetadata>
<RequestId>b19ddb6b-c828-4a42-b90a-f27a88680fdf</RequestId>
</ResponseMetadata>
</GetMetricStatisticsBatchV2Response>Note on Partial Failures: In the example above, the third metric (
net.if.in1for instance9e00656d-...) failed because the metric name does not exist. The error is reported in<ErrorMessages>, but data for the other two successfully queried instances is still returned in<GetMetricStatisticsBatchResults>.
The table below lists only the error codes specific to this API's business logic. For all other error codes, refer to Common Error Codes.
Pure Mode