-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(tracing): add http.client_ip attribute #10723
Conversation
As a developer troubleshooting requests using trace data, I expect my access logs to be consistent with my traces. The access logs currently record the forwarded_ip, which tells me what my client's true ip is (assuming proper setup of trusted IPs etc). This change switches the span attribute for peer ip to use forwarded_ip as well.
@backjo Could you help us to fix the test? This is related to your feature. https://github.com/Kong/kong/blob/master/spec/02-integration/14-tracing/01-instrumentations_spec.lua#L138 |
@attenuation will update this PR after the earlier
Should be fixed - added test attribute to verify this new one |
Thanks for your contribution. The change looks good. Please add a proper changelog. |
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.
The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). [2]
That means:
http.client_ip
is the real client IP
net.peer.ip
is the proxy socket source IP.
Added the changelog! |
Summary
As a developer troubleshooting requests using trace data, I expect my access logs to be consistent with my traces. The access logs currently record the forwarded_ip, which tells me what my client's true ip is (assuming proper setup of trusted IPs etc). This change adds a span attribute for client ip using the forwarded ip
Checklist
Full changelog
Issue reference
Fix #[issue number]