File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ import (
1212func StartHealthServer (port int ) chan error {
1313 errCh := make (chan error )
1414 go func () {
15- http .HandleFunc ("/healthz" , HealthProbe )
16- errCh <- http .ListenAndServe (fmt .Sprintf (":%d" , port ), nil )
15+ sm := http .NewServeMux ()
16+ sm .HandleFunc ("/healthz" , HealthProbe )
17+ errCh <- http .ListenAndServe (fmt .Sprintf (":%d" , port ), sm )
1718 }()
1819 return errCh
1920}
Original file line number Diff line number Diff line change @@ -40,8 +40,9 @@ type ClientMetrics struct {
4040func StartMetricsServer (port int ) chan error {
4141 errCh := make (chan error )
4242 go func () {
43- http .Handle ("/metrics" , promhttp .Handler ())
44- errCh <- http .ListenAndServe (fmt .Sprintf (":%d" , port ), nil )
43+ sm := http .NewServeMux ()
44+ sm .Handle ("/metrics" , promhttp .Handler ())
45+ errCh <- http .ListenAndServe (fmt .Sprintf (":%d" , port ), sm )
4546 }()
4647 return errCh
4748}
You can’t perform that action at this time.
0 commit comments