Adding remote targets in prometheus.yml
-
hello everyone, I have installed Prometheus and now I want to add more targets to the prometheus.yml.
To do this, I open the file prometheus.yml in this path:
/home/yellowtent/appsdata/97a95880-aba9-44ad-bcda-237c3c433880/data/configi add this
- job_name: <SYSTEM-NAMEN>
scrape_interval: 5s
static_configs:
- targets: ['<MY-IP:9100']
after restart the Prometheus didn't start again. i see the changes in the file manager.
when I remove the lines again, everything works fine again. What am I doing wrong? Can you please help me?
Thank you in advance, Felix
- job_name: <SYSTEM-NAMEN>
-
Firstly I would advice to edit the file with the Cloudron Filemanager not directly in the root / as root from the system level.
-
Hello and thank you very much for the quick response from you. Editing the file in the ROOT system as well as with the File Manager has the same effects. Here is the log file: thank you very much felix
2023-12-18T06:55:40.000Z => Starting Prometheus
2023-12-18T06:55:40.000Z ts=2023-12-18T06:55:40.840Z caller=main.go:487 level=error msg="Error loading config (--config.file=/app/data/config/prometheus.yml)" file=/app/data/config/prometheus.yml err="parsing YAML file /app/data/config/prometheus.yml: yaml: line 31: did not find expected key"
2023-12-18T06:55:43.000Z => Source custom variables for cli args
2023-12-18T06:55:43.000Z => Starting Prometheus
2023-12-18T06:55:43.000Z ts=2023-12-18T06:55:43.655Z caller=main.go:487 level=error msg="Error loading config (--config.file=/app/data/config/prometheus.yml)" file=/app/data/config/prometheus.yml err="parsing YAML file /app/data/config/prometheus.yml: yaml: line 31: did not find expected key"
2023-12-18T06:55:47.000Z => Source custom variables for cli args
2023-12-18T06:55:47.000Z => Starting Prometheus
2023-12-18T06:55:47.000Z ts=2023-12-18T06:55:47.269Z caller=main.go:487 level=error msg="Error loading config (--config.file=/app/data/config/prometheus.yml)" file=/app/data/config/prometheus.yml err="parsing YAML file /app/data/config/prometheus.yml: yaml: line 31: did not find expected key" -
please post your
yamlwith removed / redacted sensitive information in a code block and not plain.
You can also always usee.g. :
job_name: <SYSTEM-NAMEN> scrape_interval: 5s static_configs: - targets: ['<MY-IP:9100']yamllint is also a great to to check if you
yamlfile is valid.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login