aboutsummaryrefslogtreecommitdiff
path: root/plugin/dnstap (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-09-19Better naming (#2104)Gravatar Miek Gieben 1-2/+2
* Move functions from pkg/transport to pkg/parse Although "parse" is a fairly generic name I believe this is somewhat better named. pkg/transport keeps a few constants that are uses throughout for the rest is is renaming a bunch (and the fallout from there to make things compile again). Signed-off-by: Miek Gieben <miek@miek.nl> * Fix tests Signed-off-by: Miek Gieben <miek@miek.nl>
2018-08-01dnstap.TapperFromContext always returns nil (#2018)Gravatar varyoo 2-1/+16
Automatically submitted.
2018-07-19Clean up tests logging (#1979)Gravatar Miek Gieben 2-0/+10
* Clean up tests logging This cleans up the travis logs so you can see the failures better. Older tests in tests/ would call log.SetOutput(ioutil.Discard) in a haphazard way. This add log.Discard and put an `init` function in each package's dir (no way to do this globally). The cleanup in tests/ is clear. All plugins also got this init function to have some uniformity and kill any (future) logging there in the tests as well. There is a one-off in pkg/healthcheck because that does log. Signed-off-by: Miek Gieben <miek@miek.nl> * bring back original log_test.go Signed-off-by: Miek Gieben <miek@miek.nl> * suppress logging here as well Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-06Docs (#1943)Gravatar Miek Gieben 1-1/+1
* Doc updates Make the name section fit on one line. Signed-off-by: Miek Gieben <miek@miek.nl> * Regen docs Signed-off-by: Miek Gieben <miek@miek.nl>
2018-06-02presubmit: Check errorf as well (#1845)Gravatar Miek Gieben 2-2/+2
Uppercase all these test errors as well. And extend the presubmit to check for these in the future. Also do a slightly smarter grep to only get t.<something>. as (because dump regexp) this also grep over non test files.
2018-05-07presubmit: check for uppercase (#1774)Gravatar Miek Gieben 5-10/+10
Another thing we can test automatically, we sorta settled on using an uppercase letter in in t.Log and t.Fatal calls. Let's just check for this.
2018-04-22Use logging (#1718)Gravatar Miek Gieben 2-1/+6
* update docs * plugins: use plugin specific logging Hooking up pkg/log also changed NewWithPlugin to just take a string instead of a plugin.Handler as that is more flexible and for instance the Root "plugin" doesn't implement it fully. Same logging from the reload plugin: .:1043 2018/04/22 08:56:37 [INFO] CoreDNS-1.1.1 2018/04/22 08:56:37 [INFO] linux/amd64, go1.10.1, CoreDNS-1.1.1 linux/amd64, go1.10.1, 2018/04/22 08:56:37 [INFO] plugin/reload: Running configuration MD5 = ec4c9c55cd19759ea1c46b8c45742b06 2018/04/22 08:56:54 [INFO] Reloading 2018/04/22 08:56:54 [INFO] plugin/reload: Running configuration MD5 = 9e2bfdd85bdc9cceb740ba9c80f34c1a 2018/04/22 08:56:54 [INFO] Reloading complete * update docs * better doc
2018-04-22all: fix plugin import ordering (#1717)Gravatar Miek Gieben 3-7/+3
Got a bit messed up with stb lib "context" usage.
2018-04-20global: move to context (#1699)Gravatar Miek Gieben 3-3/+6
* global: move to context Move from golang.org/x/net/context to std lib's context. Change done with: for i in $(grep -l '/context' **/*.go); do sed -e 's|golang.org/x/net/context|context|' -i $i; echo $i; done for i in **/*.go; do goimports -w $i; done * drop from dns.pb.go as well
2018-04-19Update all plugins to use plugin/pkg/log (#1694)Gravatar Miek Gieben 1-7/+8
* Update all plugins to use plugin/pkg/log I wish this could have been done with sed. Alas manually changed all callers to use the new plugin/pkg/log package. * Error -> Info * Add docs to debug plugin as well
2018-03-09logging: Don't use PrintF when not needed (#1599)Gravatar Miek Gieben 1-3/+3
These log print don't have any verbs, so just use plain Print
2018-03-02Added nanoseconds to dnstap plugin builder (#1583)Gravatar Uladzimir Trehubenka 1-14/+20
2018-02-28Easier way to dnstap? (#1496)Gravatar varyoo 10-237/+254
* Easier way to dnstap? * Remove unnecessary function parameter from Tapper * golint * golint 2 * Proxy dnstap tests * README.md & doc * net.IP * Proxy test was incorrect * Small changes * Update README.md * Was not reporting dnstap errors + test * Wasn't working at all, now it's ok * Thanks Travis
2018-02-14Enable goimports check, and fixes several imports format (#1525)Gravatar Yong Tang 1-1/+2
This fix enables goimports check and fixes several imports format so that the import sections are prettier, e.g.: ``` import ( - "github.com/miekg/dns" "regexp" "strconv" "strings" + + "github.com/miekg/dns" ) ``` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08Add OWNERS file (#1486)Gravatar Miek Gieben 1-0/+6
This should have everyone, but the process was quite manual. The rename from middleware -> plugin also meant I had to do some extra digging on who actually submitted the PR. I also double checked the current list of people with commit access. Every plugin now has an OWNERS, except *reverse*. I'll file a bug for that.
2018-02-02Fixed dnstap panic after graceful restart (send on closed channel) (#1479)Gravatar Uladzimir Trehubenka 1-7/+8
2018-01-30Golint fix (#1475)Gravatar Yong Tang 1-4/+1
Golint fix to make goreportcard happy Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-10Doc (#1369)Gravatar Miek Gieben 1-1/+1
* Constent atx headers * Regen manual pages
2018-01-04Manual pages (#1346)Gravatar Miek Gieben 1-9/+17
* Add manual pages Generate manual pages from the README and extend README with Name and Description sections. The generation requires 'ronn' which may not be available. Just check in all generated manual pages.
2017-12-06Increase performance of Dnstap plugin (#1280)Gravatar Ruslan Drozhdzh 3-42/+196
- added dnstapEncoder object which incapsulates marshalling of dnstap messages to protobuf and writing data to connection - dnstapEncoder writes data directly to connection object. It doesn't use the framestream's "write" method, because it writes data to intermediate buffer (bufio.Writer) which leads to unnecessary data copying and drops the performance - dnstapEncoder reuses a preallocated buffer for marshalling dnstap messages. Many messages are added to the same buffer. They are separated with a "frame length" 4-byte values, so the buffer content is writen to connection object in the format compatible with framestream library - added test which guarantees that dnstapEncoder output is the same as framestream Encoder output - the performance increase is about 50% in (dio *dnstapIO) serve() method of dnstap plugin. The overall coredns performance increase is about 10% in the following configuration: .:1053 { erratic { drop 0 truncate 0 delay 0 } dnstap tcp://127.0.0.1:6000 full errors stdout } tested with dnsperf tool
2017-12-01Added reconnect feature for dnstap plugin (#1267)Gravatar Uladzimir Trehubenka 3-94/+133
2017-11-27Dnstap plugin refactoring (#1257)Gravatar Uladzimir Trehubenka 7-408/+215
2017-10-25plugin/dnstap: some cleanup (#1172)Gravatar Miek Gieben 3-16/+6
Some cleanup in proxy and dnstap: * just use time pkg directly and side step the indirection for Epoch * Use Set in SetQueryEpoch to be more Go like. (Looked like a reader) * Don't maintain two sets of time, we already track start, so use that. * Use time.Time and convert when needed * dedent the toDnstap function and put in a separate file
2017-10-10doc update (#1140)Gravatar Miek Gieben 1-7/+7
* doc update Go through all README and fix mistakes, extend example and let more corefile snippets be test for validity. * Cant use spefic addr in test
2017-09-29Enable dnstap plugin to insert other plugin's specific data into extra field ↵Gravatar Thong Huynh 3-18/+99
of tap.Dnstap message (#1101) * Add custom data into dnstap context * Fix error and fix UT compile errors * Add UTs * Change as per review comments. Use boolean to indicate which Dnstap message to send out * Merge with master and fix lint warning * Remove newline * Fix review comments
2017-09-29plugin/dnstap: don't spam Travis + valid dnstap payload (#1121)Gravatar varyoo 2-11/+17
* don't spam Travis + valid dnstap payload * log instead of fmt * Revert "log instead of fmt" This reverts commit 88f09c39390e97c8f3a1f070aefee66fdf87ae48. * log the right way * log the final way * minor enhancements
2017-09-26Adds the dnstap I/O routines and should fix some issues (#1083)Gravatar varyoo 7-22/+164
* adds the dnstap I/O thread and should fix a lot of mistakes * docs * -race test * oops * docs
2017-09-22go lint/vet/misspell cleanup (#1105)Gravatar Yong Tang 2-9/+3
This fix address several issues related to golint/vet/misspell. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 15-0/+1113
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat