Remove agent mode warnings when loading configs (#9622)

PR #9618 introduced failing to load the config file when agent mode is
configured to run with unspported settings. This made the block that
logs a warning on their configuration no-op, which is now removed.

Signed-off-by: Robert Fratto <robertfratto@gmail.com>
This commit is contained in:
Robert Fratto 2021-11-10 09:09:30 -05:00 committed by GitHub
parent 9fae120f2a
commit 4a83e6f453
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1145,25 +1145,6 @@ func reloadConfig(filename string, expandExternalLabels, enableExemplarStorage b
}
}
// Perform validation for Agent-compatible configs and remove anything that's unsupported.
if agentMode {
// Perform validation for Agent-compatible configs and remove anything that's
// unsupported.
if len(conf.AlertingConfig.AlertRelabelConfigs) > 0 || len(conf.AlertingConfig.AlertmanagerConfigs) > 0 {
level.Warn(logger).Log("msg", "alerting configs not supported in agent mode")
conf.AlertingConfig.AlertRelabelConfigs = []*relabel.Config{}
conf.AlertingConfig.AlertmanagerConfigs = config.AlertmanagerConfigs{}
}
if len(conf.RuleFiles) > 0 {
level.Warn(logger).Log("msg", "recording rules not supported in agent mode")
conf.RuleFiles = []string{}
}
if len(conf.RemoteReadConfigs) > 0 {
level.Warn(logger).Log("msg", "remote_read configs not supported in agent mode")
conf.RemoteReadConfigs = []*config.RemoteReadConfig{}
}
}
failed := false
for _, rl := range rls {
rstart := time.Now()