All Products
Search
Document Center

Platform For AI:GetJobMetrics

Last Updated:Jan 12, 2026

Obtains the monitoring data of a job, including the CPU, GPU, and memory utilization, network, and disk read/write rate. ⚠️ Note: Except for pay-as-you-go tasks based on general-purpose computing resources, all task types are connected to CloudMonitor. Use the CloudMonitor API to call related monitoring. The overwritten features in the original API are no longer maintained. For more information, see \\[Training monitoring and alerting]\\(https://www.alibabacloud.com/help/zh/pai/user-guide/training-monitoring-and-alerting).

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
paidlc:GetJobMetricsget
*All Resources
*
    none
none

Request syntax

GET /api/v1/jobs/{JobId}/metrics HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
JobIdstringYes

The job ID. You can call ListJobs to query all job IDs.

dlc-20210126170216-*******
StartTimestringNo

The beginning of the time range to query monitoring data. The time is displayed in UTC. The default value is the time 1 hour before the current time.

2020-11-08T16:00:00Z
EndTimestringNo

The end time of the time range to query monitoring data. The time is displayed in UTC. The default value is the current time.

2020-11-09T16:00:00Z
TimeStepstringNo

The interval at which monitoring data is returned. Default value: 5. Unit: minutes.

5m
MetricTypestringYes

The type of the monitoring metrics. Valid values:

  • GpuCoreUsage: GPU utilization
  • GpuMemoryUsage: GPU memory utilization
  • CpuCoreUsage: CPU utilization
  • MemoryUsage: memory utilization
  • NetworkInputRate: the network write in rate.
  • NetworkOutputRate: the network write out rate
  • DiskReadRate: the disk read rate
  • DiskWriteRate: the disk write rate
GpuMemoryUsage
TokenstringNo

The temporary token used for authentication.

eyXXXX-XXXX.XXXXX

Response parameters

ParameterTypeDescriptionExample
object

The monitoring data of the job.

JobIdstring

The job ID.

dlc-20210126170216-*******
PodMetricsarray

The monitoring metrics of the job.

PodMetricsPodMetric

The monitoring metric of the job.

RequestIdstring

The request ID. You can troubleshoot issues based on the request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "JobId": "dlc-20210126170216-*******",
  "PodMetrics": [
    {
      "PodId": "dlc-20210329110128-******-worker-0",
      "Metrics": [
        {
          "Time": 1616987726587,
          "Value": 23.45
        }
      ]
    }
  ],
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-04-23Add OperationView Change Details