From cf005c644e17bffbcf2fea356bf07e9bbfb97319 Mon Sep 17 00:00:00 2001 From: luke miles Date: Wed, 7 Sep 2022 20:56:12 +0200 Subject: [PATCH] api: don't log requests to health endpoint (#70) --- api/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/api.go b/api/api.go index 636fd8e..a7060c5 100644 --- a/api/api.go +++ b/api/api.go @@ -108,6 +108,11 @@ func versionHandler(h http.Handler, sha string) http.Handler { func tracingHandler(env, service, sha string, h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path == "/health" { + h.ServeHTTP(w, r) + return + } + span, ctx := tracing.SpanFromContext(r.Context(), "http.request") defer span.Finish()