electrs icon indicating copy to clipboard operation
electrs copied to clipboard

Bug: doc/monitoring.md does not work on Ubuntu 20.04

Open mujtaba1747 opened this issue 3 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is. If one follows the commands mentioned in monitoring.md, it results in an invalid prometheus.yml file. As the field scrape configs is already set in it.

Electrs version Version: 0.9.5

To Reproduce Steps to reproduce the behavior:

  1. Enter the commands in monitoring.md. It will install prometheus as well. Don't install it separately.
  2. Check status of prometheus using: sudo systemctl status prometheus
  3. It fails to start, due to the invalid config file located at: /etc/prometheus/prometheus.yml

Expected behavior A clear and concise description of what you expected to happen. Prometheus was expected to start and listen to metrics from electrs from port 4224

System running electrs

  • Deployment method: Manual. Doesn't matter as monitoring.md is a simple script
  • OS name and version: Ubuntu 20.04

Additional context Here are the last lines of the error log of prometheus after running the commands:

level=info ts=2022-02-24T11:02:10.428Z caller=main.go:545 msg="Scrape manager stopped"
level=error ts=2022-02-24T11:02:10.428Z caller=main.go:725 err="error loading config from \"/etc/prometheus/prometheus.yml\": couldn't load configuration (--config.file=\"/etc/prometheus/prometheus.yml\"): parsing YAML file /etc/prometheus/prometheus.yml: yaml: unmarshal errors:\n  line 46: field scrape_configs already set in type config.plain"

The full log can be found here: https://pastebin.com/JdEVLzsa

mujtaba1747 avatar Feb 24 '22 11:02 mujtaba1747

We can add an additional comment asking to remove or comment the scrape config field, in case it's already present.

mujtaba1747 avatar Feb 24 '22 11:02 mujtaba1747

I'm not sure how hard we should try making the example perfect. It'd eventually become an electrs-prometheus installer. Maybe suitable for packaging.

Kixunil avatar Feb 24 '22 13:02 Kixunil