Commit graph

7 commits

Author SHA1 Message Date
Chris O'Haver
b1a69f70bd
dont return 200 during shutdown (#4167)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-10-01 16:13:23 +02:00
Miek Gieben
5f159ca464 gofmt -w -s **/*.go (#3603)
format and remove trailing white space; makes 'make presubmit' pass
again.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-01-17 10:47:45 -05:00
Zou Nengren
768ca99c57 Fix reloading in health and ready (#3473)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
2019-11-20 12:14:37 +00:00
yeya24
85e65702bd add host metrics (#3277)
* add host metrics

Signed-off-by: yeya24 <yb532204897@gmail.com>

* update hosts readme docs

Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-09-19 16:38:15 +01:00
xieyanker
9fe7fb95c6 return standardized text for ready and health endpoint (#3195) 2019-08-26 10:31:24 +00:00
Miek Gieben
a1c97f82a6
plugin/ready: fix starts and restarts (#2814)
Add OnRestartFailed to the ready plugin and some various cleanups.

Document slightly better how things are supposed to work with multiple
`ready`'s in the multiple Server Blocks.

All manually tested with this Corefile:
~~~
. {
    log
    ready
}

example.org {
    log
    chaos
    ready
}
~~~
And then `kill -SIGUSR1` and curling the ready endpoint. This works
well, the FailedReload is triggered by adding a syntax error in the
Corefile.

See #2659

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-09 08:10:15 +01:00
Miek Gieben
db0b16b615
Add *ready* plugin (#2616)
Add a ready plugin that allows plugin to signal when they are ready.
Once a plugin is ready it is not queried again.

This uses same mechanism as the health plugin: each plugin needs to
implement an interface.

Implement readines for the *erratic* plugin to aid in testing.

Add README.md and tests moduled after the health plugin; which will be
relegated to just providing process health. In similar vein to health
this is a process wide setting.

With this Corefile:
~~~
. {
    erratic
    whoami
    ready
}

bla {
    erratic
    whoami
}
~~~

ready will lead to:

~~~ sh
% curl localhost:8181/ready
% dig @localhost -p 1053 mx example.org
% curl localhost:8181/ready
OK%
~~~

Meanwhile CoreDNS logs:

~~~
.:1053
bla.:1053
2019-02-26T20:59:07.137Z [INFO] CoreDNS-1.3.1
2019-02-26T20:59:07.137Z [INFO] linux/amd64, go1.11.4,
CoreDNS-1.3.1
linux/amd64, go1.11.4,
2019-02-26T20:59:11.415Z [INFO] plugin/ready: Still waiting on: "erratic"
2019-02-26T20:59:13.510Z [INFO] plugin/ready: Still waiting on: "erratic"
~~~

*ready* can be used in multiple server blocks and will do the right
thing; query all those plugins from all server blocks for readiness.
This does a similar thing to the prometheus plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-07 20:35:16 +00:00