Unable to load configuration file to run prometheus

2,152 views
Skip to first unread message

parth....@parlamind.com

unread,
Sep 4, 2018, 5:56:57 AM9/4/18
to Prometheus Users
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!

Regards,
Parth

Simon Pasquier

unread,
Sep 4, 2018, 6:09:42 AM9/4/18
to Parth Bhagat, Prometheus Users
You need to insert 2 spaces at line 8.


--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/5f00af5f-5764-4582-afc0-366e872f6791%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Parth Bhagat

unread,
Sep 4, 2018, 6:11:04 AM9/4/18
to Simon Pasquier, Prometheus Users
Hi Simon,

Could please suggest where to exactly insert two spaces in line 8?


Simon Pasquier

unread,
Sep 4, 2018, 6:27:04 AM9/4/18
to Parth Bhagat, Prometheus Users
In fact your configuration had several indentation issues, YAML isn't the easiest format to get right...
Here is the sanitized version:

Parth Bhagat

unread,
Sep 4, 2018, 7:43:54 AM9/4/18
to Simon Pasquier, Prometheus Users
Hi Simon,

Tried the sanitized version as well, still returning the same error.!!

Simon Pasquier

unread,
Sep 4, 2018, 7:52:22 AM9/4/18
to Parth Bhagat, Prometheus Users
It doesn't fail for me though. You're probably not using the correct file.

Parth Bhagat

unread,
Sep 4, 2018, 7:54:32 AM9/4/18
to Simon Pasquier, Prometheus Users
I just copied and paste your file, without any modifications, still returning the error.!!

Simon Pasquier

unread,
Sep 4, 2018, 8:00:34 AM9/4/18
to Parth Bhagat, Prometheus Users
Sorry but this works for me:
prometheus
Reply all
Reply to author
Forward
0 new messages