open-telemetry / opentelemetry-go

OpenTelemetry Go API and SDK
https://opentelemetry.io/docs/languages/go
Apache License 2.0
5.35k stars 1.09k forks source link

OTLP GRPC exporters don't respect domain NO_PROXY settings due to grpc bug #5976

Open akats7 opened 2 weeks ago

akats7 commented 2 weeks ago

Description

Brought up this issue in the collector repo, realized it should likely be applied here as well.

There's a bug in grpc-go (here and here) related to the way NewClient does hostname resolution where now the host is resolved before the ProxyFromEnvironment function is called, due to this domain based no_proxy settings are not applied as the comparison is done only against the ip. localhost is not affected.

The grpc team is working on a fix but it seems like until that's in place we might want to revert to DialContext instead of NewClient.

Environment

Steps To Reproduce

Set HTTP/S_PROXY Init OTLP GRPC client with target endpoint Include endpoint sub-domain in NO_PROXY

Expected behavior

HTTP/S_PROXY setting should still be applied

wasim-nihal commented 1 week ago

Hello @MrAlias! I would like to contribute the fix for this issue.

MrAlias commented 1 week ago

Short term workaround: https://github.com/grpc/grpc-go/issues/7556#issuecomment-2307484808

We plan to hold off on this until the next release of grpc: https://github.com/grpc/grpc-go/milestone/67

If it is not resolved in that release we will re-evaluate applying a more permanent fix here.

wasim-nihal commented 1 week ago

sure @MrAlias