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
1 changed files with 2 additions and 5 deletions

View File

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