|
|
@ -76,9 +76,9 @@ import (
|
|
|
|
"github.com/prometheus/prometheus/tsdb/wlog"
|
|
|
|
"github.com/prometheus/prometheus/tsdb/wlog"
|
|
|
|
"github.com/prometheus/prometheus/util/documentcli"
|
|
|
|
"github.com/prometheus/prometheus/util/documentcli"
|
|
|
|
"github.com/prometheus/prometheus/util/logging"
|
|
|
|
"github.com/prometheus/prometheus/util/logging"
|
|
|
|
|
|
|
|
"github.com/prometheus/prometheus/util/notifications"
|
|
|
|
prom_runtime "github.com/prometheus/prometheus/util/runtime"
|
|
|
|
prom_runtime "github.com/prometheus/prometheus/util/runtime"
|
|
|
|
"github.com/prometheus/prometheus/web"
|
|
|
|
"github.com/prometheus/prometheus/web"
|
|
|
|
"github.com/prometheus/prometheus/web/api"
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
@ -500,10 +500,10 @@ func main() {
|
|
|
|
|
|
|
|
|
|
|
|
logger := promlog.New(&cfg.promlogConfig)
|
|
|
|
logger := promlog.New(&cfg.promlogConfig)
|
|
|
|
|
|
|
|
|
|
|
|
notifs := api.NewNotifications(cfg.maxNotificationsSubscribers, prometheus.DefaultRegisterer)
|
|
|
|
notifs := notifications.NewNotifications(cfg.maxNotificationsSubscribers, prometheus.DefaultRegisterer)
|
|
|
|
cfg.web.NotificationsSub = notifs.Sub
|
|
|
|
cfg.web.NotificationsSub = notifs.Sub
|
|
|
|
cfg.web.NotificationsGetter = notifs.Get
|
|
|
|
cfg.web.NotificationsGetter = notifs.Get
|
|
|
|
notifs.AddNotification(api.StartingUp)
|
|
|
|
notifs.AddNotification(notifications.StartingUp)
|
|
|
|
|
|
|
|
|
|
|
|
if err := cfg.setFeatureListOptions(logger); err != nil {
|
|
|
|
if err := cfg.setFeatureListOptions(logger); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, fmt.Errorf("Error parsing feature list: %w", err))
|
|
|
|
fmt.Fprintln(os.Stderr, fmt.Errorf("Error parsing feature list: %w", err))
|
|
|
@ -990,7 +990,7 @@ func main() {
|
|
|
|
func(err error) {
|
|
|
|
func(err error) {
|
|
|
|
close(cancel)
|
|
|
|
close(cancel)
|
|
|
|
webHandler.SetReady(web.Stopping)
|
|
|
|
webHandler.SetReady(web.Stopping)
|
|
|
|
notifs.AddNotification(api.ShuttingDown)
|
|
|
|
notifs.AddNotification(notifications.ShuttingDown)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1091,10 +1091,10 @@ func main() {
|
|
|
|
|
|
|
|
|
|
|
|
callback := func(success bool) {
|
|
|
|
callback := func(success bool) {
|
|
|
|
if success {
|
|
|
|
if success {
|
|
|
|
notifs.DeleteNotification(api.ConfigurationUnsuccessful)
|
|
|
|
notifs.DeleteNotification(notifications.ConfigurationUnsuccessful)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
notifs.AddNotification(api.ConfigurationUnsuccessful)
|
|
|
|
notifs.AddNotification(notifications.ConfigurationUnsuccessful)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
g.Add(
|
|
|
|
g.Add(
|
|
|
@ -1176,7 +1176,7 @@ func main() {
|
|
|
|
reloadReady.Close()
|
|
|
|
reloadReady.Close()
|
|
|
|
|
|
|
|
|
|
|
|
webHandler.SetReady(web.Ready)
|
|
|
|
webHandler.SetReady(web.Ready)
|
|
|
|
notifs.DeleteNotification(api.StartingUp)
|
|
|
|
notifs.DeleteNotification(notifications.StartingUp)
|
|
|
|
level.Info(logger).Log("msg", "Server is ready to receive web requests.")
|
|
|
|
level.Info(logger).Log("msg", "Server is ready to receive web requests.")
|
|
|
|
<-cancel
|
|
|
|
<-cancel
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|