Latency logging

This commit is contained in:
Weves
2024-06-01 14:55:36 -07:00
committed by Chris Weaver
parent 026652d827
commit 6e9d7acb9c
7 changed files with 55 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
# Log format to include request latency
log_format custom_main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'rt=$request_time';
upstream api_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
@@ -20,6 +26,8 @@ server {
client_max_body_size 5G; # Maximum upload size
access_log /var/log/nginx/access.log custom_main;
# Match both /api/* and /openapi.json in a single rule
location ~ ^/(api|openapi.json)(/.*)?$ {
# Rewrite /api prefixed matched paths

View File

@@ -1,3 +1,9 @@
# Override log format to include request latency
log_format custom_main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'rt=$request_time';
upstream api_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
@@ -20,6 +26,8 @@ server {
client_max_body_size 5G; # Maximum upload size
access_log /var/log/nginx/access.log custom_main;
# Match both /api/* and /openapi.json in a single rule
location ~ ^/(api|openapi.json)(/.*)?$ {
# Rewrite /api prefixed matched paths
@@ -58,3 +66,4 @@ server {
proxy_pass http://web_server;
}
}

View File

@@ -1,3 +1,9 @@
# Log format to include request latency
log_format custom_main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'rt=$request_time';
upstream api_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response
@@ -20,6 +26,8 @@ server {
client_max_body_size 5G; # Maximum upload size
access_log /var/log/nginx/access.log custom_main;
# Match both /api/* and /openapi.json in a single rule
location ~ ^/(api|openapi.json)(/.*)?$ {
# Rewrite /api prefixed matched paths