* Fully deprecate NO_RELOAD
Signed-off-by: Xiao An <hac@zju.edu.cn>
* Fully deprecate TIMEOUT
Signed-off-by: Xiao An <hac@zju.edu.cn>
* Update CI tests to adapt to the deprecation of TIMEOUT
Signed-off-by: Xiao An <hac@zju.edu.cn>
* Add documents for directive transfer in plugin auto
Signed-off-by: Xiao An <hac@zju.edu.cn>
* Add a GaugeVec for enabled plugins monitoring.
Signed-off-by: Jiacheng Xu <xjcmaxwellcjx@gmail.com>
* Add server label and zone label for enable_plugin matric.
* Add a test for PluginEnabled metric
* Add description for enabledPlugin metric.
* Change the description for the enabledPlugin metric.
* Reset the enabledPlugin metric when restart the server.
* Add the bug session for enabledPlugin metric.
* Remove the resolveTCPAddr
* Move *proxy* to external
move the proxy plugin into coredns/proxy and remove it as a default
plugin. Link the proxy to deprecated in plugin.cfg
coredns/proxy doesn't compile because of the vendoring :(
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add github.com/coredns/proxy
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Stop importing testing in the main binary
Stop importing "testing" into the main binary:
* test/helpers.go imported it; remote that and change function signature
* update all tests that use this
Signed-off-by: Miek Gieben <miek@miek.nl>
* Drop import testing from metrics plugin
Signed-off-by: Miek Gieben <miek@miek.nl>
* more fiddling
Signed-off-by: Miek Gieben <miek@miek.nl>
* - UT on metrics verifying that all plugins of all blocs have their metrics collectors declared
* - fix error msg
* - redirect Registry of metric to the one that handle the listener
- allow duplicate of metrics collector on the same Registry (case of same plugin in 2 blocs listening metrics on the same address)
* - fix change of signature
* - ensure cleaning metrics before starting the test (metrics collectors are global vars .. and re-used by several tests)
* - I think I fixed this test. Ensure correct mn of hits and clean metrics before test.
* - fix typo in error msg - proposed at review
* - fix typo in comment
* - remove ResetMetrics functions
- change a way to test the numeric metrics : get the diff between begin and end of test
* - oops. removing debug logs
* 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>
* 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
* tests: CoreDNSServerAndPorts
Copy from kubernetes.go and renamed to fit the style, adapted almost
all callers.
This is a mechanicl change, no testdata was changed.
* typos
Create a small speedup running the tests:
PASS
ok github.com/miekg/coredns/test 10.329s
PASS
ok github.com/miekg/coredns/test 6.079s
Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield
any speedup as these are still done on a per directory basis.
Disable this test (for now), it fails weirdly on travis
(and not locally). Initial suspicion that another server
is still reporting (or something). Anyway hard to replicate
locally - disable it for now.
ListenAddr is the address where the prometheus metric are exported.
This can be used in tests to listen on "localhost:0" and then later
retrieve the metrics from there. It makes the tests indepent on each
other.
* middleware/metrics: add more metrics
middleware/cache:
Add metrics for number of elements in the cache. Also export the total
size. Update README to detail the new metrics.
middleware/metrics
Move metrics into subpackage called "vars". This breaks the import
cycle and is cleaner. This allows vars.Report to be used in the
the dnsserver to log refused queries.
middleware/metrics: tests
Add tests to the metrics framework. The metrics/test subpackage allows
scraping of the local server. Do a few test scrape of the metrics that
are defined in the metrics middleware.
This also allows metrics integration tests to check if the caching and
dnssec middleware export their metrics correctly.
* update README
* typos
* fix tests
Make the methods that handle Metrics all use pointer receivers to fix
sync.Once not being initialized.
Finish the setup_test to test for failures. And make the check for the
address more strict and return an error when it does not have a port
number.
Add a toplevel test that starts a CoreDNS server with metrics enabled
so we catch these errors in the future.