tencent cloud

腾讯云可观测平台

动态与公告
产品动态
产品简介
产品概述
产品优势
基本功能
基本概念
应用场景
使用限制
购买指南
云产品监控
应用性能监控
终端性能监控
前端性能监控
云拨测
Prometheus 监控服务
Grafana 服务
事件总线
云压测
快速入门
监控概览
实例分组
云产品监控
应用性能监控
云拨测
云压测
Prometheus 监控服务
Grafana 服务
创建 Dashboard
事件总线
告警服务
云产品监控
云产品监控指标
控制台操作指南
云服务器监控组件
云产品监控对接 Grafana
故障处理
实践教程
应用性能监控
应用性能监控简介
接入指南
控制台操作指南
实践教程
参考信息
常见问题
终端性能监控
终端性能监控概述
控制台操作指南
接入指南
实践教程
前端性能监控
前端性能监控简介
控制台操作指南
接入指南
常见问题
云拨测
产品简介
控制台操作指南
常见问题
云压测
云压测概述
控制台操作指南
实践教程
JavaScript API 列表
常见问题
Prometheus 监控
Prometheus 监控简介
接入指南
控制台操作指南
实践教程
Terraform
常见问题
Grafana 服务
产品简介
控制台操作指南
Grafana 平台常用功能指引
常见问题
Dashboard
什么是 Dashboard
控制台操作指南
告警管理
控制台操作指南
故障处理
常见问题
事件总线
事件总线简介
控制台操作指南
实践教程
常见问题
报表管理
常见问题
腾讯云可观测平台常见问题
告警服务相关
一般性问题
监控图表相关
云服务器监控组件相关
动态阈值告警相关
云监控对接 Grafana 相关
文档阅读指南
相关协议
应用性能监控服务等级协议
APM 隐私协议
APM 数据处理和安全协议
前端性能监控服务等级协议
终端性能监控服务等级协议
云拨测服务等级协议
Prometheus 监控服务服务等级协议
Grafana 服务服务等级协议
云压测服务等级协议
云压测使用限制
Cloud Monitor Service Level Agreement
API 文档
History
Introduction
API Category
Making API Requests
Monitoring Data Query APIs
Alarm APIs
Legacy Alert APIs
Notification Template APIs
TMP APIs
Grafana Service APIs
Event Center APIs
TencentCloud Managed Service for Prometheus APIs
Monitoring APIs
Data Types
Error Codes
词汇表

GetMonitorData

PDF
聚焦模式
字号
最后更新时间: 2025-11-13 20:45:22

1. API Description

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

This API is used to get the monitoring data of Tencent Cloud services except TKE. To pull TKE’s monitoring data, use the DescribeStatisticData API.
You can get the monitoring data of a Tencent Cloud service by passing in its namespace, object dimension description, and monitoring metrics.
API call rate limit: 20 calls/second (1,200 calls/minute). A single request can get the data of up to 10 instances for up to 1,440 data points.
If you need to call a large number of APIs to pull metrics or objects at a time, some APIs may fail to be called due to the rate limit. We suggest you evenly arrange API calls at a time granularity.

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

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 Params. The value used for this API: GetMonitorData.
Version Yes String Common Params. The value used for this API: 2018-07-24.
Region No String Common Params. This parameter is not required for this API.
Namespace Yes String Namespace, such as QCE/CVM. For more information on the namespaces of each Tencent Cloud service, please see Tencent Cloud Service Metrics
MetricName Yes String Metric name, such as CPUUsage. Only one monitoring metric can be pulled at a time. For more information on the metrics of each Tencent Cloud service, please see Tencent Cloud Service Metrics. The corresponding metric name is MetricName.
Instances.N Yes Array of Instance The dimension combination for instance objects, which is in the form of a set of key-value pairs. The dimension fields for instances of different Tencent Cloud services are completely different. For example, the field is [{"Name":"InstanceId","Value":"ins-j0hk02zo"}] for CVM instances, [{"Name":"instanceId","Value":"ckafka-l49k54dd"}] for CKafka instances, and [{"Name":"appid","Value":"1258344699"},{"Name":"bucket","Value":"rig-1258344699"}] for COS instances. For more information on the dimensions of various Tencent Cloud services, please see Tencent Cloud Service Metrics. In each document, the dimension column displays a dimension combination’s key, which has a corresponding value. A single request can get the data of up to 10 instances.
Period No Integer Monitoring statistical period in seconds, such as 60. Default value: 300. The statistical period varies by metric. For more information on the statistical periods supported by each Tencent Cloud service, please see Tencent Cloud Service Metrics. The values in the statistical period column are the supported statistical periods. A single request can get up to 1,440 data points.
StartTime No Timestamp ISO8601 Start time such as 2018-09-22T19:51:23+08:00
EndTime No Timestamp ISO8601 End time, which is the current time by default, such as 2018-09-22T20:51:23+08:00. EndTime cannot be earlier than StartTime

3. Output Parameters

Parameter Name Type Description
Period Integer Statistical period
MetricName String Metric name
DataPoints Array of DataPoint Array of data points
StartTime Timestamp ISO8601 Start time
EndTime Timestamp ISO8601 End time
Msg String Returned message
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Pulling the monitoring data of a single CVM instance

This example shows you how to get the 5-minute granularity monitoring data for the CPU utilization of a CVM instance for a specified period of time.

Input Example

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

{
    "Namespace": "QCE/CVM",
    "MetricName": "CPUUsage",
    "Period": 300,
    "Instances": [
        {
            "Dimensions": [
                {
                    "Name": "InstanceId",
                    "Value": "ins-j0hk02zo"
                }
            ]
        }
    ],
    "StartTime": "2019-03-24T10:51:23+08:00",
    "EndTime": "2019-03-24T20:51:23+08:00"
}

Output Example

{
    "Response": {
        "StartTime": "2019-03-24T10:50:00+08:00",
        "EndTime": "2019-03-24T20:50:00+08:00",
        "Period": 300,
        "MetricName": "CPUUsage",
        "DataPoints": [
            {
                "Dimensions": [
                    {
                        "Name": "InstanceId",
                        "Value": "ins-j0hk02zo"
                    }
                ],
                "Timestamps": [
                    1535079000,
                    1535079300,
                    1535079600,
                    1535079900,
                    1535080200,
                    1535080500
                ],
                "Values": [
                    2.566,
                    2.283,
                    6.316,
                    2.816,
                    2.7,
                    2.35
                ]
            }
        ],
        "Msg": "",
        "RequestId": "d96ec542-6547-4af2-91ac-fee85c1b8b85"
    }
}

Example2 Pulling the monitoring data of multiple CVM instances

This example shows you how to get the 5-minute granularity monitoring data for the CPU utilization of multiple CVM instances for a specified period of time.

Input Example

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

{
    "Namespace": "QCE/CVM",
    "MetricName": "CPUUsage",
    "Period": 300,
    "Instances": [
        {
            "Dimensions": [
                {
                    "Name": "InstanceId",
                    "Value": "ins-j0hk02zo"
                }
            ]
        },
        {
            "Dimensions": [
                {
                    "Name": "InstanceId",
                    "Value": "ins-o8vv2w10"
                }
            ]
        }
    ],
    "StartTime": "2018-09-22T19:51:23+08:00",
    "EndTime": "2018-09-22T20:51:23+08:00"
}

Output Example

{
    "Response": {
        "StartTime": "2018-09-22T19:50:00+08:00",
        "EndTime": "2018-09-22T20:50:00+08:00",
        "Period": 300,
        "MetricName": "CPUUsage",
        "DataPoints": [
            {
                "Dimensions": [
                    {
                        "Name": "InstanceId",
                        "Value": "ins-j0hk02zo"
                    }
                ],
                "Timestamps": [],
                "Values": []
            },
            {
                "Dimensions": [
                    {
                        "Name": "InstanceId",
                        "Value": "ins-o8vv2w10"
                    }
                ],
                "Timestamps": [],
                "Values": []
            }
        ],
        "Msg": "",
        "RequestId": "9ac53ccc-fbab-483d-980b-b763bcc2f83f"
    }
}

Example3 Pulling the monitoring data of a single TencentDB instance

This example shows you how to get the 5-minute granularity monitoring data for the CPU utilization of a TencentDB instance for a specified period of time.

Input Example

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

{
    "Namespace": "QCE/CDB",
    "MetricName": "CpuUseRate",
    "Period": 300,
    "Instances": [
        {
            "Dimensions": [
                {
                    "Name": "InstanceId",
                    "Value": "cdb-k5d6z7p0"
                },
                {
                    "Name": "InstanceType",
                    "Value": "2"
                }
            ]
        }
    ],
    "StartTime": "2018-09-22T19:23:07+08:00",
    "EndTime": "2018-09-22T20:23:07+08:00"
}

Output Example

{
    "Response": {
        "StartTime": "2018-09-22T19:20:00+08:00",
        "EndTime": "2018-09-22T20:20:00+08:00",
        "Period": 300,
        "MetricName": "CpuUseRate",
        "DataPoints": [
            {
                "Dimensions": [
                    {
                        "Name": "InstanceType",
                        "Value": "2"
                    },
                    {
                        "Name": "InstanceId",
                        "Value": "cdb-k5d6z7p0"
                    }
                ],
                "Timestamps": [],
                "Values": []
            }
        ],
        "Msg": "",
        "RequestId": "2bcfe8b7-8ea8-4488-9d17-f1aeb106eecd"
    }
}

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
FailedOperation.ErrNotOpen You have not enabled pay-as-you-go billing for API requests.
FailedOperation.ErrOwed You have overdue payments.
InternalError Internal error.
InvalidParameterValue The parameter value is incorrect.
UnsupportedOperation Unsupported operation.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈