Skip to content

Commit

Permalink
PMM-9315 use logfmt format for nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Oct 30, 2024
1 parent ae6b2fb commit 7eb9f49
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions build/ansible/roles/loki/files/Dockerfile.loki
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 15 additions & 16 deletions build/ansible/roles/loki/files/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7eb9f49

Please sign in to comment.