From 718a6d5cc552319f9147ddad638eeca14b5fe32b Mon Sep 17 00:00:00 2001 From: Federico Tedin Date: Fri, 13 Dec 2024 16:56:30 +0100 Subject: [PATCH] Liveness/readiness probes --- pkg/http/http.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/http/http.go b/pkg/http/http.go index 8fc54aa..87833cb 100644 --- a/pkg/http/http.go +++ b/pkg/http/http.go @@ -139,6 +139,16 @@ func NewServer() (*Server, error) { MaxAge: 300, // Maximum value not ignored by any of major browsers }).Handler) + // Readiness probe + router.Get("/ready", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + }) + + // Liveness probe + router.Get("/healthz", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + }) + return &Server{ traceInstaller: &TraceInstaller{}, router: router,