mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
plugin/metrics: add panic counter (#1778)
Count and export number of panics we see. Fixes #1294
This commit is contained in:
@@ -208,6 +208,7 @@ func (s *Server) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||
// In case the user doesn't enable error plugin, we still
|
||||
// need to make sure that we stay alive up here
|
||||
if rec := recover(); rec != nil {
|
||||
vars.Panic.Inc()
|
||||
DefaultErrorFunc(ctx, w, r, dns.RcodeServerFailure)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user