Help Center> Data Ingestion Service> API Reference> API Description> Querying Stream Monitoring Information

Querying Stream Monitoring Information

Function

This API is used to query stream monitoring information.

When querying the stream monitoring information, you need to specify the stream name, monitoring index, and start time and end time of the monitoring.

URI

  • URI format

    GET /v2/{project_id}/streams/{stream_name}/metrics?label={label}&label_list={label_list}&start_time={start_time}&end_time={end_time}

  • Parameter description

    None

Request

  • Example request
    Label request:
    GET https://{endpoint}/v2/{project_id}/streams/stream_test/metrics?label=total_put_records_per_stream&start_time=1534917441&end_time=1534921041 
    label_list request:
    GET https://{endpoint}/v2/{project_id}/streams/stream_test/metrics?label_list=total_put_bytes_per_stream,total_put_records_per_stream&start_time=1534917441&end_time=1534921041 
  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    stream_name

    Yes

    String

    Name of the DIS stream to be queried.

    label

    No

    String

    Stream monitoring metric. (Either label or label_list must be set. If both label_list and label exist, label_list prevails.)

    • total_put_bytes_per_stream: total input traffic (byte)
    • total_get_bytes_per_stream: total output traffic (byte)
    • total_put_records_per_stream: total number of input records
    • total_get_records_per_stream: total number of output records
    • total_put_req_latency: average processing time of upload requests (ms)
    • total_get_req_latency: average processing time of download requests (ms)
    • total_put_req_suc_per_stream: number of successful upload requests
    • Total_get_req_suc_per_stream: number of successful download requests
    • traffic_controll_put: number of rejected upload requests due to flow control
    • traffic_controll_get: number of rejected download requests due to flow control

    label_list

    No

    String

    List of labels separated by commas (,) to query multiple labels in batches. (Either label or label_list must be set. If both label_list and label exist, label_list prevails.)

    start_time

    Yes

    Long

    Monitoring start time, which is a 10-digit timestamp.

    end_time

    Yes

    Long

    Monitoring end time, which is a 10-digit timestamp.

Response

  • Example response

    Label query

    {
      "metrics": {
        "dataPoints": [
        {
          "timestamp": 1533200460,
          "value": 2760
        },
        {
          "timestamp": 1533200340,
          "value": 3575
        }
        ],
        "label": "total_put_records_per_stream"
      }
    }

    label_list query

    {
    	"metrics_list": [{
    		"label": "total_put_bytes_per_stream",
    		"dataPoints": [{
    			"timestamp": 1575537840,
    			"value": 81111040
    		}, {
    			"timestamp": 1575536640,
    			"value": 92160000
    		}]
    	}, {
    		"label": "total_put_records_per_stream",
    		"dataPoints": [{
    			"timestamp": 1575537840,
    			"value": 7921
    		}, {
    			"timestamp": 1575536640,
    			"value": 9000
    		}]
    	}]
    }

  • Parameter description
    Table 2 Response parameter description

    Parameter

    Type

    Description

    metrics

    Metrics

    Monitoring data object.

    metrics_list

    List<Metrics>

    List of monitored data objects.

    Table 3 Metrics parameter description

    Parameter

    Type

    Description

    dataPoints

    List<DataPoint>

    Stream monitoring data.

    label

    String

    Stream monitoring metrics.

    • total_put_bytes_per_stream: total input traffic (byte)
    • total_get_bytes_per_stream: total output traffic (byte)
    • total_put_records_per_stream: total number of input records
    • total_get_records_per_stream: total number of output records
    • total_put_req_latency: average processing time of upload requests (ms)
    • total_get_req_latency: average processing time of download requests (ms)
    • total_put_req_suc_per_stream: number of successful upload requests
    • Total_get_req_suc_per_stream: number of successful download requests
    • traffic_controll_put: number of rejected upload requests due to flow control
    • traffic_controll_get: number of rejected download requests due to flow control
    Table 4 DataPoint parameter description

    Parameter

    Type

    Description

    timestamp

    Long

    Specifies the timestamp.

    value

    Long

    Specifies the monitoring value corresponding to the timestamp.

Status Code

  • Normal

    200 OK

  • Failed

    For more information, see Error Codes.