-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 PowerDNS Recursor input plugin #4545
Conversation
f2f2344
to
56a8244
Compare
|
||
func (p *PowerdnsRecursor) gatherServer(address string, acc telegraf.Accumulator) error { | ||
var randomNumber int64 | ||
binary.Read(rand.Reader, binary.LittleEndian, &randomNumber) |
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.
Overkill and non-performant, consider other options. (atomic counter, etc...)
func TestPowerdnsRecursorGeneratesMetrics(t *testing.T) { | ||
// We create a fake server to return test data | ||
var randomNumber int64 | ||
binary.Read(rand.Reader, binary.LittleEndian, &randomNumber) |
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.
Again, very overkill for a test, just set randomNumber
to a number.
56a8244
to
74348d8
Compare
Adjusted the requested changes. That random came from the powerdns input plugin by the way: So might want to change it there also :) |
And if merged, #812 can be closed! |
74348d8
to
82312de
Compare
@dupondje Can you investigate what might be taking so long in the tests? They are failing circleci, I thought it was due to the |
82312de
to
409dde7
Compare
Test was fixed! :) It was caused by the fact that with Unixgram sockets, you need to write the message to the remote socket, and not to the socket the message was read from. |
@danielnelson: Any changes required to get it merged? |
What are we waiting for? :) Would like to get it merged. |
Any update for this? Would be nice to get it merged! |
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.
Sorry about the delay and thanks for being patient. Looks good but there are a few things still to resolve:
34a5e03
to
c2027cb
Compare
Can you update your branch with master please? |
5e9b8df
to
61fa896
Compare
Updated :) |
@dupondje I think we just need the tests fixed and we should be good to merge. |
Should be good now! |
Added a PowerDNS Recursor input plugin.
The PowerDNS plugin does not work for the recursor, as it as some differences.
Not only the command to get the stats is different, but also the socket type (datagram socket for the recursor).
As I also had to add some additional options, it looks better to me to have it in a separate plugin.
Please review the code if it can be merged. If things need to get changed, let me know!
I also get a strange error on make test ... so might need some assistance there!