DescribeStatisticData

Last updated: 2021-01-26 14:30:17

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": [
              {
                "Name": "namespace",
                "Value": "default-test"
              },
              {
                "Name": "node",
                "Value": "cls-gn7vut9a-virtual-kubelet-subnet-node-3"
              },
              {
                "Name": "node_role",
                "Value": "node"
              },
              {
                "Name": "pod_name",
                "Value": "network-tools-b94d6dd89-flf7n"
              },
              {
                "Name": "un_instance_id",
                "Value": "cls-gn7vut9a-virtual-kubelet-subnet-nmpi5ecw-1"
              },
              {
                "Name": "workload_kind",
                "Value": "Deployment"
              },
              {
                "Name": "workload_name",
                "Value": "init-test-nfs00"
              },
              {
                "Name": "tke_cluster_instance_id",
                "Value": "cls-mw2w40s7"
              }
            ],
            "Values": [
              {
                "Timestamp": 1606202100,
                "Value": 42.666
              },
              {
                "Timestamp": 1606202400,
                "Value": 33.6
              },
              {
                "Timestamp": 1606202700,
                "Value": 40.266
              }
            ]
          }
        ]
      }
    ],
    "EndTime": "2020-11-24 15:25:00",
    "Period": 300,
    "RequestId": "0d25d659-71ee-4c93-b8e1-f3992c61ff46",
    "StartTime": "2020-11-24 15:15:00"
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure Error with CAM signature/authentication.
AuthFailure.UnauthorizedOperation The request is not authorized. For more information on the authentication, see the CAM documentation.
FailedOperation Operation failed.
FailedOperation.DataColumnNotFound The data table field doesn't exist.
FailedOperation.DataQueryFailed Failed to query the data.
FailedOperation.DataTableNotFound The data table doesn't exist.
FailedOperation.DbQueryFailed Failed to query the database.
FailedOperation.DbRecordCreateFailed Failed to create the database record.
FailedOperation.DbRecordDeleteFailed Failed to delete the database record.
FailedOperation.DbRecordUpdateFailed Failed to update the database record.
FailedOperation.DbTransactionBeginFailed Failed to start the database transaction.
FailedOperation.DbTransactionCommitFailed Failed to submit the database transaction.
FailedOperation.DimQueryRequestFailed Failed to query the service in the request dimension.
FailedOperation.DivisionByZero The dividend is zero.
InternalError Internal error.
InternalError.CallbackFail Error with the callback.
InternalError.DependsApi Error with another dependent API.
InternalError.DependsDb Error with the dependent db.
InternalError.DependsMq Error with the dependent mq.
InternalError.ExeTimeout Execution timed out.
InternalError.System System error.
InternalError.TaskResultFormat An error occurred while parsing the task result.
InvalidParameter Invalid parameter.
InvalidParameter.DupTask The task has already been submitted.
InvalidParameter.InvalidParameter Invalid parameter.
InvalidParameter.InvalidParameterParam Invalid parameter.
InvalidParameter.MissAKSK The platform configuration is missing.
InvalidParameter.ParamError Incorrect parameter.
InvalidParameter.SecretIdOrSecretKeyError Error with the platform configuration.
InvalidParameter.UnsupportedProduct This product doesn't support scan.
InvalidParameterValue The parameter value is incorrect.
InvalidParameterValue.DashboardNameExists The dashboard name already exists.
InvalidParameterValue.VersionMismatch The version does not match.
LimitExceeded Quota limit is reached.
LimitExceeded.MetricQuotaExceeded Quota limit on metrics is reached. Requests containing unregistered metrics are prohibited.
MissingParameter Missing parameter.
OperationDenied Operation denied.
RequestLimitExceeded The number of requests exceeds the frequency limit.
ResourceInUse The resource is in use.
ResourceInsufficient Insufficient resources.
ResourceNotFound The resource is not found.
ResourceNotFound.NotExistTask The task does not exist.
UnauthorizedOperation Unauthorized operation.
UnknownParameter Unknown parameter.
UnsupportedOperation Unsupported operation.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help