Skip to content

Commit

Permalink
Use TLS with the monitoring / profiling routes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergystepanov committed Jul 5, 2023
1 parent cc41488 commit 8fef57a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func New(conf config.CoordinatorConfig, log *logger.Logger) (services service.Gr
}
services.Add(hub, h)
if conf.Coordinator.Monitoring.IsEnabled() {
services.Add(monitoring.New(conf.Coordinator.Monitoring, h.GetHost(), log))
services.Add(monitoring.New(conf.Coordinator.Monitoring, conf.Coordinator.Server, h.GetHost(), log))
}
return
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Monitoring struct {

// New creates new monitoring service.
// The tag param specifies owner label for logs.
func New(conf config.Monitoring, baseAddr string, log *logger.Logger) *Monitoring {
func New(conf config.Monitoring, servConf config.Server, baseAddr string, log *logger.Logger) *Monitoring {
serv, err := httpx.NewServer(
net.JoinHostPort(baseAddr, strconv.Itoa(conf.Port)),
func(s *httpx.Server) httpx.Handler {
Expand Down Expand Up @@ -52,6 +52,7 @@ func New(conf config.Monitoring, baseAddr string, log *logger.Logger) *Monitorin
return h
},
httpx.WithPortRoll(true),
httpx.WithServerConfig(servConf),
httpx.WithLogger(log),
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func New(conf config.WorkerConfig, log *logger.Logger, done chan struct{}) (serv
}
services.Add(h)
if conf.Worker.Monitoring.IsEnabled() {
services.Add(monitoring.New(conf.Worker.Monitoring, h.GetHost(), log))
services.Add(monitoring.New(conf.Worker.Monitoring, conf.Worker.Server, h.GetHost(), log))
}
st, err := GetCloudStorage(conf.Storage.Provider, conf.Storage.Key)
if err != nil {
Expand Down

0 comments on commit 8fef57a

Please sign in to comment.