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 config rendered from struct no longer parses #2899

Closed
tcolgate opened this Issue Jul 4, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@tcolgate
Copy link
Contributor

tcolgate commented Jul 4, 2017

5c89cec breaks configs rendered from the internal config struct (yeah, I know it's nasty, but we build prom configs automatically and we vendor prom to support it).

The above change beaks because the config renders as

...
relabel_rules:
  - action: labeldrop
    source_labels: []
...

either source_labels should include "omitempty", or the above sourcelabel check should be updated to something which parses with nil vs empty slice (e.g. len())

What did you do?

Attempted to run prometheus master with a configuration from our config management tool.

What did you expect to see?

Prometheus accept the configuration and start.

What did you see instead? Under which circumstances?

prometheus fails with ```time="2017-07-04T12:10:18Z" level=error msg="Error loading config: couldn't load configuration (-config.file=/etc/prometheus/config.yaml): labeldrop action requires only 'regex', and no other fields" source="main.go:160"


**Environment**

Linux 

* System information:

	Linux 4.7.0-0.bpo.1-amd64 x86_64

* Prometheus version: 

	image from quay.io master


gouthamve pushed a commit to gouthamve/prometheus that referenced this issue Jul 5, 2017

Goutham Veeramachaneni
Make sure rendering config produces valid config
Fixes prometheus#2899

Signed-off-by: Goutham Veeramachaneni <goutham@boomerangcommerce.com>

@fabxc fabxc closed this in #2904 Jul 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.