Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus in Docker: Error loading config couldn't load configuration, no such file or directory #3846

Closed
kaytrance opened this Issue Feb 15, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@kaytrance
Copy link

kaytrance commented Feb 15, 2018

Having a simplest docker-compose file I am unable to run it with the following error.

In my project directory there's a directory called configs with prometheus.yml:

│   docker-compose.yml
│
└──────configs
        prometheus.yml 

I am trying to launch prometheus with docker-compose up and having this docker-compose.yml:

version: "3.1"
volumes:
    prometheus_data: {}
services:
  prometheus:
    image: prom/prometheus
    volumes:
      - ./configs/:/etc/prometheus/
      - prometheus_data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--storage.tsdb.retention=31d'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    ports:
      - 9090:9090

In result I am having this in the console:

Starting daedra_prometheus_1 ...
Starting daedra_prometheus_1 ... done
Attaching to daedra_prometheus_1
prometheus_1  | level=info ts=2018-02-15T07:35:51.5134343Z caller=main.go:225 msg="Starting Prometheus" version="(version=2.1.0, branch=HEAD, revision=85f23d82a045d103ea7f3c89a91fba4a93e6367a)"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5135629Z caller=main.go:226 build_context="(go=go1.9.2, user=root@6e784304d3ff, date=20180119-12:01:23)"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5136834Z caller=main.go:227 host_details="(Linux 4.9.41-moby #1 SMP Fri Aug 18 07:29:56 UTC 2017 x86_64 267bd42f2162 (none))"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5137471Z caller=main.go:228 fd_limits="(soft=1048576, hard=1048576)"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5179573Z caller=web.go:383 component=web msg="Start listening for connections" address=0.0.0.0:9090
prometheus_1  | level=info ts=2018-02-15T07:35:51.5179553Z caller=main.go:499 msg="Starting TSDB ..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.5299105Z caller=main.go:509 msg="TSDB started"
prometheus_1  | level=info ts=2018-02-15T07:35:51.529977Z caller=main.go:585 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml
prometheus_1  | level=info ts=2018-02-15T07:35:51.5301832Z caller=main.go:386 msg="Stopping scrape discovery manager..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.5302324Z caller=main.go:400 msg="Stopping notify discovery manager..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.5302436Z caller=main.go:424 msg="Stopping scrape manager..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.5304438Z caller=manager.go:460 component="rule manager" msg="Stopping rule manager..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.530652Z caller=manager.go:466 component="rule manager" msg="Rule manager stopped"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5306771Z caller=notifier.go:493 component=notifier msg="Stopping notification manager..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.5306926Z caller=main.go:382 msg="Scrape discovery manager stopped"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5322976Z caller=main.go:396 msg="Notify discovery manager stopped"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5326659Z caller=manager.go:59 component="scrape manager" msg="Starting scrape manager..."
prometheus_1  | level=info ts=2018-02-15T07:35:51.5326901Z caller=main.go:418 msg="Scrape manager stopped"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5329105Z caller=main.go:570 msg="Notifier manager stopped"
prometheus_1  | level=error ts=2018-02-15T07:35:51.5330418Z caller=main.go:579 err="Error loading config couldn't load configuration (--config.file=/etc/prometheus/prometheus.yml): open /etc/prometheus/prometheus.yml: no such file or directory"
prometheus_1  | level=info ts=2018-02-15T07:35:51.5330742Z caller=main.go:581 msg="See you next time!"
daedra_prometheus_1 exited with code 0

What do I miss?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Feb 15, 2018

It makes more sense to ask questions like this on the prometheus-users mailing list rather than in a GitHub issue. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.