mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user