From b1b343a8ace197ca2410f4add9d0c292f6a727b4 Mon Sep 17 00:00:00 2001 From: Nader Ziada Date: Tue, 26 Oct 2021 12:03:15 -0400 Subject: [PATCH] use different handler for healthcheck --- cmd/queue/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/queue/main.go b/cmd/queue/main.go index 347979c2f73b..fb99fa424081 100644 --- a/cmd/queue/main.go +++ b/cmd/queue/main.go @@ -313,8 +313,14 @@ func buildServer(ctx context.Context, env config, drainer *pkghandler.Drainer, p composedHandler = requestLogHandler(logger, composedHandler, env) } + var healthcheckHandler http.Handler + healthcheckHandler = health.ProbeHandler(probeContainer, tracingEnabled, healthcheckHandler) + if env.ServingEnableRequestLog { + healthcheckHandler = requestLogHandler(logger, healthcheckHandler, env) + } + drainer.Inner = composedHandler - drainer.HealthCheck = composedHandler.ServeHTTP + drainer.HealthCheck = healthcheckHandler.ServeHTTP return pkgnet.NewServer(":"+env.QueueServingPort, drainer) }