我想在端口8080而不是9090上安装Prometheus(它是正常的默认设置)。为此,我进行了编辑/etc/systemd/system/prometheus.service以包含以下行:
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus.yaml --web.enable-admin-api \
--web.listen-address=":8080"
Run Code Online (Sandbox Code Playgroud)
即,我正在使用选项--web.listen-address来指定非默认端口。
但是,当我使用Prometheus(2.0 beta)启动时,systemctl start prometheus收到以下错误消息:
parse external URL "": invalid external URL "http://<myhost>:8080\"/"
Run Code Online (Sandbox Code Playgroud)
那么,如何配置Prometheus,以便可以在http://<myhost>:8080/(而不是http://<myhost>:9090)访问其Web UI ?