Get the metrics for a training job.
curl --request POST \
--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics \
--header "Authorization: Api-Key $BASETEN_API_KEY" \
--data '{
"end_epoch_millis": null,
"start_epoch_millis": null
}'
{
"gpu_memory_usage_bytes": {},
"gpu_utilization": {},
"cpu_usage": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"cpu_memory_usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"ephemeral_storage": {
"usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"utilization": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"training_job": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"current_status": "<string>",
"error_message": "<string>",
"instance_type": {
"id": "<string>",
"name": "<string>",
"memory_limit_mib": 123,
"millicpu_limit": 123,
"gpu_count": 123,
"gpu_type": "<string>",
"gpu_memory_limit_mib": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"training_project_id": "<string>",
"training_project": {
"id": "<string>",
"name": "<string>"
}
},
"cache": {
"usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"utilization": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"per_node_metrics": [
{
"node_id": "<string>",
"metrics": {
"gpu_memory_usage_bytes": {},
"gpu_utilization": {},
"cpu_usage": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"cpu_memory_usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"ephemeral_storage": {
"usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"utilization": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
}
}
]
}
You must specify the scheme 'Api-Key' in the Authorization header. For example, Authorization: Api-Key <Your_Api_Key>
A request to fetch metrics. Allows the user to request metrics over a period of time.
A response to fetch training job metrics. The outer list for each metric represents that metric across time.
Was this page helpful?
curl --request POST \
--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics \
--header "Authorization: Api-Key $BASETEN_API_KEY" \
--data '{
"end_epoch_millis": null,
"start_epoch_millis": null
}'
{
"gpu_memory_usage_bytes": {},
"gpu_utilization": {},
"cpu_usage": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"cpu_memory_usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"ephemeral_storage": {
"usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"utilization": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"training_job": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"current_status": "<string>",
"error_message": "<string>",
"instance_type": {
"id": "<string>",
"name": "<string>",
"memory_limit_mib": 123,
"millicpu_limit": 123,
"gpu_count": 123,
"gpu_type": "<string>",
"gpu_memory_limit_mib": 123
},
"updated_at": "2023-11-07T05:31:56Z",
"training_project_id": "<string>",
"training_project": {
"id": "<string>",
"name": "<string>"
}
},
"cache": {
"usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"utilization": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
},
"per_node_metrics": [
{
"node_id": "<string>",
"metrics": {
"gpu_memory_usage_bytes": {},
"gpu_utilization": {},
"cpu_usage": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"cpu_memory_usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"ephemeral_storage": {
"usage_bytes": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
],
"utilization": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
}
}
]
}