-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add configcheck command #1139
Add configcheck command #1139
Conversation
c057f81
to
0173350
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff 💯 LGTM overall, just one issue: I tried adding a check config file with invalid yaml and it didn't show in the configcheck command output. We can see it in the logs of course, but it would be nice if configcheck
could outline the unmarshalling error. Here's the log output:
2018-02-04 12:42:22 UTC | INFO | (file.go:68 in Collect) | File Configuration Provider: searching for configuration files at: /etc/datadog-agent/conf.d
2018-02-04 12:42:22 UTC | WARN | (file.go:180 in collectEntry) | /etc/datadog-agent/conf.d/nginx.d/conf.yaml is not a valid config file: yaml: unmarshal errors:
line 4: cannot unmarshal !!str `:foo:ba...` into []check.ConfigRawMap
@hkaj I believe this is related to the bug report I submitted recently. The same issue occurs in the most recent releases too, in the check command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need it now, let's merge as is and handle yaml errors in a follow-up PR.
and thanks for the eyes @tmcarr, we'll fix it asap. Making troubleshooting easier is a high priority. |
What does this PR do?
Add a
configcheck
command that helps investigating the current loaded/resolved configs for each config provider:Additionnally with a
-v
option it can output debug info such as the warnings during resolve and the templates yet to be resolved:The output of this commande (in debug mode) is added to the flare to a
config-check.log
fileMotivation
The autodiscovery is a piece of the agent where a lot of components could go wrong (template, ad identifiers, discovery...) and that's why we need a tool to give an idea of the current state of a running agent for development & debugging purposes