Skip to main content

Query Cluster Metrics

Query the metrics of a specific cluster.

POST
/v2/clusters/{CLUSTER_ID}/metrics/query
Base URL

The base URL for this API is in the following format:

https://api.cloud.zilliz.com

export BASE_URL="https://api.cloud.zilliz.com"
Parameters
Authorizationstringheaderrequired

The authentication token should be an API key with appropriate privileges.

Example Value: Bearer {{TOKEN}}
CLUSTER_IDstringpathrequired

ID of the target cluster.

Example Value: inxx-xxxxxxxxxxxxxxx
Request Bodyapplication/json
startstring

The starting date and time for the metric reporting period, expressed in ISO 8601 timestamp format in UTC. Include this parameter and end 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 and start when the period parameter is not set.

periodstring

The duration over which Zilliz Cloud reports the metrics, expressed in ISO 8601 duration format in UTC. Include this parameter when both start and end parameters are not set.

granularitystringrequired

The time interval at which Zilliz Cloud reports the metrics, expressed in ISO 8601 duration format in UTC. The minimum granularity is PT30S.

metricQueriesarrayrequired

List of MetricQuery objects.

[]metricQueriesobjectrequired

A MetricQuery object.

metricNamestringrequired

Name of a metric.
For possible values, refer to the enumerations.
For details on these metrics, refer to Metrics & Alerts Reference.

statstringrequired

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.

export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/clusters/${CLUSTER_ID}/metrics/query" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"start": "2024-06-30T16:09:53Z",
"end": "2024-07-01T16:09:53Z",
"granularity": "PT6H",
"metricQueries": [
{
"name": "CU_COMPUTATION",
"stat": "AVG"
}
]
}'
Responses200 - application/json
codeinteger

Response code.

dataobject

Response payload.

resultsarray

List of collected statistics on the specified metric.

[]resultsobject

A set of collected statistics.

namestring

A metric name.

statstring

Statistical method applied.

unitstring

Unit of the value in the statistics.

valuesarray

List of collected statistics at an interval.

[]valuesobject

Statistics collected within an interval period.

timestampstring

The timestamp for the data point in ISO 8601 format.

valuestring

The value of the metric at the given timestamp.

Returns an error message.

codeinteger

Response code.

messagestring

Error message.

{
"code": 0,
"data": {
"results": [
{
"name": "CU_COMPUTATION",
"stat": "AVG",
"unit": "percent",
"values": [
{
"timestamp": "2024-06-30T16:09:53Z",
"value": null
},
{
"timestamp": "2024-06-30T22:09:53Z",
"value": "1.00"
},
{
"timestamp": "2024-07-01T04:09:53Z",
"value": "1.00"
},
{
"timestamp": "2024-07-01T10:09:53Z",
"value": "1.00"
}
]
}
]
}
}