moby/cmd/dockerd/metrics.go
Derek McGowan 1009e6a40b
Update logrus to v1.0.1
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-31 13:16:46 -07:00

27 lines
493 B
Go

package main
import (
"net"
"net/http"
metrics "github.com/docker/go-metrics"
"github.com/sirupsen/logrus"
)
func startMetricsServer(addr string) error {
if err := allocateDaemonPort(addr); err != nil {
return err
}
l, err := net.Listen("tcp", addr)
if err != nil {
return err
}
mux := http.NewServeMux()
mux.Handle("/metrics", metrics.Handler())
go func() {
if err := http.Serve(l, mux); err != nil {
logrus.Errorf("serve metrics api: %s", err)
}
}()
return nil
}