I would like to install Prometheus on port 8080 instead of 9090 (its normal default). To this end I have edited /etc/systemd/system/prometheus.service
to contain this line:
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus.yaml --web.enable-admin-api \
--web.listen-address=":8080"
I.e., I am using option --web.listen-address
to specifiy the non-default port.
However, when I start Prometheus (2.0 beta) with systemctl start prometheus
I receive this error message:
parse external URL "": invalid external URL "http://<myhost>:8080\"/"
So how can I configure Prometheus such that I can reach its web UI at http://<myhost>:8080/
(instead of http://<myhost>:9090
)?
Prometheus is configured via command-line flags and a configuration file. While the command-line flags configure immutable system parameters (such as storage locations, amount of data to keep on disk and in memory, etc.), the configuration file defines everything related to scraping jobs and their instances, as well as which rule files to load.
Prometheus adds default http port to the Host header when querying targets. · Issue #2226 · prometheus/prometheus · GitHub .
Configuration. If the new configuration is not well-formed, the changes will not be applied. A configuration reload is triggered by sending a SIGHUP to the Prometheus process or sending a HTTP POST request to the /-/reload endpoint (when the --web.enable-lifecycle flag is enabled). This will also reload any configured rule files.
By default, it is running on localhost. I don't see any such option in the prometheus configuration maybe you should expand your question (but I don't have an answer; I'm also struggling with making prometheus load from a specific path, not root). The prometheus documentation is quite bad
The quotes were superfluous. This line will work:
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus.yaml --web.enable-admin-api \
--web.listen-address=:8080
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With