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

file_sd_config difficult to setup/debug #2246

Closed
msiebuhr opened this Issue Dec 3, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@msiebuhr
Copy link
Contributor

msiebuhr commented Dec 3, 2016

What did you do?
Set up file_sd_config.

What did you expect to see?
Being able to add the snipplets from the documentation (https://prometheus.io/docs/operating/configuration/#<file_sd_config>), have it resolve the file and and import service definitions.

What did you see instead? Under which circumstances?
Adding the code from the docs makes Prometheus refuse to start up:

files:
  - "./mdns-sd.json"

After digging in the test-suite, finding a file that contains all possible configuration, I found the not-at-all-similar incantation:

scrape_configs:
  - job_name: 'mdns-sd'
    file_sd_configs:
      - files:
        - "./mdns-sd.json"

Makes it actually start up.

Environment

  • System information:

    FreeBSD 10.3-STABLE amd64

(FreeNAS inside a Jail)

  • Prometheus version:

    build user:
    build date:
    go version:       go1.7.3
    
  • Prometheus configuration file:
    See above

  • Logs:
    INFO[0000] Starting prometheus (version=, branch=, revision=) source=main.go:75
    INFO[0000] Build context (go=go1.7.3, user=, date=) source=main.go:76
    INFO[0000] Loading configuration file /usr/local/etc/prometheus.yml source=main.go:247
    ERRO[0000] Error loading config: couldn't load configuration (-config.file=/usr/local/etc/prometheus.yml): unknown fields in config: files source=main.go:149

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Dec 5, 2016

Mh, the configuration is reference style to accomodate the listing and nesting of different configuration blocks. It looks correct for file SD as far as I can see.

We cannot really repeat a full configuration in every SD config definition.

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Mar 5, 2017

Issues around the documentation should be opened against https://github.com/prometheus/docs.

@grobie grobie closed this Mar 5, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 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 23, 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.