All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

ListMetrics

Last updated:2026-03-18 14:12:49

ListMetrics

Call the ListMetrics API to query monitoring metrics for a specified cloud product resource (excluding container products)


Description

Field

Value

API Name

ListMetrics

Request Method

GET

Endpoint

monitor.api.ksyun.com

VPC Internal Endpoint

monitor.internal.api.ksyun.com

Rate Limit Notice:

  • Per-user API call limit: up to 3,600 requests per minute (except for special data centers).

  • Maximum records returned per single request: 60,000.


Debugging

It is recommended to use API Explorer.

Click to Debug

API Explorer provides online invocation, signature verification, SDK code generation, and quick API search. You can view the full request content and response for each call, and auto-generate SDK usage examples.


Request Parameters

The table below lists the API-specific request parameters and a subset of common parameters. For the full list of common parameters, see Common Request Parameters.

Parameter

Required

Type

Description

Action

Yes

String

Common parameter. Fixed value for this API: ListMetrics.

Version

Yes

String

Common parameter. Fixed value for this API: 2010-05-25.

Namespace

Yes

String

Identifies a category of cloud product. Specifies the namespace. For namespace references, see the namespace list. Example: KEC

InstanceID

Yes

String

Specifies the instance ID. Tips: For certain product lines, the instance ID requires special formatting: MongoDB — prefix the instance ID with user. KS3 — prefix the instance ID with the bucket name. Example: 686ce5e2-XXX-XXX-XXX-a221e4922862

MetricName

No

String

Specifies a particular monitoring metric to query. Tip: When provided, detailed information for the specified metric will be returned.

PageIndex

Yes

Integer

Page number. Starting value: 1. Example: 1

PageSize

No

Integer

Number of data rows per page. Default: 0 (returns all monitoring metrics under the instance).


Response Elements

Field

Type

Description

listMetricsResult

Object

Query result object.

metrics

Object

Metrics container.

member

Array of MetricSet

Collection of monitoring metrics.

responseMetadata

Object

Response metadata container.

requestId

String

Unique request ID.


Request Examples

Example 1: Query the Monitoring Metrics List for a Cloud Instance (KEC)

Request

Replace ${region} with the appropriate region. See: Region Reference. Replace ${CommonParams} with the appropriate common parameters. See: Common Parameters.

curl -X GET 'https://monitor.${region}.api.ksyun.com/?Action=ListMetrics&Version=2010-05-25&Namespace=KEC&InstanceID=6e98888-4bbe-4da5-baef-91306bce03e9&PageIndex=1&PageSize=2' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'host: monitor.api.ksyun.com' \
-H 'cache-control: no-cache' \
-H ${CommonParams}
Successful Response

Both XML and JSON formats are supported.

JSON Format

{
    "listMetricsResult": {
        "metrics": {
            "member": [
                {
                    "instanceId": "6e98888-4bbe-4da5-baef-91306bce03e9",
                    "metricName": "memory.utilizition.total",
                    "metricDesc": "",
                    "namespace": "KEC",
                    "interval": "60",
                    "type": "float",
                    "unit": "%"
                }
            ]
        }
    },
    "responseMetadata": {
        "requestId": "7106664e-bce9-4871-b5df-9cf6e25ce142"
    }
}

XML Format

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListMetricsResponse>
    <ListMetricsResult>
        <Metrics>
            <member>
                <InstanceId>6e98888-4bbe-4da5-baef-91306bce03e9</InstanceId>
                <MetricName>memory.utilizition.total</MetricName>
                <MetricDesc></MetricDesc>
                <Namespace>KEC</Namespace>
                <Interval>60</Interval>
                <Type>float</Type>
                <Unit>%</Unit>
            </member>
        </Metrics>
    </ListMetricsResult>
    <ResponseMetadata>
        <RequestId>7106664e-bce9-4871-b5df-9cf6e25ce142</RequestId>
    </ResponseMetadata>
</ListMetricsResponse>
Error Response

Both XML and JSON formats are supported.

JSON Format

{
    "requestid": "7106664e-bce9-4871-b5df-9cf6e25ce142",
    "error": {
        "type": "sender",
        "code": "InvalidParameterValue",
        "message": "Invalid `InstanceID` parameter value, length must be 36 characters."
    }
}

Error Codes

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.


On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback