Skip to content

Commit

Permalink
enhancement: config file probe type validation
Browse files Browse the repository at this point in the history
Signed-off-by: François Gouteroux <[email protected]>
  • Loading branch information
fgouteroux committed Oct 19, 2023
1 parent a45f3e1 commit fe6999a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ func run() int {
}

if *configCheck {
var hasErrors bool
for name, module := range sc.C.Modules {
if _, ok := prober.Probers[module.Prober]; !ok {
level.Error(logger).Log("err", fmt.Sprintf("Unknown probe type '%s' for module name '%s", module.Prober, name))
hasErrors = true
}
}
if hasErrors {
return 1
}
level.Info(logger).Log("msg", "Config file is ok exiting...")
return 0
}
Expand Down

0 comments on commit fe6999a

Please sign in to comment.