middleware/cache: Add metrics (#132)
Add prometheus metrics to the cache handler. This just used prometheus, if the metrics middleware does not setup the handler, there is nobody reading these metrics, but they are still reported. Seems the simplest solution while keeping the whole middleware separation in tact.
This commit is contained in:
parent
e5e0cde08f
commit
a412255ad1
3 changed files with 41 additions and 11 deletions
|
@ -54,6 +54,8 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
|
|||
return f(ctx, w, r)
|
||||
}
|
||||
|
||||
const Namespace = "coredns"
|
||||
|
||||
// IndexFile looks for a file in /root/fpath/indexFile for each string
|
||||
// in indexFiles. If an index file is found, it returns the root-relative
|
||||
// path to the file and true. If no index file is found, empty string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue