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

updated grpc config to use DialContext #11575

Merged
merged 9 commits into from
Nov 4, 2024

Conversation

akats7
Copy link
Contributor

@akats7 akats7 commented Oct 30, 2024

Description

This is related #11537 and this grpc issue, 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.

Link to tracking issue

Fixes #11537

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


@akats7 akats7 requested a review from a team as a code owner October 30, 2024 14:08
@akats7 akats7 requested a review from bogdandrutu October 30, 2024 14:08
Copy link

linux-foundation-easycla bot commented Oct 30, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@cd6bfbb). Learn more about missing BASE report.
Report is 21 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11575   +/-   ##
=======================================
  Coverage        ?   91.57%           
=======================================
  Files           ?      441           
  Lines           ?    23873           
  Branches        ?        0           
=======================================
  Hits            ?    21861           
  Misses          ?     1640           
  Partials        ?      372           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a changelog? (seems yes)

@akats7
Copy link
Contributor Author

akats7 commented Oct 30, 2024

Does this need a changelog? (seems yes)

yep added

@akats7
Copy link
Contributor Author

akats7 commented Nov 1, 2024

@songy23 anything else needed to get this merged, just want to ensure it’s included in the next release

@bogdandrutu bogdandrutu added the release:blocker The issue must be resolved before cutting the next release label Nov 2, 2024
@songy23
Copy link
Member

songy23 commented Nov 4, 2024

@akats7 I don't have the access to merge PRs unfortunately

@songy23
Copy link
Member

songy23 commented Nov 4, 2024

@open-telemetry/collector-maintainers Are we good with merging this? It's a simple 1-line bug fix

@bogdandrutu
Copy link
Member

It's a simple 1-line bug fix

Famous last words :)) How confident are you in the fix? I have not had time to read about.

@songy23
Copy link
Member

songy23 commented Nov 4, 2024

Context are in grpc/grpc-go#7556 & grpc/grpc-go#7779. gRPC maintainers acked there's an issue with proxy in grpc.NewClient which makes it incompatible with grpc.DialContext. I did not have time to reproduce it myself but @akats7 has tried and left the findings in the PR description.

yurishkuro pushed a commit to jaegertracing/jaeger that referenced this pull request Nov 12, 2024
#6197)

## Which problem is this PR solving?
- Continuation of #6175.
- There was a breaking change made in
open-telemetry/opentelemetry-collector#11575
that updates `ToClientConn` to use `DialContext` instead of `NewClient`
because of a bug. `DialContext` uses the `passthrough` scheme was
resulting in the following error when the endpoint is left empty. This
PR fixes the unit tests by setting the endpoint in the test configs to
be non-empty.
```
grpc storage builder failed to create a store: error creating traced remote storage client: failed to exit idle mode: passthrough: received empty target in Build()
```

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
djaglowski pushed a commit to djaglowski/opentelemetry-collector that referenced this pull request 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 pull request 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
exporter/otlp release:blocker The issue must be resolved before cutting the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTLP Exporter will not respect domain based NO_PROXY setting due to grpc bug
3 participants