blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

enhancement: config file probe type validation

Open fgouteroux opened this issue 2 years ago • 4 comments

Hello,

I want to enhance the validation of config file for probe type when using --config.check option.

$ blackbox_exporter  --config.check --config.file config.yml 
ts=2023-10-19T08:46:20.927Z caller=main.go:86 level=info msg="Starting blackbox_exporter" version="(version=0.24.0, branch=fgx-0.24, revision=2c699796ff6809c45027247f142bc7fea13469c1)"
ts=2023-10-19T08:46:20.927Z caller=main.go:87 level=info build_context="(go=go1.20.5, platform=linux/amd64, user=fgouteroux, date=20231019-08:45:34, tags=netgo)"
ts=2023-10-19T08:46:20.953Z caller=main.go:98 level=error err="Unknown probe type 'http2' for module name 'fgx-online"
ts=2023-10-19T08:46:20.953Z caller=main.go:98 level=error err="Unknown probe type 'http1' for module name 'fgx-online-service"

fgouteroux avatar Oct 19 '23 09:10 fgouteroux

hi, any feedback ?

fgouteroux avatar Nov 09 '23 18:11 fgouteroux

hi, nobody for this PR ?

fgouteroux avatar Mar 06 '24 11:03 fgouteroux

hi, no one for this ?

fgouteroux avatar Apr 09 '24 14:04 fgouteroux

@SuperQ I add a test in main_test.go because I got an import cycle error if I put this in config/config_test.go:

package github.com/prometheus/blackbox_exporter
	imports github.com/prometheus/blackbox_exporter/config
	imports github.com/prometheus/blackbox_exporter/prober
	imports github.com/prometheus/blackbox_exporter/config: import cycle not allowed

fgouteroux avatar Jun 10 '24 09:06 fgouteroux