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

`target_group` should be called `static_config` in error messages #1801

Closed
cherti opened this Issue Jul 10, 2016 · 10 comments

Comments

Projects
None yet
3 participants
@cherti
Copy link

cherti commented Jul 10, 2016

if you provide:

static_configs:
  - files:
    - /path/to/files*.json

in prometheus.yml (which is wrong, it should be file_sd_configs instead of static_configs) at least promtool complains about:
FAILED: unknown fields in target_group: files

This error is quite misleading and makes it harder to locate the actual problem.

My short digging into the topic revealed that something might be calling checkOverflow with a wrongly labeled context, but I haven't digged too far, I must admit.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 10, 2016

This error is correct, and I'm not sure we can do much about it. Knowing that you meant a different SD mechanism one level up in the config would require quite a bit of sophistication, which I'm not sure is possible.

@cherti

This comment has been minimized.

Copy link
Author

cherti commented Jul 10, 2016

although I think I see how the error comes into place technically, could you line out how you mean "correct" here with regard of promtool complaining about an error in a field that is not specified?

To be more specific: I do not see yet how this is correctly labeled as an unknown field in target_group, as the latter is not specified there.
Maybe a change in formulation could already clarify things.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 10, 2016

static_configs is a list of target_groups, files is not a field of target_group.

@cherti

This comment has been minimized.

Copy link
Author

cherti commented Jul 11, 2016

so the error reads as files not being of type target_group, correct?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 11, 2016

No, that files is not a field of the type target_group.

@cherti

This comment has been minimized.

Copy link
Author

cherti commented Jul 11, 2016

ok, that's what I meant, thanks for clarifying.

For my reading/understanding of the message, the error is wrong then. At least the colon has to go imo, because to me it looks like a separator with files being the unknown field in a target_group somewhere in the config file.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jul 11, 2016

That is what the message means.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 11, 2016

In different news:

target_group is outdated, it should read static_config.
Perhaps that clears a bit of the misunderstanding.

@beorn7 beorn7 changed the title misleading error in at least promtool `target_group` should be called `static_config` in error messages Jul 11, 2016

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 11, 2016

Changed issue title accordingly.

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