Skip to content

Commit fdebacd

Browse files
neoreddogDan Ambrose
authored andcommitted
Adding extra fields to access logging
Linkerd access logs are missing the origin IP address. Solved by adding in the field x_forwarded_for to access logs which has the origin ip address. Validated by compiling and deploying the modified proxy image alongside a nginx container, checking access log content for existing fields + the new field Part fixes issue #9842 Signed-off-by: Dan Ambrose <[email protected]>
1 parent 704ef31 commit fdebacd

File tree

1 file changed

+1
-0
lines changed
  • linkerd/http-access-log/src

1 file changed

+1
-0
lines changed

linkerd/http-access-log/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ where
133133
processing_ns = field::Empty,
134134
user_agent = get_header(http::header::USER_AGENT),
135135
host = get_header(http::header::HOST),
136+
x_forwarded_for = get_header(http::header::HeaderName::from_static("x-forwarded-for"))
136137
);
137138

138139
// The access log span is only enabled by the `tracing` subscriber if

0 commit comments

Comments
 (0)