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 <[email protected]>
  • Loading branch information
gyuho committed Jul 23, 2017
1 parent e13de13 commit 53ee292
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 @@ -405,12 +405,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 53ee292

Please sign in to comment.