-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for request tracing via X-Request-ID header #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| log_format main '$remote_addr - $remote_user [$time_local] $status ' | ||
| '"$request" $body_bytes_sent "$http_referer" ' | ||
| '"$http_user_agent" "$http_x_forwarded_for"'; | ||
| '"$http_user_agent" "$http_x_forwarded_for" $proxy_x_request_id'; | ||
|
Comment on lines
1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to improve this log format to have a little more information but I think that's best done in another PR. Using the Kubernetes Ingress - Ingress log format as inspiration ... log_format upstreaminfo
'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent" '
'$request_length $request_time [$proxy_upstream_name] [$proxy_alternative_upstream_name] $upstream_addr '
'$upstream_response_length $upstream_response_time $upstream_status $req_id';There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can get behind this 👌 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done in #6. |
||
|
|
||
| access_log /dev/stdout main; | ||
| error_log /dev/stdout warn; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some apps like Rails with use this as the
request_idif theX-Request-IDexists. Else, they generate one. So it's certainly useful to set it here because it will be used upstream. See ...