mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-09 01:13:09 +00:00
metrics: add /health endpoint for healthchecks
Because calling `/metrics` for a Consul healhcheck is too heavy and far too verbose. Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
c86db00285
commit
42cf5430c9
@ -40,6 +40,11 @@ func NewMetricsServer(address string, port int) *Server {
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/metrics", pe)
|
||||
|
||||
// Healthcheck
|
||||
mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, "OK")
|
||||
})
|
||||
|
||||
h := &ochttp.Handler{Handler: mux}
|
||||
|
||||
// Register the views
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user