提供Metrics接口,供Prometheus调用和集成。
GET http://ip:port/metrics
NPU Exporter为了安全考虑,默认启用容器级别端口(默认8082),请求IP为Kubernetes容器IP,当K8s网络插件为calico时,网络策略设置为允许label为app=prometheus的应用访问。
无
按照Prometheus的专用格式返回数据,相关数据信息如下所示,仅供参考,以实际回显为准。数据信息的详细说明参见下文或数据信息说明.xlsx。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_aicore_current_freq the npu ai core current frequency, unit is 'MHz' # TYPE npu_chip_info_aicore_current_freq gauge npu_chip_info_aicore_current_freq{container_name="",id="0",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:61:00.0",pod_name="",vdie_id="185011D4-21104518-A0C4ED94-14CC040A-56102003"} 1000 1723621883587 npu_chip_info_aicore_current_freq{container_name="",id="1",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:DB:00.0",pod_name="",vdie_id="185011D4-21E04718-93B2ED94-14CC040A-BF102003"} 1000 1723621883932 npu_chip_info_aicore_current_freq{container_name="",id="2",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:B2:00.0",pod_name="",vdie_id="185011D4-20C02418-59D4ED94-14CC040A-F9102003"} 1000 1723621884277 npu_chip_info_aicore_current_freq{container_name="",id="3",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:3E:00.0",pod_name="",vdie_id="185011D4-21502C18-0464ED94-14CC040A-6E102003"} 1000 1723621884682 npu_chip_info_aicore_current_freq{container_name="",id="4",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:60:00.0",pod_name="",vdie_id="185011D4-21A02418-64946D94-14CC040A-F8102003"} 1000 1723621885026 npu_chip_info_aicore_current_freq{container_name="",id="5",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:DA:00.0",pod_name="",vdie_id="185011DC-21F02B18-C4B66D94-14CC040A-57102003"} 1000 1723621885385 npu_chip_info_aicore_current_freq{container_name="",id="6",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:B1:00.0",pod_name="",vdie_id="185011D4-20602118-14646D94-14CC040A-8A102003"} 1000 1723621885784 npu_chip_info_aicore_current_freq{container_name="",id="7",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:3D:00.0",pod_name="",vdie_id="185011D4-21504C18-10656D94-14CC040A-6B102003"} 1000 1723621886131 # HELP npu_chip_info_bandwidth_rx the npu interface receive speed, unit is 'MB/s' # TYPE npu_chip_info_bandwidth_rx gauge npu_chip_info_bandwidth_rx{container_name="",id="0",model_name="910A-Ascend-V1",namespace="",pcie_bus_info="0000:61:00.0",pod_name="",vdie_id="185011D4-21104518-A0C4ED94-14CC040A-56102003"} 0 1723621883587 ...
本接口提供查询的Prometheus labels包含几个部分。
了解以上各项数据信息中标签的说明,请参见标签数据信息说明。
NPU Exporter是通过调用底层的HDK接口,获取相应的信息。数据信息调用的HDK接口请参考NPU Exporter调用的HDK接口.xlsx。查找数据信息对应的HDK接口,可参考如下步骤。
状态码 |
含义 |
---|---|
200 |
正常状态。 |
307 |
临时跳转。 |
500 |
服务器内部错误。 |