Troubleshooting

parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 8: did not find expected key"

안되면되게하자 2022. 1. 28. 14:34

# 출처 : https://groups.google.com/g/prometheus-users/c/hVwDPmjcXtg?pli=1

Unable to load configuration file to run prometheus

Hi all,
 
I am trying to run prometheus, and I am having the following error:
 
"Error loading config couldn't load configuration (--config.file=/etc/prometheus/prometheus.yml): parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 8: did not find expected key"
 
My confiuration file:
 
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: ['192.168.99.100:9132']  (Line 8)
    scheme: http
    timeout: 10s
scrape_configs:
- job_name: prometheus
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  static_configs:
   - targets: ['localhost:9132']
 
Any idea what does the error actually mean?
 
Thanks!
 
 
 
 
받는사람 Parth Bhagat, Prometheus Users
You need to insert 2 spaces at line 8.

- targets: ['192.168.99.100:9132']  (Line 8)  (x)
  - targets: ['192.168.99.100:9132']  (Line 8) (o)