tencent cloud

Feedback

GetMonitorData

Last updated: 2021-04-06 19:30:06

    API Description

    This API is used to get the monitoring data of the CLB instance by passing in the namespace, object dimension description, and monitoring metric of the instance.

    Domain name for API calls: monitor.api.qcloud.com

    Request Parameters

    The list below contains only the API request parameters. Common parameters should be added when you call the API. For more information, see Common Request Parameters. The Action field for this API is GetMonitorData.

    Parameter Required Type Description
    namespace Yes String Namespace. Each Tencent Cloud service has a namespace. There are two namespaces for CLB: qce/lb_public for public network CLB and qce/lb_private for private network CLB.
    metricName Yes String Monitoring metric to be obtained, such as `connum` for current connection, and `intraffic` for inbound bandwidth. For more information, see the table below.
    dimensions.n.name Yes String Dimension name. You can use a combination of dimensions to get the monitoring data. Each namespace has different dimension structures as shown in the table below. This parameter should be used with `dimensions.n.value`.
    dimensions.n.value Yes String Values of a specified dimension.
    startTime No Datetime Start time such as 2017-01-01 00:00:00. The default time is 00:00:00 on the current day.
    endTime No Datetime End time such as 2017-01-01 10:00:00. The current time is used by default.
    Note: it cannot be earlier than `startTime`, and we recommend configuring it on the same day as `startTime`.
    period No Int Statistical period for monitoring data. Valid values: 60s and 300s. If this parameter is not passed in, 300s will be used by default.

    Currently, CLB supports displaying the following metrics (metricName)

    Metric Description Unit
    Connum Current connections -
    new_conn New connections -
    Intraffic Inbound bandwidth Mbps
    outtraffic Outbound bandwidth Mbps
    inpkg Inbound packets Packets/sec
    outpkg Outbound packets Packets/sec

    The namespaces of CLB instances and their respective monitoring dimensions are described as follows:

    Public network CLB instance namespace qce/lb_public

    The qce/lb_public namespace can be used to query all the monitoring data of the public network CLB instances.
    qce/lb_public supports the following dimension groups:

    • Public network CLB dimension
      This dimension reflects the overall monitoring metric of a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    
    • Public network CLB port dimension
      This dimension reflects the monitoring metric of the port on a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Protocol String, such as TCP

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=tcp
    
    • Public network CLB real server dimension
      This dimension reflects the monitoring metric of the real server bound to a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as TCP
    vpcId VPC ID of the CLB instance Int, such as 1111
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=tcp
    &dimensions.3.name=vpcId
    &dimensions.3.value=1111
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    
    • Public network CLB real server port dimension
      This dimension reflects the monitoring metric of a port on the real server bound to a public network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as TCP
    vpcId VPC ID of the CLB instance Int, such as 1111
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11
    port Port number of the real server bound to the CLB instance Int, such as 80

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters >
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=tcp
    &dimensions.3.name=vpcId
    &dimensions.3.value=1111
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    &dimensions.5.name=port
    &dimensions.5.value=80
    

    Private network CLB instance namespace qce/lb_private

    The qce/lb_private namespace can be used to query all monitoring data of the private network CLB instance.

    • Private network CLB dimension
      This dimension reflects the overall monitoring metric of a private network CLB instance. The dimension (dimensions.n.name) to be specified is as follows. Since the private VIP may be repeated, vpcId is also required to uniquely specify a CLB instance:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    vpcId VPC ID of the CLB instance Int, such as 1111

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/lb_private
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=vpcId
    &dimensions.1.value=1111
    
    • Private network CLB port dimension
      This dimension reflects the monitoring metric of the port on a private network instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    vpcId VPC ID of the CLB instance Int, such as 1111
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as http

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/lb_private
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=vpcId
    &dimensions.1.value=1111
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    
    • Private network CLB real server dimension
      This dimension reflects the monitoring metric of the real server bound to a private network CLB instance. The dimension (dimensions.n.name) to be specified is as follows. Since the private VIP may be repeated, vpcId is also required to uniquely specify a CLB instance:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    vpcId VPC ID of the CLB instance Int, such as 1111
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as http
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/lb_private
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=vpcId
    &dimensions.1.value=1111
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    
    • Private network CLB real server port dimension
      This dimension reflects the monitoring metric of a port on the real server bound to a private network CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    vpcId VPC ID of the CLB instance Int, such as 1111
    loadBalancerPort CLB port Int, such as 80
    protocol Protocol String, such as http
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11
    port Port number of the real server bound to the CLB instance Int, such as 80

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/lb_private
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=vpcId
    &dimensions.1.value=1111
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    &dimensions.5.name=port
    &dimensions.5.value=80
    

    CLB instance dimension namespace qce/loadbalance (updated)

    The qce/loadbalance namespace can be used to query the monitoring data of the CLB instance at the application layer.

    Currently, the CLB instance namespace supports displaying the metrics (metricName) as follows:

    Metric Description Unit
    connum Current (active) connections Connections/min
    new_conn New connections Connections/min
    intraffic Inbound traffic Mbps
    outtraffic Outbound traffic Mbps
    inpkg Inbound packets Packets/sec
    outpkg Outbound packets Packets/sec
    httpCode_2XX 2xx status codes Codes/min
    httpCode_3XX 3xx status codes Codes/min
    httpCode_4XX 4xx status codes Codes/min
    httpCode_5XX 5xx status codes Codes/min
    httpCode_404 404 status codes Codes/min
    httpCode_502 502 status codes Codes/min
    response_time_max Maximum response time ms
    response_time_average Average response time ms
    response_timeout_num Timed-out responses Responses/min
    QPS Requests per second -

    qce/loadbalance supports the following dimension groups:

    • CLB VPI dimension
      This dimension reflects the overall monitoring metric of a CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    
    • CLB listener port dimension
      This dimension reflects the monitoring metric of the port on a CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Protocol String, such as http

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    
    • CLB forwarding domain name dimension
      This dimension reflects the monitoring metric of the CLB forwarding domain name. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Protocol String, such as http
    domain Forwarding domain name String, such as www.domain.com

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=domain
    &dimensions.1.value=www.domian.com
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    
    • CLB forwarding path dimension
      This dimension reflects the monitoring metric of the CLB forwarding path. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Portocol String, such as http
    domain Forwarding domain name String, such as www.domain.com
    url Forwarding path String, such as /url

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=domain
    &dimensions.1.value=www.domian.com
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    &dimensions.3.name=url
    &dimensions.3.value=/url
    
    • CLB real server IP dimension
      This dimension reflects the monitoring metric of the IP of the real server bound to a CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Portocol String, such as http
    domain Forwarding domain name String, such as www.domain.com
    url Forwarding path String, such as /url
    vpcId VPC ID of the CLB instance Int, such as 1111
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=vpcId
    &dimensions.1.value=1111
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    &dimensions.1.name=domain
    &dimensions.1.value=www.domian.com
    &dimensions.3.name=url
    &dimensions.3.value=/url
    
    • CLB real server port dimension
      This dimension reflects the monitoring metric of the port on the real server bound to a CLB instance. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    VIP CLB VIP IP address, such as 111.111.111.11
    loadBalancerPort Port Int, such as 80
    protocol Protocol String, such as http
    domain Forwarding domain name String, such as www.domain.com
    url Forwarding path String, such as /url
    vpcId VPC ID of the CLB instance Int, such as 1111
    lanIp IP address of the real server bound to the CLB instance IP address, such as 111.111.111.11
    port Port number of the real server bound to the CLB instance Int, such as 80

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=connum
    &dimensions.0.name=vip
    &dimensions.0.value=111.111.111.11
    &dimensions.1.name=vpcId
    &dimensions.1.value=1111
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &dimensions.3.name=protocol
    &dimensions.3.value=http
    &dimensions.4.name=lanIp
    &dimensions.4.value=111.222.111.22
    &dimensions.5.name=port
    &dimensions.5.value=80
    &dimensions.1.name=domain
    &dimensions.1.value=www.domian.com
    &dimensions.3.name=url
    &dimensions.3.value=/url
    

    Response Parameters

    Parameter Type Description
    code Int Common error code. 0: success; other values: failure. For more information, see Common Error Codes.
    codeDesc String Error code.
    message String Detailed error message.
    startTime Datetime Start time.
    endTime Datetime End time.
    metricName String Metric name.
    period Int Statistical period for monitoring data.
    dataPoints Object Monitoring data list. Each element of the array stands for the data read at the monitoring time point.

    Example

    Request

     
    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/lb_public
    &metricName=connum
    &dimensions.0.name=protocol
    &dimensions.0.value=HTTP
    &dimensions.1.name=vip
    &dimensions.1.value=111.111.111.111
    &dimensions.2.name=loadBalancerPort
    &dimensions.2.value=80
    &startTime=2015-12-28 14:00:00
    &endTime=2015-12-28 14:05:00
    &period=300
    

    Response

    {
        "code": 0,
        "message": "",
        "metricName": "connum",
        "startTime": "2015-12-28 14:00:00",
        "endTime": "2015-12-28 14:05:00",
        "period": 300,
        "dataPoints":  [
               0
            ]
    }
    
    • Forwarding domain name dimension
      This dimension reflects the monitoring metric of the CLB instance(s) which configured the same forwarding domain name. The dimension (dimensions.n.name) to be specified is as follows:
    Dimension Description Format
    loadBalancerPort Port Int, such as 80
    protocol Protocol String, such as http
    domain Forwarding domain name String, such as www.domain.com

    API calling sample using the dimension:

    https://monitor.api.qcloud.com/v2/index.php?Action=GetMonitorData
    &<Common request parameters>
    &namespace=qce/loadbalance
    &metricName=QPS
    &dimensions.0.name=domain
    &dimensions.0.value=www.domian.com
    &dimensions.1.name=loadBalancerPort
    &dimensions.1.value=80
    &dimensions.2.name=protocol
    &dimensions.2.value=http