1. 安装prometheus_client库 pip3 install prometheus_client 1. 2. 代码 #!/usr/bin/python3 from prometheus_client import start_http_server,Gauge import os import time #定义数据类型,metric,describe(描述),标签 dir_num = Gauge('dirNum','Calculate the number of directories',['instance']) def g...