Skip to content
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

otelgrpc: Feature request: Track end-user IPs on gRPC requests #811

Open
ahmetb opened this issue Jun 2, 2021 · 1 comment
Open

otelgrpc: Feature request: Track end-user IPs on gRPC requests #811

ahmetb opened this issue Jun 2, 2021 · 1 comment
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgrpc

Comments

@ahmetb
Copy link

ahmetb commented Jun 2, 2021

Currently otelgrpc package provides labels like:

key value
net.peer.port 54566
net.peer.ip 169.254.8.129

This is great but it is not useful in a cloud environment where the immediate IPv4 connections are coming from load balancers or API gateways and the end user's IP address is not captured in TCP peer info.

I am proposing that otelgrpc package also labels end-client IP address by looking at HTTP header (gRPC metadata) if it is available on RPC context through x-forwarded-for and/or x-real-ip header (whichever exists).

This is useful on many Kubernetes ingress implementations, CloudFlare as well as platforms like Google Cloud Run.

I am not sure what are the semconv names for such things, or if there is a standard name is allocated. otelmux package for example uses http.client_ip for this purpose.

@ahmetb ahmetb added area: instrumentation Related to an instrumentation package enhancement New feature or request release:after-ga labels Jun 2, 2021
@ahmetb ahmetb changed the title otelgrpc: Feature requets: Track end-user IPs in net.peer otelgrpc: Feature requets: Track end-user IPs on gRPC requests Jun 2, 2021
@ahmetb ahmetb changed the title otelgrpc: Feature requets: Track end-user IPs on gRPC requests otelgrpc: Feature request: Track end-user IPs on gRPC requests Jun 2, 2021
@ahmetb
Copy link
Author

ahmetb commented Jun 2, 2021

I appreciate if someone can clear the labels, I should not have used the issue template.

plantfansam referenced this issue in plantfansam/opentelemetry-go-contrib Mar 18, 2022
* Support instrumentation library in metrics

* Update stdout exporter to display instrumentation info

* Fix tests that use the STDOUT exporter

* Refactor to keep SDK out of API

* Update global Meter and test Meter version

* Revert unneeded import syntax change

* Fix Unit comment

* Update comments

* Update comment

* Revert no-op change to import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgrpc
Projects
None yet
Development

No branches or pull requests

2 participants