Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First I would love to say thank you for this wonderful tool. I use it all the time.
One thing I use it for is to do health checks on our caching resolvers, and something I wanted to do was to monitor how long those queries took. But noticed ElapsedTime is only available in the human readable output.
Please forgive me as the last meaningful Go that I wrote was in 2018, and even then my Go skills were quite limited.
My first instinct was to modify the output string slice before printing as follows
But I didn't feel comfortable editing formatted JSON, because it could conflict with future changes. So I went with the sjson package as follows
After that I ended up dropping the sjson requirement, editing compact JSON directly and then formatting the JSON output.
Also, one thing I wanted to monitor was plain DNS-over-TCP, which my script used dig for since I didn't know it was supported by dnslookup. But when when I saw https://pkg.go.dev/github.com/AdguardTeam/dnsproxy/upstream#AddressToUpstream I realized it was possible and after testing it does indeed work. So I thought it would be a good idea to expose it in the README