From: Ian Kelling Date: Wed, 2 Aug 2023 20:44:13 +0000 (-0400) Subject: add extra logging to 0.24.0, save build and build script X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;ds=sidebyside;p=blackbox_exporter.git add extra logging to 0.24.0, save build and build script --- diff --git a/fsfbuild/blackbox_exporter b/fsfbuild/blackbox_exporter new file mode 100755 index 0000000..ae49edb Binary files /dev/null and b/fsfbuild/blackbox_exporter differ diff --git a/fsfmake.sh b/fsfmake.sh new file mode 100755 index 0000000..8fe705d --- /dev/null +++ b/fsfmake.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# fixes this error: +# ERRO Running error: context loading failed: failed to load packages: timed out to load packages: context deadline exceeded +# golangci-lint run ./... +# ERRO Timeout exceeded: try increasing it by passing --timeout option +# make: *** [Makefile.common:173: common-lint] Error 4 + +# the hidden message is: for most people, taking this long would be an +# error, but if you are on a really slow computer, we have a flag you +# can add + +GOLANGCI_LINT_OPTS=--timeout=5m + + +make diff --git a/prober/http.go b/prober/http.go index 441edc4..cb15b79 100644 --- a/prober/http.go +++ b/prober/http.go @@ -53,12 +53,14 @@ func matchRegularExpressions(reader io.Reader, httpConfig config.HTTPProbe, logg for _, expression := range httpConfig.FailIfBodyMatchesRegexp { if expression.Regexp.Match(body) { level.Error(logger).Log("msg", "Body matched regular expression", "regexp", expression) + level.Debug(logger).Log("msg", "Received html body", "body", body) return false } } for _, expression := range httpConfig.FailIfBodyNotMatchesRegexp { if !expression.Regexp.Match(body) { level.Error(logger).Log("msg", "Body did not match regular expression", "regexp", expression) + level.Debug(logger).Log("msg", "Received html body", "body", body) return false } }