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

Querying Partition Monitoring Information

Function

This API is used to query partition monitoring information.

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

URI

  • URI format

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

  • Parameter description

    None

Request

  • Example request
    GET https://{endpoint}/v2/{project_id}/streams/stream_test/partitions/shardId-0000000000/metrics?label=total_put_bytes_per_partition&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.

    partition_id

    Yes

    String

    Unique identifier of the partition.

    label

    Yes

    String

    Partition monitoring metrics.

    • total_put_bytes_per_partition: total input traffic in a partition (byte)
    • total_get_bytes_per_partition: total output traffic in a partition (byte)
    • total_put_records_per_partition: total number of input records in a partition
    • total_get_records_per_partition: total number of output records in a partition

    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
    {
      "metrics": {
        "dataPoints": [
        {
          "timestamp": 1533200460,
          "value": 14130
        },
        {
          "timestamp": 1533200340,
          "value": 18030
        }
        ],
        "label": "total_put_bytes_per_partition"
      }
    }
  • Parameter description
    Table 2 Response parameter description

    Parameter

    Type

    Description

    metrics

    Object

    Monitoring data object.

    Table 3 metrics parameter description

    Parameter

    Type

    Description

    dataPoints

    List<DataPoint>

    Partition monitoring data.

    label

    String

    Partition monitoring metrics.

    • total_put_bytes_per_partition: total input traffic in a partition (byte)
    • total_get_bytes_per_partition: total output traffic in a partition (byte)
    • total_put_records_per_partition: total number of input records in a partition
    • total_get_records_per_partition: total number of output records in a partition
    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.