This topic describes how to report monitoring data by sending an HTTP request.


  • Public endpoint:
  • The following table describes the internal endpoints in different regions.
    Region Region ID Endpoint
    China (Hangzhou) cn-hangzhou
    China (Zhangjiakou) cn-zhangjiakou
    China (Shanghai) cn-shanghai
    China (Beijing) cn-beijing
    China (Qingdao) cn-qingdao
    China (Shenzhen) cn-shenzhen
    China (Hong Kong) cn-hongkong
    China (Hohhot) cn-huhehaote
    UAE (Dubai) me-east-1
    US (Silicon Valley) us-west-1
    US (Virginia) us-east-1
    Japan (Tokyo) ap-northeast-1
    Germany (Frankfurt) eu-central-1
    Australia (Sydney) ap-southeast-2
    Singapore ap-southeast-1
    Malaysia (Kuala Lumpur) ap-southeast-3
    India (Mumbai) ap-south-1

Request syntax

An HTTP request for reporting monitoring data is in the following syntax:
POST /metric/custom/upload HTTP/1.1 
Content-Length:<Content Length>
Content-MD5:<Content MD5>
Date:<GMT Date>

Signature algorithm

CloudMonitor only supports the HMAC-SHA1 signature algorithm. For more information, see Does CloudMonitor support the HMAC-SHA1 signature algorithm and how do I use it?.

Request parameters

The following tables describe the headers and parameters in an HTTP request for reporting monitoring data.
  • Request headers
    Header Type Description
    Authorization String The authorization string, in the format of AccessKeyId:SignString.
    Content-Length Numeric value The length of the HTTP request body, as defined in RFC 2616. This header is only required when the request has a body.
    Content-MD5 String The MD5 value of the HTTP request body. The MD5 value is a string consisting of uppercase letters and digits. This header is only required when the request has a body.
    Content-Type String The type of the content that is sent in the HTTP request. Set the value to application/json.
    Date String The standard timestamp header of the HTTP request. This timestamp header follows the RFC 1123 time format and uses the GMT standard time.

    Example: Mon, 3 Jan 2010 08:33:47 GMT.

    Host string The full hostname of the HTTP request. This header does not include the protocol header such as https://.


    x-cms-api-version string The version of the API. Set the value to 1.0.
    x-cms-signature string The signature algorithm to use. CloudMonitor only supports the HMAC-SHA1 signature algorithm.
    x-cms-ip string The IP address of the host that reports the monitoring data.
    User-Agent String The description of the client.
  • Request parameters
    Parameter Type Required Description
    groupId long Yes The ID of the application group.
    metricName string Yes The name of the metric. The metric name can contain letters, digits, underscores (_), hyphens (-), periods (.), forward slashes (/), and backslashes (\). The metric name can be up to 64 bytes in length. Excessive characters are truncated.
    dimensions object Yes The map of the monitored resources.

    The value is a collection of key-value pairs. A typical pair is instanceId:i-abcdefgh12****.

    The key-value pairs can be 1 to 64 bytes in length. Excessive characters are truncated.

    The keys and values can contain letters, digits, periods (.), hyphens (-), underscores (_), forward slashes (/), and backslashes (\).

    time string Yes The timestamp when the metric data is generated. The timestamp can be in one of the following formats:
    • yyyyMMdd'T'HHmmss.SSSZ

      Example: 20171012T132456.888+0800

    • long

      Example: 1508136760000

    type int Yes

    The type of the reported data. Valid values: 0 and 1. The value 0 indicates raw data and the value 1 indicates aggregate data.

    We recommend that you report aggregate data in both the aggregation periods of 60s and 300s. Otherwise, you cannot query monitoring data in a time span that is more than seven days.

    period string No

    The aggregation period. Unit: seconds.

    If the type parameter is set to 1, the period parameter is required. Valid values:
    • 60
    • 300
    values object Yes The collection of metric values.

    If the type parameter is set to 0, the keys in this parameter must be set to the specified value. CloudMonitor aggregates raw data in each aggregation period to generate multiple statistical values, such as the maximum value, the count, and the total value.

Sample success response

The following content shows the sample response to an HTTP request for reporting monitoring data:

  "code":"200",// The HTTP status code 200 indicates that the request was successful.
  "msg":""// The value is empty when monitoring data is reported.