mw/health: poll other middleware (#976)

This add the infrastructure to let other middleware report their health
status back to the health middleware. A health.Healther interface is
introduced and a middleware needs to implement that. A middleware
that supports healthchecks is statically configured.

Every second each supported middleware is queried and the global health
state is updated.

Actual tests have been disabled as no other middleware implements this
at the moment.
This commit is contained in:
Miek Gieben
2017-08-27 21:33:38 +01:00
committed by Yong Tang
parent 9c56805d38
commit 558f4bea41
7 changed files with 149 additions and 22 deletions

View File

@@ -40,7 +40,8 @@ See a couple of blog posts on how to write and add middleware to CoreDNS:
When exporting metrics the *Namespace* should be `middleware.Namespace` (="coredns"), and the
*Subsystem* should be the name of the middleware. The README.md for the middleware should then
also contain a *Metrics* section detailing the metrics.
also contain a *Metrics* section detailing the metrics. If the middleware supports dynamic health
reporting it should also have *Health* section detailing on its inner workings.
## Documentation