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
|
// channel shared between all input threads for accumulating metrics
|
||||||
metricC := make(chan telegraf.Metric, 10000)
|
metricC := make(chan telegraf.Metric, 10000)
|
||||||
webserver := webserver.NewWebserver()
|
webserver := webserver.NewWebserver(a.Config.Agent.WebhookServiceAddress)
|
||||||
webserver.ServiceAddress = a.Config.Agent.WebhookServiceAddress
|
|
||||||
|
|
||||||
for _, input := range a.Config.Inputs {
|
for _, input := range a.Config.Inputs {
|
||||||
// Start service of any ServicePlugins
|
// Start service of any ServicePlugins
|
||||||
|
|
|
@ -13,8 +13,8 @@ type Webserver struct {
|
||||||
router *mux.Router
|
router *mux.Router
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWebserver() *Webserver {
|
func NewWebserver(serviceAddress string) *Webserver {
|
||||||
return &Webserver{router: mux.NewRouter()}
|
return &Webserver{Router: mux.NewRouter(), ServiceAddress: serviceAddress}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wb *Webserver) Router() *mux.Router {
|
func (wb *Webserver) Router() *mux.Router {
|
||||||
|
|
Loading…
Reference in New Issue