Initialize webserver with the listening address.
This commit is contained in:
parent
1b71e60d14
commit
580dc733ee
|
@ -327,8 +327,7 @@ func (a *Agent) Run(shutdown chan struct{}) error {
|
|||
|
||||
// channel shared between all input threads for accumulating metrics
|
||||
metricC := make(chan telegraf.Metric, 10000)
|
||||
webserver := webserver.NewWebserver()
|
||||
webserver.ServiceAddress = a.Config.Agent.WebhookServiceAddress
|
||||
webserver := webserver.NewWebserver(a.Config.Agent.WebhookServiceAddress)
|
||||
|
||||
for _, input := range a.Config.Inputs {
|
||||
// Start service of any ServicePlugins
|
||||
|
|
|
@ -13,8 +13,8 @@ type Webserver struct {
|
|||
router *mux.Router
|
||||
}
|
||||
|
||||
func NewWebserver() *Webserver {
|
||||
return &Webserver{router: mux.NewRouter()}
|
||||
func NewWebserver(serviceAddress string) *Webserver {
|
||||
return &Webserver{Router: mux.NewRouter(), ServiceAddress: serviceAddress}
|
||||
}
|
||||
|
||||
func (wb *Webserver) Router() *mux.Router {
|
||||
|
|
Loading…
Reference in New Issue