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>
This commit is contained in:
yeya24
2019-09-19 11:38:15 -04:00
committed by Miek Gieben
parent 62317c3c14
commit 85e65702bd
4 changed files with 35 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/caddyserver/caddy"
@@ -57,6 +58,12 @@ func setup(c *caddy.Controller) error {
return nil
})
c.OnStartup(func() error {
metrics.MustRegister(c, hostsEntries)
metrics.MustRegister(c, hostsReloadTime)
return nil
})
c.OnShutdown(func() error {
close(parseChan)
return nil