DescribeStatisticData

Last updated: 2021-04-19 11:25:37

1. API Description

Domain name for API request: monitor.tencentcloudapi.com.

This API is used to query monitoring data by dimension conditions.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: monitor.ap-shanghai-fsi.tencentcloudapi.com

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeStatisticData.
Version Yes String Common parameter. The value used for this API: 2018-07-24.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
Module Yes String Module, whose value is fixed at monitor
Namespace Yes String Namespace. Valid values: QCE/TKE
MetricNames.N Yes Array of String Metric name list
Conditions.N No Array of MidQueryCondition Dimension condition. The = and in operators are supported
Period No Integer Statistical granularity in s. Default value: 300
StartTime No String Start time, which is the current time by default, such as 2020-12-08T19:51:23+08:00
EndTime No String End time, which is the current time by default, such as 2020-12-08T19:51:23+08:00
GroupBys.N No Array of String groupBy by the specified dimension

3. Output Parameters

Parameter Name Type Description
Period Integer Statistical period
StartTime String Start time
EndTime String End time
Data Array of MetricData Monitoring data
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying monitoring data by dimension condition

Input Example

POST / HTTP/1.1
Host: monitor.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeStatisticData
<Common request parameters>

{
    "Module": "monitor",
    "Namespace": "QCE/TKE",
    "MetricNames": [
        "K8sPodCpuCoreUsed"
    ],
    "Period": 300,
    "Conditions": [
        {
            "Key": "tke_cluster_instance_id",
            "Operator": "=",
            "Value": [
                "cls-mw2w40s7"
            ]
        }
    ],
    "StartTime": "2020-11-24T15:15:50+08:00",
    "EndTime": "2020-11-24T15:25:50+08:00"
}

Output Example

{
  "Response": {
    "Data": [
      {
        "MetricName": "K8sPodCpuCoreUsed",
        "Points": [
          {
            "Dimensions": [
              {
                "Name": "tke_cluster_instance_id",
                "Value": "cls-mw2w40s7"
              },
              {
                "Name": "node",
                "Value": "cls-gn7vut9a-virtual-kubelet-subnet-node-2"
              },
              {
                "Name": "pod_name",
                "Value": "proxy-edge-j7j95"
              },
              {
                "Name": "workload_name",
                "Value": "init-test-nfs02"
              },
              {
                "Name": "namespace",
                "Value": "default-test"
              },
              {
                "Name": "node_role",
                "Value": "node"
              },
              {
                "Name": "un_instance_id",
                "Value": "cls-gn7vut9a-virtual-kubelet-subnet-nmpi5ecw-1"
              },
              {
                "Name": "workload_kind",
                "Value": "Deployment"
              }
            ],
            "Values": [
              {
                "Timestamp": 1606202100,
                "Value": 41.066
              },
              {
                "Timestamp": 1606202400,
                "Value": 38.666
              },
              {
                "Timestamp": 1606202700,
                "Value": 37.866
              }
            ]
          },
          {
            "Dimensions": [
              {
                <