mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Merge pull request #8044 from prometheus/beorn7/metrics
Instrumentation: Report valid configs in the respective metrics from the beginning
This commit is contained in:
commit
71577e45eb
|
@ -290,6 +290,14 @@ func main() {
|
||||||
level.Error(logger).Log("msg", fmt.Sprintf("Error loading config (--config.file=%s)", cfg.configFile), "err", err)
|
level.Error(logger).Log("msg", fmt.Sprintf("Error loading config (--config.file=%s)", cfg.configFile), "err", err)
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
|
// Now that the validity of the config is established, set the config
|
||||||
|
// success metrics accordingly, although the config isn't really loaded
|
||||||
|
// yet. This will happen later (including setting these metrics again),
|
||||||
|
// but if we don't do it now, the metrics will stay at zero until the
|
||||||
|
// startup procedure is complete, which might take long enough to
|
||||||
|
// trigger alerts about an invalid config.
|
||||||
|
configSuccess.Set(1)
|
||||||
|
configSuccessTime.SetToCurrentTime()
|
||||||
|
|
||||||
cfg.web.ReadTimeout = time.Duration(cfg.webTimeout)
|
cfg.web.ReadTimeout = time.Duration(cfg.webTimeout)
|
||||||
// Default -web.route-prefix to path of -web.external-url.
|
// Default -web.route-prefix to path of -web.external-url.
|
||||||
|
|
Loading…
Reference in a new issue