-
Notifications
You must be signed in to change notification settings - Fork 828
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
Fill HTTP_CLIENT_IP in ServerInstrumenter #3756
Conversation
|
||
@Nullable | ||
// Visible for testing | ||
String getForwardedClientIp(REQUEST request) { |
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.
Just copied from HttpServerTracer
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.
I like the auto-capture
AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response) { | ||
String clientIp = getForwardedClientIp(request); | ||
if (clientIp == null && netAttributesExtractor != null) { | ||
clientIp = netAttributesExtractor.peerIp(request, response); |
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.
it's not clear to me that http.client_ip
should be populated in this case since easy for exporter/backend to fallback to net.peer.ip
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.
We do it right now, though I agree it's not clear. Figured we'd stick to what we have for now though.
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.
makes sense, I'll open a spec issue to seek clarification and we can revisit later
Looks like this doesn't need to be exposed on the normal HttpAttributesExtractor