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 won't read file_sd_config #909

Closed
swsnider opened this Issue Jul 20, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@swsnider
Copy link
Contributor

swsnider commented Jul 20, 2015

When I try to load a file_sd_config file, I get no error, but prometheus doesn't show any of those hosts on the status page as candidate for scraping, no matter how long I wait. Nothing is logged, even with -log.level=debug, and promtool doesn't check that file.

included file:

targets:
  - host1.example.com:9103
  - host2.example.com:9103
  - host3.example.com:9103
  - host4.example.com:9103
  - host5.example.com:9103
labels:
  - job: zookeeper

I'm using this prometheus:

prometheus, version 0.15.0rc3 (branch: master, revision: d437fce)
  build user:       swsnider@Silass-Mac-mini.local
  build date:       20150720-16:25:16
  go version:       1.4.2

The actual prometheus.yaml is here:

global:
  scrape_interval:     15s
  evaluation_interval: 15s

  labels:
      cluster: dev
      replica: "1"

scrape_configs:
  - job_name: 'prometheus'
    target_groups:
      - targets: ['localhost:9090']

  - file_sd_configs:
    - names:
      - /Users/swsnider/hierasd.yml
    job_name: file_sd
@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 21, 2015

If I start up Prometheus with your setup, I do get an error message:

ERRO[0099] Error reading file "sd.yml": yaml: unmarshal errors:
  line 1: cannot unmarshal !!map into []*config.TargetGroup  file=file.go line=172

You need to reformat /Users/swsnider/hierasd.yml to

- targets:
  - host1.example.com:9103
  - host2.example.com:9103
  - host3.example.com:9103
  - host4.example.com:9103
  - host5.example.com:9103
  labels:
    job: zookeeper

@beorn7 beorn7 closed this Jul 21, 2015

@kaihendry

This comment has been minimized.

Copy link

kaihendry commented Apr 13, 2016

I don't see errors upon my prometheus, version 0.17.0 (branch: stable, revision: 6e8d4e9). How do I check for an error?

I'm losing my mind why for example:

http://s.natalian.org/2016-04-13/prometheus.yml
http://s.natalian.org/2016-04-13/targets.yml

Is not working.

@kaihendry

This comment has been minimized.

Copy link

kaihendry commented Apr 13, 2016

Ok, the real issue is that targets.yml wasn't getting picked up & no error message was being shown. It needed to be a absolute URL in my case. I'll file a new bug #1553

@lock

This comment has been minimized.

Copy link

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