From ed069906092d942449d683eea53cbc93e328aa7a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 25 Nov 2020 22:26:23 +0200 Subject: [PATCH] app/vmagent: do not enable -promscrape.config.strictParse when -dryRun command-line flag is set Users can specify -promscrape.config.strictParse if -promscrape.config shouldn't contain unknown config entries --- app/vmagent/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index 04c6cd8b26..bcff08e83f 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -48,7 +48,8 @@ var ( "Usually :4242 must be set. Doesn't work if empty") opentsdbHTTPListenAddr = flag.String("opentsdbHTTPListenAddr", "", "TCP address to listen for OpentTSDB HTTP put requests. Usually :4242 must be set. Doesn't work if empty") dryRun = flag.Bool("dryRun", false, "Whether to check only config files without running vmagent. The following files are checked: "+ - "-promscrape.config, -remoteWrite.relabelConfig, -remoteWrite.urlRelabelConfig . See also -promscrape.config.dryRun") + "-promscrape.config, -remoteWrite.relabelConfig, -remoteWrite.urlRelabelConfig . "+ + "Unknown config entries are allowed in -promscrape.config by default. This can be changed with -promscrape.config.strictParse") ) var ( @@ -69,9 +70,6 @@ func main() { cgroup.UpdateGOMAXPROCSToCPUQuota() if *dryRun { - if err := flag.Set("promscrape.config.strictParse", "true"); err != nil { - logger.Panicf("BUG: cannot set promscrape.config.strictParse=true: %s", err) - } if err := remotewrite.CheckRelabelConfigs(); err != nil { logger.Fatalf("error when checking relabel configs: %s", err) }