昇腾社区首页
中文
注册

NPU-Exporter Prometheus Metrics接口

功能说明

提供Metrics接口,供Prometheus调用和集成。

集成Prometheus可参考部署Prometheus,启动Prometheus后可自动与NPU-Exporter对接。

URL

GET https://ip:port/metrics

NPU-Exporter为了安全考虑,默认启用容器级别端口(默认8082),请求IP为Kubernetes容器IP,当K8s网络插件为calico时,网络策略设置为允许label为app=prometheus的应用访问。

请求参数

响应说明

按照Prometheus的专用格式返回数据,相关指标如下所示。Prometheus自带指标无需关注,不在此展示说明。

...
# HELP machine_npu_nums Amount of npu installed on the machine.
# TYPE machine_npu_nums gauge
machine_npu_nums 8
# HELP npu_chip_info_error_code the npu error code
# TYPE npu_chip_info_error_code gauge
npu_chip_info_error_code{id="0"} 0 1613993498553
npu_chip_info_error_code{id="1"} 0 1613993498588
npu_chip_info_error_code{id="2"} 0 1613993498615
npu_chip_info_error_code{id="3"} 0 1613993498645
npu_chip_info_error_code{id="4"} 0 1613993498676
npu_chip_info_error_code{id="5"} 0 1613993498685
npu_chip_info_error_code{id="6"} 0 1613993498715
npu_chip_info_error_code{id="7"} 0 1613993498742
# HELP npu_chip_info_hbm_total_memory the npu hbm total memory
# TYPE npu_chip_info_hbm_total_memory gauge
npu_chip_info_hbm_total_memory{id="0"} 32255 1613993498553
npu_chip_info_hbm_total_memory{id="1"} 32255 1613993498588
npu_chip_info_hbm_total_memory{id="2"} 32255 1613993498615
...
表1 Prometheus labels

标签名称

标签说明

数值单位

machine_npu_nums

昇腾系列AI处理器数目。

npu_chip_info_error_code

昇腾系列AI处理器错误码。

-

npu_chip_info_name

昇腾系列AI处理器名称和id。

-

npu_chip_info_health_status

昇腾系列AI处理器健康状态。

  • 1:健康
  • 0:不健康

npu_chip_info_power

昇腾系列AI处理器功耗。

瓦特(W)

npu_chip_info_temperature

昇腾系列AI处理器温度。

摄氏度(℃)

npu_chip_info_used_memory

昇腾系列AI处理器已使用内存。

MB

npu_chip_info_total_memory

昇腾系列AI处理器总内存。

MB

npu_chip_info_hbm_used_memory

昇腾系列AI处理器HBM已使用内存(昇腾910 AI处理器专属)。

MB

npu_chip_info_hbm_total_memory

昇腾系列AI处理器HBM总内存(昇腾910 AI处理器专属)。

MB

npu_chip_info_utilization

昇腾系列AI处理器AI Core利用率。

%

npu_chip_info_voltage

昇腾系列AI处理器电压。

伏特(V)

npu_exporter_version_info

NPU-Exporter版本信息。

-

npu_container_info

NPU容器信息,输出包含以下字段:

  • containerID:容器ID,string类型。
  • containerName:容器名,string类型。

    输出格式为“Pod Namespace_Pod名_容器名”。

  • npuID:NPU ID,string类型。

-

container_npu_total_memory

带有容器信息的NPU内存总大小,只支持整卡。

容器信息包含以下字段:

  • id:NPU ID, string类型。
  • pod_name: string类型。
  • container_name:string类型
  • namespace:string类型

MB

container_npu_used_memory

带有容器信息的NPU已使用内存,只支持整卡。

容器信息包含以下字段:

  • id:NPU ID,string类型。
  • pod_name: string类型。
  • container_name:string类型
  • namespace:string类型

MB

container_npu_utilization

带有容器信息的NPU利用率,只支持整卡。

容器信息包含以下字段:

  • id:NPU ID, string类型。
  • pod_name: string类型。
  • container_name:string类型。
  • namespace:string类型。

%

状态码

表2 状态码

状态码

含义

200

正常状态。

307

临时跳转。

500

服务器内部错误。