From ffc65acc437de3371b048ff711884c16ab86469f Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Mon, 11 Nov 2024 19:18:05 +0300 Subject: [PATCH] PMM-9315 Don't log healthchecks to nginx --- build/ansible/roles/loki/files/nginx.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/ansible/roles/loki/files/nginx.conf b/build/ansible/roles/loki/files/nginx.conf index a3ef9cc7ab..4921716440 100644 --- a/build/ansible/roles/loki/files/nginx.conf +++ b/build/ansible/roles/loki/files/nginx.conf @@ -23,6 +23,12 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; + # Exclude health check requests + map $request_uri $loggable { + ~^/v1/server/readyz 0; + default 1; + } + log_format ext_format 'time="$time_iso8601" ' 'host=$http_host ' @@ -37,7 +43,7 @@ http { 'http_x_forwarded_for="$http_x_forwarded_for" ' 'http_user_agent="$http_user_agent"'; - access_log /dev/stdout ext_format; + access_log /dev/stdout ext_format if=$loggable; sendfile on; gzip on;