Skip to content

Commit

Permalink
PMM-9315 Don't log healthchecks to nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Nov 11, 2024
1 parent 083c72d commit ffc65ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build/ansible/roles/loki/files/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand All @@ -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;
Expand Down

0 comments on commit ffc65ac

Please sign in to comment.