Skip to main content

Query Metrics

View metric statistics.


POST
https://controller.${CLOUD_REGION}.zillizcloud.com/v1/clusters/CLUSTER_ID/metrics/query

Example

📘Notes

This API requires an API key as the authentication token.

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-07-06T04:27:53Z",
"value": null
},
{
"timestamp": "2024-07-06T09:27:53Z",
"value": null
},
{
"timestamp": "2024-07-06T14:27:53Z",
"value": null
}
]
}
]
}
}

Request

Parameters

  • No query parameters required

  • No path parameters required

  • Header parameters

    ParameterDescription
    Authorizationstring(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

Returns the collected statistics on the queried metrics.

Response Body

{
"code": "integer",
"data": {
"results": [
{
"name": "string",
"stat": "string",
"unit": "string",
"values": [
{
"timestamp": "string",
"value": "string"
}
]
}
]
}
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
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.

Error Response

{
"code": integer,
"message": string
}
PropertyDescription
codeinteger
Indicates whether the request succeeds.
  • 0: The request succeeds.
  • Others: Some error occurs.
messagestring
Indicates the possible reason for the reported error.