Skip to main content

Query Metrics

View metric statistics.

export CLOUD_REGION="gcp-us-west1"
export API_KEY=""

curl --location --request POST "https://controller.api.${CLOUD_REGION}.zillizcloud.com/v1/clusters/inxx-xxxxxxxxxxxxxxx/metrics/query" \
--header "Authorization: Bearer ${API_KEY}" \
--data-raw '{
"start": "",
"end": "",
"period": "PT99H",
"granularity": "PT5H",
"metricQueries": [
{
"name": "CU_CAPACITY",
"stat": "AVG"
}
]
}'

Possible response is similar to the following.

{
"code": 200,
"data": {
"results": [
{
"name": "CU_CAPACITY",
"stat": "AVG",
"unit": "percent",
"values": [
{
"timestamp": "2024-03-28T04:58:06Z",
"value": null
},
{
"timestamp": "2024-03-28T09:58:06Z",
"value": null
},
{
"timestamp": "2024-03-28T14:58:06Z",
"value": null
}
]
}
]
}
}

POST
https://{cluster-endpoint}/v1/clusters/{CLUSTER_ID}/metrics/query

Example

RESTful API Examples

Request

Parameters

  • No query parameters required

  • Path parameters

    ParameterDescription
    CLUSTER_IDstring(required)

Request Body

{
"start": "string",
"end": "string",
"period": "string",
"granularity": "string",
"metricQueries": [
{
"name": "string",
"stat": "string"
}
]
}
ParameterDescription
startstring
The starting date and time for the metric reporting period, expressed in ISO 8601 timestamp format in UTC. Include this parameter when the period parameter is not set.
endstring
The ending date and time for the metric reporting period, expressed in ISO 8601 timestamp format in UTC. Include this parameter when the period parameter is not set.
periodstring
The duration over which Milvus reports the metrics, expressed in ISO 8601 duration format in UTC. Include this parameter when both start and end parameters are not set.
granularitystring
The time interval at which Milvus reports the metrics, expressed in ISO 8601 duration format in UTC. The minimum granularity is PT30S.
metricQueriesarray
An array of MetricQuery objects.
metricQueries[]object
metricQueries[].namestring
The name of the metric to query. Valid values include CU_COMPUTATION, CU_CAPACITY, STORAGE_USE, REQ_INSERT_COUNT, REQ_BULK_INSERT_COUNT, REQ_UPSERT_COUNT, REQ_DELETE_COUNT, REQ_SEARCH_COUNT, REQ_QUERY_COUNT, VECTOR_REQ_INSERT_COUNT, VECTOR_REQ_UPSERT_COUNT, VECTOR_REQ_SEARCH_COUNT, REQ_INSERT_LATENCY, REQ_BULK_INSERT_LATENCY, REQ_UPSERT_LATENCY, REQ_DELETE_LATENCY, REQ_SEARCH_LATENCY, REQ_QUERY_LATENCY, REQ_SUCCESS_RATE, REQ_FAIL_RATE, REQ_FAIL_RATE_INSERT, REQ_FAIL_RATE_BULK_INSERT, REQ_FAIL_RATE_UPSERT, REQ_FAIL_RATE_DELETE, REQ_FAIL_RATE_SEARCH, REQ_FAIL_RATE_QUERY, ENTITIES_LOADED, ENTITIES_INSERT_RATE, COLLECTIONS_COUNT, ENTITIES_COUNT.
metricQueries[].statstring
The statistical method to apply to the metric. Valid values include AVG (average) and P99 (99th percentile) for latency metrics. AVG is available for all other metrics.

Response

成功

Response Bodies

  • Response body if we process your request successfully
{
"code": "integer",
"data": {
"results": [
{
"name": "string",
"stat": "string",
"unit": "string",
"values": [
{
"timestamp": "string",
"value": "string"
}
]
}
]
}
}
  • Response body if we failed to process your request
{
"code": integer,
"message": string
}

Properties

The properties in the returned response are listed in the following table.

PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 200: The request succeeds.
  • Others: Some error occurs.
codeinteger
dataobject
The container for the response data.
data[].resultsarray
An array of result objects.
data[].results[]object
data[].results[].namestring
The name of the metric.
data[].results[].statstring
The statistical function applied to the metric.
data[].results[].unitstring
The unit of measurement for the metric (e.g., percent).
data[].results[][].valuesarray
An array of data points.
data[].results[][].values[]object
data[].results[][].values[].timestampstring
The timestamp for the data point in ISO 8601 format.
data[].results[][].values[].valuestring
The value of the metric at the given timestamp.
messagestring
Indicates the possible reason for the reported error.

Possible Errors

CodeError Message
(to be added)