Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: config file probe type validation #1138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fgouteroux
Copy link

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 fgouteroux force-pushed the enhancement/config_file_validation branch 2 times, most recently from df6c9e1 to fe6999a Compare October 19, 2023 09:16
@fgouteroux
Copy link
Author

hi, any feedback ?

@fgouteroux
Copy link
Author

hi, nobody for this PR ?

@fgouteroux
Copy link
Author

hi, no one for this ?

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test case to config/config_test.go.

@fgouteroux fgouteroux force-pushed the enhancement/config_file_validation branch from fe6999a to fb9a781 Compare June 10, 2024 09:13
@fgouteroux fgouteroux force-pushed the enhancement/config_file_validation branch from fb9a781 to d320e85 Compare June 10, 2024 09:16
@fgouteroux
Copy link
Author

@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 fgouteroux requested a review from SuperQ June 10, 2024 09:19
@github-actions github-actions bot added the stale label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants