Querying Resource Monitoring Metric Details
Function
This API is used to obtain the resource metric information of My Services in the MaaS real-time inference module. Data is retained for 30 days only.
Constraints
- Region restrictions: Only the CN-Hong Kong region is supported.
- API rate limiting: The total number of requests for this API from all users cannot exceed 1,000 within one minute.
- User request limit: The number of requests for this API from a single user cannot exceed 200 within one minute.
- Rate-limiting response: When the rate limit is exceeded, the API returns the HTTP status code 429 "Too Many Requests".
- Retry suggestion: If the rate limit is exceeded, wait 60 seconds and try again.
URI
GET /v1/{project_id}/maas/monitoring/{service_id}/detail-statistics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID and Name. Constraints: N/A Range: The value can contain 32 characters. Only lowercase letters and digits are allowed. Default Value: N/A |
| service_id | Yes | String | Definition: Service IDs to be queried. Services are filtered based on the input service ID list. If this parameter is not specified, all service names corresponding to the IDs are returned. You can obtain the service ID from the response body during service creation, or call the API for obtaining the service list. The service_id field indicates the service ID. Constraints: N/A Range: The value can contain 1 to 128 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| start_time | Yes | Long | Definition: Timestamp of the start time, in milliseconds. Constraints: N/A Range: The value must be greater than 0 and less than or equal to the value of end_time. The end time must be at least 30 days from the start time. Default Value: N/A |
| end_time | Yes | Long | Definition: Timestamp of the end time, in milliseconds. Constraints: The end time must be within 30 days from the start time. Range: The value must be greater than 0. Default Value: N/A |
| metric_name | Yes | String | Definition: Metric name. Constraints: N/A Range:
Default Value: N/A |
| timezone | No | String | Definition: Time zone. Constraints: N/A Range: The value must comply with the IANA time zone specifications, such as Asia/Shanghai and UTC. Default Value: Asia/Shanghai (GMT+8) |
| model_id | Yes | String | Definition: Model ID. To obtain the model ID, log in to the MaaS console. In the navigation pane on the left, choose . In the My Services tab, click the service name. On the displayed details page, press F12 and access the Network tab. Then, view the value of model_id in the response body of the models API. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details, see Authentication. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| points | Array of DataPoint objects | Definition: Data point. Range: N/A |
| metric_name | String | Definition: Metric name. Range:
|
| unit | String | Definition: Metric unit. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| val | Double | Definition: Metric value. Range: N/A |
| time | Long | Definition: Timestamp, in milliseconds. Range: N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, which identifies the error type. For details, see MaaS Error Codes. Range: N/A |
| error_msg | String | Definition: Error description. For details, see MaaS Error Codes. Range: N/A |
Request Example
Query the output TPS of the service whose service ID is {<service-ID>} and model ID is 29f474eb-67bc-4a7c-9771-c98c568c1c8c from 1769532157287 to 1769535757287.
/v1/{project_id}/maas/monitoring/{service_id}/detail-statistics?start_time=1769532157287&end_time=1769535757287&metric_name=completion_tps&model_id=29f474eb-67bc-4a7c-9771-c98c568c1c8c&timezone=Asia/Shanghai Response Example
Status code: 200
Success response
{
"points" : [ ],
"metric_name" : "running_task",
"unit" : "num"
} Status code: 400
Failure response
{
"error_msg" : "Database error.",
"error_code" : "ModelArts.2010"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success response |
| 400 | Failure response |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot