我在使用Prometheus client module用Python编写exporter时遇到了这个问题。我的一些自定义指标以字节为单位度量内存,因此我在导出器中定义了一个指标:
NODES_MEM_FREE = GaugeMetricFamily('slurm_nodes_mem_free', 'Amounts of free memory allocated on nodes in the cluster ...', labels=self.labels, unit='bytes')
(完整代码here)
单位被显式指定为“字节”,由Prometheus客户端识别,因为度量最终在/metrics
端点显示为slurm_nodes_mem_free_bytes
。但是,当我在Prometheus服务器上检查/api/v1/metadata
处的输出时,该单元为空,即:
"slurm_nodes_mem_free_bytes":[{"type":"gauge","help":"Amounts of free memory allocated on nodes in the cluster grouped by cluster, partition","unit":""}]
首先,我认为Python客户机有问题,但随后我注意到元数据中的每个度量都包含包中附带的Prometheus内部度量。这是缺少的功能还是我的普罗米修斯主机上的设置有问题
我正在使用:
目前没有回答
相关问题 更多 >
编程相关推荐