yaml: line 27: did not find expected key - metrics_path issue?

495 views
Skip to first unread message

Marcin Pyrszel

unread,
Apr 5, 2021, 6:41:27 AM4/5/21
to Prometheus Users

Hello, I used prometheus to get metrics. I have tried to downgrade to 2.16 on fresh raspbery. Everytime it fails even if on other devieces worked. What is wrong with my Code?


my global config
global:
  scrape_interval:     25s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 25s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).
# The job name is added as a label `job=<job_name>` to any timeseries
scraped from this config.
- job_name: 'base'
# metrics_path defaults to '/metrics'
metrics_path: '/prometheus/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['192.168.1.30:80']

The errors shows in "metrics line" or "scheme defaults" line? What is wrong with that code now? After deleting metrics path the code works.

prometheus --config.file=/etc/prometheus/prometheus.yml
level=error ts=2021-04-05T10:29:59.757Z caller=main.go:347 msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" err="parsing YAML file /etc/prometheus/prometheus.yml: yaml: line 27: did not find expected key"




Marcin Pyrszel

unread,
Apr 6, 2021, 1:41:52 AM4/6/21
to Prometheus Users

The error occurs in both 2.16 and 2.26 version (previously it worked in 2.16).
Reply all
Reply to author
Forward
0 new messages