跳到主要内容

部署监控

查询基模型资源监控信息,CPU、GPU(显存和算力)、MEM(需要部署专门监控业务Pod的Prometheus)。
GET
https://api.alayanew.com/api/serverless-infer/v1/deployment/{serviceId}/resource/metrics
Authorizations
AuthorizationsStringHeaderRequired

用户可通过已获取Serverless API Key做验证,例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]。

Path Parameters
serviceIdStringRequired

服务ID。

Response
状态码:application/json
codeInt

code是一种常见的返回值形式,表示查询操作的执行结果。

0是成功标识,表示操作成功完成。
dataArray

msgString

code返回值为-1时,返回异常信息。

curl --location --request GET 'https://api.alayanew.com/api/serverless-infer/v1/deployment/38fbfc3d-6a88-4c35-b8b6-9efc83949d47/resource/metrics' 
     --header 'Authorization:plain Credential=YOUR_AK,Signature=YOUR_SK' 
     --header 'Content-Type: application/json'
{
    "code": 0,
    "data": {
        "ks-49eo39mdrmvjuqngw2cabuthw6lt5uma-00001": {
            "worker-0": {
                "mem": {
                    "total": 0.0146,
                    "rate": 212.3701,
                    "used": 3.1109
                },
                "cpu": {
                    "total": 7.0,
                    "rate": 0.0517,
                    "used": 0.3616
                }
            },
            "worker-1": {
                "mem": {
                    "total": 0.0146,
                    "rate": 174.9089,
                    "used": 2.5621
                },
                "cpu": {
                    "total": 7.0,
                    "rate": 0.0842,
                    "used": 0.5895
                },
                "gpu": {
                    "GPU-b61c1fde-9dba-e840-0b58-086ce93486e5": {
                        "mem": {
                            "used": 42.4805
                        },
                        "name": "gpu-l40s",
                        "utilization": {
                            "used": 0.0
                        }
                    }
                }
            }
        }
    }
}