From 7eb9f4933d26c33e8092c86f69779a91b67c8b04 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Wed, 30 Oct 2024 09:43:21 +0000 Subject: [PATCH] PMM-9315 use logfmt format for nginx --- .../ansible/roles/loki/files/Dockerfile.loki | 4 +-- build/ansible/roles/loki/files/nginx.conf | 31 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/build/ansible/roles/loki/files/Dockerfile.loki b/build/ansible/roles/loki/files/Dockerfile.loki index 3d8ebaa94c..4f187d4221 100644 --- a/build/ansible/roles/loki/files/Dockerfile.loki +++ b/build/ansible/roles/loki/files/Dockerfile.loki @@ -1,7 +1,7 @@ # TODO: the image should be percona/pmm-server:3 once PMM v3 is released. -# To build the image, run the following in the project root directory: -# docker buildx build --platform=linux/amd64 --progress plain -t perconalab/pmm-server:loki-3.2 -f ./build/ansible/roles/loki/files/Dockerfile.loki . # mind the dot +# To build the image, run the following in the project root directory (mind the dot): +# docker buildx build --platform=linux/amd64 --progress plain -t perconalab/pmm-server:loki-3.2 -f ./build/ansible/roles/loki/files/Dockerfile.loki . FROM perconalab/pmm-server:3-dev-latest ENV GF_ANALYTICS_CHECK_FOR_UPDATES=false diff --git a/build/ansible/roles/loki/files/nginx.conf b/build/ansible/roles/loki/files/nginx.conf index e9c9c67fa5..a3ef9cc7ab 100644 --- a/build/ansible/roles/loki/files/nginx.conf +++ b/build/ansible/roles/loki/files/nginx.conf @@ -23,22 +23,21 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - log_format json_format escape=json '{' - '"time_local": "$time_local",' - '"host": "$http_host",' - '"remote_addr": "$remote_addr",' - '"request_method": "$request_method",' - '"request": "$request_uri",' - '"request_time": "$request_time",' - '"body_bytes_sent": "$body_bytes_sent",' - '"server_protocol": "$server_protocol",' - '"status": "$status",' - '"http_referrer":"$http_referer",' - '"http_x_forwarded_for": "$http_x_forwarded_for",' - '"http_user_agent": "$http_user_agent"' - '}'; - - access_log /dev/stdout json_format; + log_format ext_format + 'time="$time_iso8601" ' + 'host=$http_host ' + 'remote_addr=$remote_addr ' + 'request_method=$request_method ' + 'request="$request_uri" ' + 'request_time=$request_time ' + 'body_bytes_sent=$body_bytes_sent ' + 'server_protocol="$server_protocol" ' + 'status=$status ' + 'http_referrer="$http_referer" ' + 'http_x_forwarded_for="$http_x_forwarded_for" ' + 'http_user_agent="$http_user_agent"'; + + access_log /dev/stdout ext_format; sendfile on; gzip on;