From 4a83e6f453c8bf838abe00d7d6fc9b3ea2569b90 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Wed, 10 Nov 2021 09:09:30 -0500 Subject: [PATCH] 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 --- cmd/prometheus/main.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 562fd727f..b325b7efe 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -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()