Christian Fritz
4 years ago
3 changed files with 41 additions and 16 deletions
@ -0,0 +1,17 @@ |
|||||
|
package main |
||||
|
|
||||
|
import ( |
||||
|
"github.com/heptiolabs/healthcheck" |
||||
|
"time" |
||||
|
) |
||||
|
|
||||
|
// createHealthChecks will create the readiness and liveness endpoints and add the check functions.
|
||||
|
func createHealthChecks(gatewayUrl string) healthcheck.Handler { |
||||
|
health := healthcheck.NewHandler() |
||||
|
|
||||
|
health.AddReadinessCheck("FRITZ!Box connection", |
||||
|
healthcheck.HTTPGetCheck(gatewayUrl+"/any.xml", time.Duration(3)*time.Second)) |
||||
|
|
||||
|
health.AddLivenessCheck("go-routines", healthcheck.GoroutineCountCheck(100)) |
||||
|
return health |
||||
|
} |
Loading…
Reference in new issue