Merge pull request #9 from steigr/bugfix/respect-ipv6-and-env-in-healthbind

Bugfix/respect ipv6 and env in healthbind
This commit is contained in:
Björn Busse 2018-04-24 21:08:14 +02:00 committed by GitHub
commit 782bce527b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -39,7 +39,6 @@ import (
const (
PROXY_TIMEOUT = 5
HEALTCHECK_PORT = 8080
)
var (
@ -58,6 +57,7 @@ var (
metrics = flag.Bool("metrics", false, "Enable metrics export")
verbose = flag.Bool("v", false, "Enable verbose logging.")
healtcheck = flag.Bool("healthcheck", false, "Enable healthcheck endpoint.")
healtbind = flag.String("healthbind", "[::]:8086", "Healthcheck bind address and port.")
clients_tls_total = prometheus.NewCounter(
prometheus.CounterOpts{
@ -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() {