Help Center/ GaussDB(DWS)/ API Reference/ API Description/ Host Monitoring/ Querying the List of Metrics Used by a Cluster
Updated on 2024-04-18 GMT+08:00

Querying the List of Metrics Used by a Cluster

Function

This API is used to query the list of metrics used by a cluster.

Call Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/clusters/{cluster_id}/dms/metrics
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the ID, see Obtaining Project ID.

cluster_id

Yes

String

Cluster ID. For details about how to obtain the ID, see Obtaining the Cluster ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Offset from which the query starts, which is greater or equal to 0.

limit

Yes

Integer

Number of items displayed on each page. The maximum value is 1000.

order_by

No

String

Sorting field This parameter is set to a fixed value.

  • create_time: creation time.

sort_by

No

String

Ascending or descending. This parameter is set to a fixed value.

  • asc: ascending order.
  • desc: reverse order.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

Integer

Response code

msg

String

Response message

data

Array of ClusterMetric objects

Metric list

count

Long

Total list size

Table 4 ClusterMetric

Parameter

Type

Description

scope

String

Metric name

fields

Array of SimpleFieldDto objects

Field information in the metric table.

metric_name

String

Name of the valid region

collect_rate

Integer

Collection Rate

collect_range

Array of strings

Period

create_time

String

Creation time

Table 5 SimpleFieldDto

Parameter

Type

Description

column_name

String

Field name in the metric table.

column_type

String

Type of the field corresponding to the metric table.

Example Request

https://{Endpoint}/v1/{project_id}/clusters/{cluster_id}/dms/metrics?limit=1&offset=0&order_by=create_time&sort_by=desc

Example Response

Status code: 200

{
  "code" : 0,
  "msg" : "OK",
  "data" : [ {
    "scope" : "CN,ANY",
    "fields" : [ {
      "column_name" : "db_name",
      "column_type" : "text"
    }, {
      "column_name" : "schema_name",
      "column_type" : "text"
    }, {
      "column_name" : "table_name",
      "column_type" : "text"
    }, {
      "column_name" : "table_owner",
      "column_type" : "text"
    }, {
      "column_name" : "table_size",
      "column_type" : "bigint"
    }, {
      "column_name" : "dirty_page_rate",
      "column_type" : "double precision"
    } ],
    "metric_name" : "TableDirtyPageRate",
    "collect_rate" : 7200,
    "collect_range" : [ ],
    "create_time" : "1701915436000"
  } ],
  "count" : 1
}

Status Code

Status Code

Description

200

The list of metrics used by the cluster is queried successfully.

400

Request error.

401

Authentication failed.

403

You do not have required permissions.

404

No resources found.

500

Internal server error.

503

Service unavailable.