Skip to content

Commit

Permalink
embed: serve health, serve insecure with metrics handler
Browse files Browse the repository at this point in the history
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Jul 19, 2017
1 parent 2916094 commit f1def71
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions embed/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,16 @@ func (e *Etcd) serve() (err error) {
}

if len(e.cfg.ListenMetricsUrls) > 0 {
// TODO: maybe etcdhttp.MetricsPath or get the path from the user-provided URL
// serve health, metrics information together
metricsMux := http.NewServeMux()
metrics.RegisterPrometheus(metricsMux)
metricsMux.Handle(metrics.PathMetrics, metrics.Handler(e.Server))

for _, murl := range e.cfg.ListenMetricsUrls {
ml, err := transport.NewListener(murl.Host, murl.Scheme, &e.cfg.ClientTLSInfo)
tlsInfo := &e.cfg.ClientTLSInfo
if murl.Scheme == "http" {
tlsInfo = nil
}
ml, err := transport.NewListener(murl.Host, murl.Scheme, tlsInfo)
if err != nil {
return err
}
Expand Down

0 comments on commit f1def71

Please sign in to comment.