Use provided argument or fall-back for health-bind.

The following arguments may used to specifiy health-check behavior:
* `-healthcheck` : Enable healthcheck (default: `false`)
* `-healthbind=[::1]:8086` : Override Healthcheck bind-address (default: `[::]:8086`

Or use Environmentvariables `HEALTHCHECK` and `HEALTHBIND`
This commit is contained in:
Mathias Kaufmann 2018-04-22 10:47:38 +02:00
parent c7c83926e1
commit cf6cce277f
No known key found for this signature in database
GPG Key ID: 66D500110E370C84

View File

@ -207,13 +207,10 @@ func Run() {
} }
func health_endpoint() { func health_endpoint() {
var (
health_bind = "0.0.0.0:8086"
)
health := healthchecking.NewHandler() health := healthchecking.NewHandler()
health.AddLivenessCheck("goroutine-threshold", healthchecking.GoroutineCountCheck(100)) health.AddLivenessCheck("goroutine-threshold", healthchecking.GoroutineCountCheck(100))
log.Printf("Healthcheck listening on http://%s", health_bind) log.Printf("Healthcheck listening on http://%s", *healtbind)
http.ListenAndServe(health_bind, health) http.ListenAndServe(*healtbind, health)
} }
func prom_export() { func prom_export() {