Query Metrics
Queries the metrics of a cluster.
The base URL for this API is in the following format:
https://controller.api.${CLOUD_REGION}.zillizcloud.com
- You need to replace
${CLOUD_REGION}
with the appropriate region for your deployment. - To get the cloud region ID, refer to On Zilliz Cloud Console or List Cloud Regions.
export CLOUD_REGION="gcp-us-west1"
export BASE_URL="https://controller.api.${CLOUD_REGION}.zillizcloud.com"
The authentication token should be an API key with appropriate privileges.
The ID of the cluster.
The starting date and time for the metric reporting period, expressed in ISO 8601 timestamp format in UTC. Use this parameter when the period
parameter is not set.
The ending date and time for the metric reporting period, expressed in ISO 8601 timestamp format in UTC. Use this parameter when the period
parameter is not set.
The duration over which the metrics are reported, expressed in ISO 8601 duration format in UTC. Use this parameter when neither start
nor end
parameters are not set.
The time interval at which the metrics are reported, expressed in ISO 8601 duration format in UTC. The minimum granularity is PT30S.
An array of MetricQuery objects.
The information about the metric.
The name of the metric to query. For details about available metrics, refer to Metrics & Alerts Reference.
The statistical method to apply to the metric. AVG is the average value available for each metric, while P99 is the 99th percentile value for latency-related metrics.
export TOKEN="YOUR_API_KEY"
export CLUSTER_ID="inxx-xxxxxxxxxxxxxxxxx"
curl --request POST \
--url "${BASE_URL}/v1/clusters/${CLUSTER_ID}/metrics/query" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Content-Type: application/json" \
-d '{
"start": "",
"end": "",
"period": "PT99H",
"granularity": "PT5H",
"metricQueries": [
{
"name": "CU_CAPACITY",
"stat": "AVG"
}
]
}'
A success response.
Response code.
Response payload, which is an object containing information about the queried metric.
An array of result objects.
Information about the metric.
The name of the metric.
The statistical function applied to the metric.
The unit of measurement for the metric (e.g., percent).
An array of data points.
A data point in detail.
The timestamp for the data point in ISO 8601 format.
The value of the metric at the given timestamp.
A failure response.
Response code.
Error message.
{
"code": 200,
"data": {
"results": [
{
"name": "CU_COMPUTATION",
"stat": "AVG",
"unit": "percent",
"values": [
{
"timestamp": "2024-07-23T16:09:53Z",
"value": "1.00"
},
{
"timestamp": "2024-07-23T22:09:53Z",
"value": "1.00"
},
{
"timestamp": "2024-07-24T04:09:53Z",
"value": "1.00"
}
]
}
]
}
}