error loading config from prometheus yml couldn t load configuration --config file prometheus yml parsing YAML file prometheus yml yaml unmarshal errors

+1 vote

Hi Guys,

I am trying to start Prometheus server in my system, but I am getting some error as shown below.

$ ./prometheus
level=error ts=2020-05-27T06:42:06.463Z caller=main.go:758 err="error loading config from \"prometheus.yml\": couldn't load configuration (--config.file=\"prometheus.yml\"): parsing YAML file prometheus.yml: yaml: unmarshal errors:\n  line 30: field static_configs already set in type config.plain"

I used this below configuration file.

scrape_configs:
- job_name: 'prometheus'
  static_configs:
  - targets: ['localhost:9090']
  static_configs:
  - targets: ['10.0.2.15:9100']

 Can anyone help me with this?

May 27, 2020 in DevOps & Agile by akhtar
• 38,230 points
16,676 views

1 answer to this question.

+1 vote

Hi@akhtar,

Whenever you add any node to scrape its metrics, you have to give job name for individuals. In your code you missed job name. Correct your configuration file as given below.

scrape_configs:
- job_name: 'prometheus'
  static_configs:
  - targets: ['localhost:9090']
- job_name: 'Node1'
  static_configs:
  - targets: ['10.0.2.15:9100']

Now it will not give any error.

answered May 27, 2020 by MD
• 95,440 points

Related Questions In DevOps & Agile

+1 vote
1 answer

Unable to execute the exported jar file exported from eclipse for the selenium webdriver test.

Hi Ijaz Looks like when you are executing ...READ MORE

answered Dec 4, 2019 in DevOps & Agile by Raveendiran
• 980 points
1,139 views
0 votes
1 answer

error no configuration has been provided kubectl

Hi@Kapil, Kubectl will mot come with minikube. You ...READ MORE

answered May 27, 2020 in DevOps & Agile by MD
• 95,440 points
1,052 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,460 views
+2 votes
1 answer
+3 votes
5 answers

How to run YML compose file?

You can run the following command to ...READ MORE

answered May 7, 2019 in DevOps & Agile by Mithin
246,966 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP