Skip to content

Commit

Permalink
Health endpoint sanity check (#7)
Browse files Browse the repository at this point in the history
* Check that metrics and health endpoints are not identical
* Update error msg with correct parameter name
* Fix wrong path given in health-path precheck error message
  • Loading branch information
carlpett authored and Jonne Nauha committed Nov 1, 2016
1 parent 2909e5b commit ba55a41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ func init() {
logger = log.New(os.Stdout, "", log.Ldate|log.Ltime)

if len(StartParams.Path) == 0 || StartParams.Path[0] != '/' {
logFatal("-path cannot be empty and must start with a slash '/', given %q", StartParams.Path)
logFatal("-web.telemetry-path cannot be empty and must start with a slash '/', given %q", StartParams.Path)
}
if len(StartParams.HealthPath) != 0 && StartParams.HealthPath[0] != '/' {
logFatal("-web.health-path must start with a slash '/' if configured, given %q", StartParams.Path)
logFatal("-web.health-path must start with a slash '/' if configured, given %q", StartParams.HealthPath)
}
if StartParams.Path == StartParams.HealthPath {
logFatal("-web.telemetry-path and -web.health-path cannot have same value")
}
}

Expand Down

0 comments on commit ba55a41

Please sign in to comment.