Help Center> ModelArts> API Reference> Service Management> Obtaining Service Monitoring
Updated on 2024-04-30 GMT+08:00

Obtaining Service Monitoring

Function

This API is used to obtain service monitoring information.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v1/{project_id}/services/{service_id}/monitor

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

service_id

Yes

String

Service ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

node_id

No

String

ID of the edge node to be obtained. This parameter is available only when infer_type is set to edge. By default, all nodes are obtained.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

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.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

service_name

String

Service name

service_id

String

Service ID

monitors

Array of Monitor objects

Monitoring details

service_running_instance_count

Integer

Number of running service instances

service_instance_count

Integer

Number of service instances

req_count_per_min

Long

Total number of service calls in the last minute

Table 5 Monitor

Parameter

Type

Description

failed_times

Integer

Number of times that a model instance fails to be called. This parameter is available for real-time services.

model_version

String

Model version, which is available for real-time services

cpu_memory_total

Integer

Total memory, in MB

gpu_usage

Float

Number of used GPUs

node_name

String

Node name, which is available for edge services

gpu_total

Float

Total number of GPUs

model_id

String

Model ID, which is available for real-time services

invocation_times

Integer

Number of times that a model instance is called. This parameter is available for real-time services.

cpu_core_usage

Float

Number of used CPU cores

cpu_core_total

Float

Total number of CPU cores

model_name

String

Model name, which is available for real-time services

cpu_memory_usage

Integer

Used memory, in MB

node_id

String

Edge node ID, which is available for edge services

model_running_instance_count

Integer

Number of running model instances

model_instance_count

Integer

Number of model instances

gpu_memory_total

Float

Total GPU memory, in MB

gpu_memory_usage

Float

Used GPU memory, in MB

npu_total

Float

Total number of NPUs

npu_usage

Float

Number of used NPUs

npu_memory_total

Float

Total NPU memory, in MB

npu_memory_usage

Float

Used NPU memory, in MB

Example Requests

GET https://{endpoint}/v1/{project_id}/services/{service_id}/monitor

Example Responses

Status code: 200

Monitoring information

{
  "service_name" : "mnist",
  "service_id" : "195c1f2d-136d-40af-a0f3-db5717d2634a",
  "monitors" : [ {
    "failed_times" : 1,
    "model_version" : "1.0.0",
    "cpu_core_total" : 4,
    "cpu_memory_total" : 8192,
    "model_name" : "minst",
    "gpu_usage" : 0.6,
    "cpu_memory_usage" : 2011,
    "gpu_total" : 1,
    "model_id" : "0e07b41b-173e-42db-8c16-8e1b44cc0d44",
    "invocation_times" : 50,
    "cpu_core_usage" : 2.4
  } ]
}

Status Codes

Status Code

Description

200

Monitoring information

Error Codes

See Error Codes.