From ba55a41015f8b93b181dd81b21d0f63e46c66e2e Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Tue, 1 Nov 2016 13:41:22 +0100 Subject: [PATCH] Health endpoint sanity check (#7) * 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 --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a5e75d5..6e842d3 100644 --- a/main.go +++ b/main.go @@ -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") } }