-
Notifications
You must be signed in to change notification settings - Fork 227
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
feat: log local TCP address #454
base: main
Are you sure you want to change the base?
feat: log local TCP address #454
Conversation
The big question is: how do we proceed with such log changes which could be considered breaking? I don't think it's a healthy practice to keep adding flags for each and every individual log field we add 🤔 |
I agree, I hate having to add so many config properties. But sadly, I do think that this is a breaking change. I think of all the logs that operators look at, I think they DO look at access logs. And they are not a nice json format, they are an unwieldy string mess that you would have to write a custom parser for. Here are the options I see...
So, in summary, I would say:
|
That's what I was expecting 😄
That's probably what I will be going for in this PR to prevent accumulating further config flags. Just a flat list, and if anyone needs special properties they can be added and exposed via this mechanism without breaking anyone.
This is my preferred long-term solution, but it will require quite some effort and it's not clear when we will be able to invest. |
e7b163c
to
eac4b22
Compare
When troubleshooting issues related to keepalive it is often useful to be able to correlate multiple requests made over the same connection. A first step was to introduce the information on whether the request was made on a re-used connection or not which was done with a7dbf84. This commit adds the local address of the TCP connection which adds the capability to distinguish between multiple, parallel keep-alive connections by looking at the client port of gorouter for the backend connection.
eac4b22
to
20a7867
Compare
I've added a new property which allows logging of additional fields in a generic way. The release PR will follow once we agree on this PR. |
@@ -314,6 +314,27 @@ var _ = Describe("AccessLogRecord", func() { | |||
Eventually(r).Should(Say(`x_cf_routererror:"-"`)) | |||
}) | |||
}) | |||
|
|||
Context("when extra_fields is set to [local_address]", func() { |
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.
Can you add an test for...
- when extra_fields does not contain local_address, then the local address is not tested.
- when extra_fields contains "meow" it ... does not error? logs? idk does something reasonable?
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.
❓ Can you add a PR to routing-release so I can deploy and test everything at once?
Summary
When troubleshooting issues related to keepalive it is often useful to be able to correlate multiple requests made over the same connection. A first step was to introduce the information on whether the request was made on a re-used connection or not which was done with a7dbf84. This commit adds the local address of the TCP connection which adds the capability to distinguish between multiple, parallel keep-alive connections by looking at the client port of gorouter for the backend connection.
Backward Compatibility
Breaking Change? Yes