tencent cloud

Feedback

Pulling Monitoring Data via TencentCloud API

Last updated: 2023-09-12 14:59:09
    This document describes how to pull the monitoring metric data of TDSQL-C for MySQL through TencentCloud API. For detailed directions and more examples, see GetMonitorData.

    API description

    This API is used to get the monitoring data of TDSQL-C for MySQL by passing in its namespace, object dimension, and monitoring metric. API call rate limit: 20 calls/sec (1,200 calls/minute). A single request can get the data of up to 10 instances for up to 1,440 data points. This API may fail due to the rate limit if you need to call many metrics and objects. We recommend you distribute call requests across a period of time. The API request rate is limited to 20 requests/sec by default.

    Input parameters

    The list below only contains API request parameters and some common parameters. For a complete common parameter list, see Common Params.
    Parameter Name
    Required
    Type
    Description
    Action
    Yes
    String
    Common parameter. The value used for this API: GetMonitorData.
    Version
    Yes
    String
    Common parameter. The value used for this API: 2018-07-24.
    Region
    Yes
    String
    Common parameter. For more information, see the list of regions supported by the product.
    Namespace
    Yes
    String
    Namespace, such as QCE/cynosdb_mysql. For more information, see TDSQL-C for MySQL Monitoring Metrics.
    MetricName
    Yes
    String
    Metric name, such as CPUUsagerate (CPU utilization). You can pull the data of one single metric at a time.
    Instances.N
    Yes
    Array of Instance
    Dimension combination of instance object in the format of key-value pair. Different types of instances have completely different fields. For the dimension combination of TDSQL-C for MySQL, see TDSQL-C for MySQL Monitoring Metrics.
    Period
    No
    Integer
    Statistical period for monitoring data in seconds, such as 60. Default value: 300.
    StartTime
    No
    Timestamp ISO8601
    Start time, such as 2021-07-15T19:51:23+08:00.
    EndTime
    No
    Timestamp ISO8601
    End time, which is the current time by default, such as 2021-07-15T20:51:23+08:00. EndTime cannot be earlier than StartTime.

    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
    RequestId
    String
    The unique request ID, which is returned for each request and is required for troubleshooting.

    Examples

    This example shows you how to get the 5-minute CPU utilization monitoring data of a TDSQL-C for MySQL instance in a specific period of time. Sample input
    POST / HTTP/1.1
    Host: monitor.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: GetMonitorData
    <Common request parameters>
    
    {
    "Namespace": "QCE/cynosdb_mysql",
    "MetricName": "CPuUsageRate",
    "Period": 3600,
    "Instances": [
    {
    "Dimensions": [
    {
    "Name": "InstanceId",
    "Value": "cynosdbmysql-ins-edpn3t6b"
    }
    ]
    }
    ],
    "StartTime": "2022-07-15T10:00:00",
    "EndTime": "2022-07-15T15:00:00"
    }
    Sample output
    {
    "Response": {
    "DataPoints": [
    {
    "Dimensions": [
    {
    "Name": "InstanceId",
    "Value": "cynosdbmysql-ins-edpn3t6b"
    }
    ],
    "Timestamps": [
    1657850400,
    1657854000,
    1657857600,
    1657861200,
    1657864800
    ],
    "Values": [
    0.26,
    0.24,
    0.23,
    0.26,
    0.24
    ]
    }
    ],
    "EndTime": "7/15/2022 3:00:00 PM",
    "MetricName": "CPuUsageRate",
    "Period": 3600,
    "RequestId": "71c72744-bec5-49d0-b42c-433609ab4166"
    "StartTime": "7/15/2022 10:00:00 AM"
    }
    }
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support