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