mirror of
https://github.com/coredns/coredns.git
synced 2025-12-06 18:35:11 -05:00
pprof middleware (#138)
Add pprof middleware, enabled by pprof directive.
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
const addr = "localhost:9135" // 9153 is occupied by bind_exporter
|
||||
|
||||
var once sync.Once
|
||||
var metricsOnce sync.Once
|
||||
|
||||
func Prometheus(c *Controller) (middleware.Middleware, error) {
|
||||
met, err := parsePrometheus(c)
|
||||
@@ -17,7 +17,7 @@ func Prometheus(c *Controller) (middleware.Middleware, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
once.Do(func() {
|
||||
metricsOnce.Do(func() {
|
||||
c.Startup = append(c.Startup, met.Start)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user