0

I am trying to set up a new Prometheus server, and the config file has changed a little since I last did this. I have edited my config file, but I am getting the following error.

Couldn't load configuration (-config.file=/etc/prometheus/prometheus.yml): yaml: line 13: found unexpected ':'

here is my prometheus.yml file:

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    monitor: 'int-metrics'

rule_files:

scrape_configs:

- job_name: 'containers'
  scrape_interval: 5s
  static_configs:
  - targets: ['192.168.120.11:9104',192.168.120.12:9104','192.168.120.13:9104','192.168.120.14:9104']

- job_name: 'rabbitmq'
  scrape_interval: 5s
  static_configs:
  - targets: ['192.168.120.11:9090','192.168.120.12:9090','192.168.120.13:9090','192.168.120.14:9090']

- job_name: 'node'
  scrape_interval: 15s
  static_configs:
  - targets: ['192.168.120.11:9100','192.168.120.12:9100','192.168.120.13:9100','192.168.120.14:9100']

line 13 is the first "static_configs" line. All the documentation says there should be a colon. If I remove it I get this error:

Couldn't load configuration (-config.file=/etc/prometheus/prometheus.yml): yaml: line 13: could not find expected ':'

?!? what is wrong with the syntax?

2
  • What happens if you remove the rule_files ?
    – user9517
    Aug 30, 2016 at 9:06
  • error moves to line 12
    – Mark Jones
    Aug 30, 2016 at 10:44

2 Answers 2

0

it must have been some line feed or something.

I typed the whole thing out again and it works. Comparing the text and there is no difference.

0

This probably isn't an issue for you anymore, but I stumbled across this thread with a similar issue.

In your first "targets" array, your second entry is missing a starting single-quote.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .