-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[dns] Allow to specify query Class #635
Conversation
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.
LGTM
var ok bool | ||
qc, ok = dns.StringToClass[module.DNS.QueryClass] | ||
if !ok { | ||
level.Error(logger).Log("msg", "Invalid query class", "Class seen", module.DNS.QueryClass, "Existing classes", dns.ClassToString) |
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.
This should be done in the config so that it can be caught when the config is loaded.
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.
Would that mean the QueryType check L148 (should be also done in the config?
Would you accept a 2nd PR to move both checks outside this file?
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.
Indeed, it should be. It's a small enough change it can all be done here.
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.
done, sorry for the delay.
I added config checks but also kept the existing code in the prober.
Signed-off-by: Baptiste Courtois <[email protected]>
Did you get a chance to make that final change? I'd like to get a release out soon and would like to include this PR. |
This allows to catch simple config errors earlier. Signed-off-by: Baptiste Courtois <[email protected]>
Thanks! |
Context
In some cases we might want to probe other DNS class than the INET one; for instance we could probe the server version often exposed in a
TXT CH version.bind
record.This PR offers the ability to do so by setting
query_class
in your prober configuration, the default is"IN"
as it was before.Implementation note
Most of the code is a copy/paste/replace of the
query_type
setting; except that thesetQuestion
call has been replaced by its "slightly more verbose, but more flexible" alternative.