diff options
author | 2016-04-06 09:21:46 +0100 | |
---|---|---|
committer | 2016-04-06 09:21:46 +0100 | |
commit | 68171c7a638a4087deac495b39ca7f539ed93673 (patch) | |
tree | 8844c95249964d57122d1fc779882515d6f4f5f8 /middleware/prometheus/metrics.go | |
parent | ecb53addd6f76206e6070e2312d6a48435c450e7 (diff) | |
download | coredns-68171c7a638a4087deac495b39ca7f539ed93673.tar.gz coredns-68171c7a638a4087deac495b39ca7f539ed93673.tar.zst coredns-68171c7a638a4087deac495b39ca7f539ed93673.zip |
A health middleware
Start http handler on port 8080 and return OK. Also add some
documentation fixes for the prometheus middleware.
Diffstat (limited to 'middleware/prometheus/metrics.go')
-rw-r--r-- | middleware/prometheus/metrics.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/middleware/prometheus/metrics.go b/middleware/prometheus/metrics.go index 00db6e791..b47d06ff8 100644 --- a/middleware/prometheus/metrics.go +++ b/middleware/prometheus/metrics.go @@ -1,7 +1,7 @@ package metrics import ( - "fmt" + "log" "net/http" "sync" @@ -39,8 +39,9 @@ func (m *Metrics) Start() error { http.Handle(path, prometheus.Handler()) go func() { - // TODO(miek): Logging here? - fmt.Errorf("%s", http.ListenAndServe(m.Addr, nil)) + if err := http.ListenAndServe(m.Addr, nil); err != nil { + log.Printf("[ERROR] Failed to start prometheus handler: %s", err) + } }() }) return nil |