我在机器上设置了prometheus并测试了运行prometheus的默认端点(即localhost:9090)的指标。它工作正常。现在将目标更改为本地运行的服务器的端点后,出现错误,因此没有能够获取端点的任何指标。
新端点-http://0.0.0.0:8090/health
错误消息:
level = warn ts = 2019-10-16T07:12:28.713Z呼叫者= scrape.go:930 component =“ scrape manager” scrape_pool = prometheus target = http://0.0.0.0:8090/health msg =“ append failed” err =“指标后的期望值,为\“ MNAME \”“
答案 0 :(得分:1)
您确定您的/health
端点产生了Prometheus指标吗?普罗米修斯希望刮擦看起来像这样的东西:
# HELP alertmanager_alerts How many alerts by state.
# TYPE alertmanager_alerts gauge
alertmanager_alerts{state="active"} 7
alertmanager_alerts{state="suppressed"} 0
# HELP alertmanager_alerts_invalid_total The total number of received alerts that were invalid.
# TYPE alertmanager_alerts_invalid_total counter
alertmanager_alerts_invalid_total{version="v1"} 0
alertmanager_alerts_invalid_total{version="v2"} 0
这与在浏览器中打开http://host:8090/health
时看到的内容相似吗?根据您看到的错误消息,我对此表示严重怀疑。