diff --git a/cmd/prometheus/config.go b/cmd/prometheus/config.go index e7ff539b4b..926df34e11 100644 --- a/cmd/prometheus/config.go +++ b/cmd/prometheus/config.go @@ -116,10 +116,6 @@ func init() { ) // Alertmanager. - cfg.fs.Var( - &cfg.alertmanagerURLs, "alertmanager.url", - "Comma-separated list of Alertmanager URLs to send notifications to.", - ) cfg.fs.IntVar( &cfg.notifier.QueueCapacity, "alertmanager.notification-queue-capacity", 10000, "The capacity of the queue for pending alert manager notifications.", diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 31be3abcac..a96ecbafcc 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -18,7 +18,6 @@ import ( "flag" "fmt" _ "net/http/pprof" // Comment this line to disable pprof endpoint. - "net/url" "os" "os/signal" "syscall" @@ -27,7 +26,6 @@ import ( "github.com/fabxc/tsdb" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/log" - "github.com/prometheus/common/model" "github.com/prometheus/common/version" "golang.org/x/net/context" @@ -242,31 +240,6 @@ func reloadConfig(filename string, rls ...Reloadable) (err error) { return fmt.Errorf("couldn't load configuration (-config.file=%s): %v", filename, err) } - // Add AlertmanagerConfigs for legacy Alertmanager URL flags. - for us := range cfg.alertmanagerURLs { - u, err := url.Parse(us) - if err != nil { - return err - } - acfg := &config.AlertmanagerConfig{ - Scheme: u.Scheme, - PathPrefix: u.Path, - Timeout: cfg.notifierTimeout, - ServiceDiscoveryConfig: config.ServiceDiscoveryConfig{ - StaticConfigs: []*config.TargetGroup{ - { - Targets: []model.LabelSet{ - { - model.AddressLabel: model.LabelValue(u.Host), - }, - }, - }, - }, - }, - } - conf.AlertingConfig.AlertmanagerConfigs = append(conf.AlertingConfig.AlertmanagerConfigs, acfg) - } - failed := false for _, rl := range rls { if err := rl.ApplyConfig(conf); err != nil {