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

OTLP Exporter will not respect domain based NO_PROXY setting due to grpc bug #11537

Closed
akats7 opened this issue Oct 25, 2024 · 0 comments · Fixed by #11575
Closed

OTLP Exporter will not respect domain based NO_PROXY setting due to grpc bug #11537

akats7 opened this issue Oct 25, 2024 · 0 comments · Fixed by #11575
Labels
bug Something isn't working exporter/otlp

Comments

@akats7
Copy link
Contributor

akats7 commented Oct 25, 2024

Describe the bug

There is a bug in go-grpc that prevents the NO_PROXY setting from being properly applied based on domain name values in the NO_PROXY string. See issue here. At this point it seems that they're aware of the issue and working on a fix but just wanted to socialize this to see if we might need a temp patch. Note: this bug does not apply to localhost based NO_PROXY settings

Proposed Patch:
We should likely use DialContext instead of NewClient in the configgrpc package until this is resolved.

Steps to reproduce

Set an HTTP/HTTPS proxy and use the otlp exporter with a domain name that matches an entry in your NO_PROXY
What did you expect to see?

Proxy setting to remain unset
What did you see instead?

HTTPS_PROXY applied
What version did you use?

v0.112.0

@akats7 akats7 added the bug Something isn't working label Oct 25, 2024
@akats7 akats7 changed the title OTLP Receiver will not respect domain based NO_PROXY setting due to grpc bug OTLP Exporter will not respect domain based NO_PROXY setting due to grpc bug Oct 25, 2024
djaglowski pushed a commit to djaglowski/opentelemetry-collector that referenced this issue Nov 21, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This is related open-telemetry#11537 and [this grpc
issue](grpc/grpc-go#7779), to reiterate there
is a bug in the grpc-go NewClient that makes the way the hostname is
resolved incompatible with the way proxy setting are applied. Due to
this domain based NO_PROXY setting do not work for grpc connections.
They are working on a fix in the grpc library but until then it seems
like it might be a good idea to revert to using DialContext instead of
NewClient.

If there's a workaround for this that anyone is aware of that could be
suitable as well, the most clear one of using passthrough doesn't work
since we sanitize the endpoint.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes open-telemetry#11537 

<!--Describe what testing was performed and which tests were added.-->
#### Testing

I added some logging where the proxy setting are evaluated to show the
behavior.

**DialContext**
______
InMatch
host :  otel*******</DOMAIN-NAME/>
m.host :  </DOMAIN-NAME/> 
hasSuffix :  true
m.matchHost :  true
______

**NewClient**
______
InMatch
host :  10.*.*.*.*
m.host :  </DOMAIN-NAME/> 
hasSuffix :  false
m.matchHost :  false
______

---------

Co-authored-by: Yang Song <[email protected]>
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this issue Dec 19, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This is related open-telemetry#11537 and [this grpc
issue](grpc/grpc-go#7779), to reiterate there
is a bug in the grpc-go NewClient that makes the way the hostname is
resolved incompatible with the way proxy setting are applied. Due to
this domain based NO_PROXY setting do not work for grpc connections.
They are working on a fix in the grpc library but until then it seems
like it might be a good idea to revert to using DialContext instead of
NewClient.

If there's a workaround for this that anyone is aware of that could be
suitable as well, the most clear one of using passthrough doesn't work
since we sanitize the endpoint.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes open-telemetry#11537 

<!--Describe what testing was performed and which tests were added.-->
#### Testing

I added some logging where the proxy setting are evaluated to show the
behavior.

**DialContext**
______
InMatch
host :  otel*******</DOMAIN-NAME/>
m.host :  </DOMAIN-NAME/> 
hasSuffix :  true
m.matchHost :  true
______

**NewClient**
______
InMatch
host :  10.*.*.*.*
m.host :  </DOMAIN-NAME/> 
hasSuffix :  false
m.matchHost :  false
______

---------

Co-authored-by: Yang Song <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/otlp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants