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

Forbid invalid relabel configurations #1900

Closed
grobie opened this Issue Aug 18, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@grobie
Copy link
Member

grobie commented Aug 18, 2016

This produces an empty label name

# config
relabel_configs:
- source_labels: [__address__]

# result
node_boot_time{="localhost:9100",instance="localhost:9100",job="node"}

I guess a configuration with either just source_labels or just target_label or any other config not having the minimum set of attributes set should be rejected.

@hashmap

This comment has been minimized.

Copy link
Contributor

hashmap commented Aug 29, 2016

@grobie I'm not an expert in relabeling, all my knowledge comes from @brian-brazil PromCon talk. I've implemented a draft of this fix based on https://prometheus.io/docs/operating/configuration/#<relabel_config>:

  • source_labels must be defined
  • target_label must be defined if action is replace or hashmod

However I found some counterexamples in conf.good.yml which is good by definition, right?

Am I missing something?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Aug 29, 2016

It is valid to not have source labels.

@hashmap

This comment has been minimized.

Copy link
Contributor

hashmap commented Aug 29, 2016

@brian-brazil in any case or in some particular? In https://prometheus.io/docs/operating/configuration/#<relabel_config> only labelmap looks unclear to me, the rest should require source labels

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Aug 29, 2016

Replace doesn't require source_labels either.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Aug 29, 2016

Omitting the source labels allows you to attach new labels. That's not
useful for target relabellings but can be elsewhere in general.

On Mon, Aug 29, 2016, 3:12 PM Alexey Miroshkin notifications@github.com
wrote:

@brian-brazil https://github.com/brian-brazil in any case or in some
particular? In https://prometheus.io/docs/operating/configuration/# only
labelmap looks unclear to me, the rest should require source labels


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1900 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEuA8mi1eQc1AxUPsxlxsBPtGpgAI9heks5qktrDgaJpZM4JnFRn
.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Aug 29, 2016

That's useful for target relabelling, as you might want to add something static that's not from SD.

@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.