Get Knowledge Base Monitoring
Updated at:
Get storage usage and QPS metrics for a Knowledge Base over a given time range.
Prerequisites
Get an API key and a workspace ID, and configure authentication first. See API overview and Authentication.
Endpoint
POST /api/v1/indices/rag/index/monitor
Get storage usage and QPS metrics for a Knowledge Base over a given time range.
WarningTimestamps are second-level Unix timestamps (not milliseconds). We recommend passing them as strings (for example "1780900000"); the integer format is also supported.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
indexId | Yes | string | Knowledge Base ID. |
startTimestamp | Yes | string or integer | Query start time as a second-level Unix timestamp (not milliseconds). Both string and integer formats are supported (for example "1780900000" or 1780900000). |
endTimestamp | Yes | string or integer | Query end time, in the same format as startTimestamp. The end time can be at most 30 days after the start time. |
Request example
curl -X POST "$BASE_URL/api/v1/indices/rag/index/monitor" \
-H "Authorization: Bearer $BAILIAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"indexId": "your-kb-id",
"startTimestamp": "1780900000",
"endTimestamp": "1781000000"
}'
BASE_URL is https://{workspace_id}.cn-beijing.maas.aliyuncs.com ({workspace_id} is the workspace ID), and BAILIAN_API_KEY is your Alibaba Cloud Model Studio API key.
Response example
Returns 200 on success.
{
"code": "Success",
"status_code": 200,
"data": {
"storageMonitorData": [],
"qpsMonitorData": []
},
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Response fields
| Field | Type | Description |
|---|---|---|
code | string | Response code. Success when successful. |
status_code | integer | HTTP status code. |
request_id | string | Unique request identifier. Provide this ID when troubleshooting. |
success | boolean | Whether the request succeeded. |
message | string | Response message. success when successful. |
status | string | Request status: SUCCESS or FAILED. |
data | object | Monitoring data. See the table below for sub-fields. |
data fields
| Field | Type | Description |
|---|---|---|
pipelineCommercialType | string | Commercial type of the Knowledge Base, for example standard. |
storageMonitorData | object | Storage usage monitoring data. Sub-fields: indexStorageLimit (number, storage limit in GB), indexStorageUsage (number, used storage in GB). |
qpsMonitorData | object | QPS monitoring data. Sub-fields: peakQps (integer, peak QPS within the statistical interval), totalRequests (integer, total requests within the window), avgQpsOfActiveSeconds (number, average QPS over active seconds within the window), monitorData (array, monitoring data aggregated by time window; see the table below for element fields). |
monitorData element fields
| Field | Type | Description |
|---|---|---|
windowRange | integer | Window start time as a Unix timestamp in seconds. |
windowRangeEnd | integer | Window end time as a Unix timestamp in seconds. |
peakQpsInWindowRange | integer | Peak QPS within the window. |
totalRequests | integer | Total requests within the window. |
avgQpsOfActiveSeconds | number | Average QPS over active seconds within the window. |
successData | object | Sub-fields: peakQpsInWindowRange (integer, peak QPS within the window), totalRequests (integer, total requests), avgQpsOfActiveSeconds (number, average QPS over active seconds). |
limitData | object | Sub-fields: peakQpsInWindowRange (integer, peak QPS within the window), totalRequests (integer, total requests), avgQpsOfActiveSeconds (number, average QPS over active seconds). |
failData | object | Sub-fields: peakQpsInWindowRange (integer, peak QPS within the window), totalRequests (integer, total requests), avgQpsOfActiveSeconds (number, average QPS over active seconds). |
Is this page helpful?