prometheus开始但没有在浏览器上打开

时间:2017-12-11 10:35:39

标签: prometheus

enter image description here enter image description here 我在kubernetes使用prometheus docker image(quay.io/prometheus/prometheus:v2.0.0)。 prometheus pod开始并有这个日志:

kubectl -n monitoring logs -f prometheus-54968887c9-mf4pp
level=info ts=2017-12-11T10:08:33.252046504Z caller=main.go:215 msg="Starting Prometheus" version="(version=2.0.0, branch=HEAD, revision=0a74f98628a0463dddc90528220c94de5032d1a0)"
level=info ts=2017-12-11T10:08:33.252181297Z caller=main.go:216 build_context="(go=go1.9.2, user=root@615b82cb36b6, date=20171108-07:11:59)"
level=info ts=2017-12-11T10:08:33.252206582Z caller=main.go:217 host_details="(Linux 4.13.9-coreos #1 SMP Thu Oct 26 03:21:00 UTC 2017 x86_64 prometheus-54968887c9-mf4pp (none))"
level=info ts=2017-12-11T10:08:33.25620513Z caller=web.go:380 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2017-12-11T10:08:33.258030669Z caller=main.go:314 msg="Starting TSDB"
level=info ts=2017-12-11T10:08:33.25836032Z caller=targetmanager.go:71 component="target manager" msg="Starting target manager..."

但我无法在浏览器上打开它 - 我收到消息“服务不可用”

如何获得解决prometheus问题的详细日志?

https://i.stack.imgur.com/wJTmX.jpg

2 个答案:

答案 0 :(得分:0)

在非群集的情况下(没有dfproxy或HRM http路由网格)

您能否确认是否浏览到运行prometheus的节点的http://[ip:9090,是否返回"服务不可用"还是别的什么?

答案 1 :(得分:0)

使用标记--log.level

打开调试启动prometheus
$ /bin/prometheus -h
...
--log.level=info      [debug,
                      info,
                      warn,
                      error]

然后,使用以下方法检查容器的日志:

docker logs <name of prometheus container>
kubectl logs <name of prometheus pod>

此外,prometheus端口9090是否暴露在容器/吊舱/服务中?

Docs