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

fix: grpc server ValueError when using unix sockets #3394

Merged
merged 6 commits into from
Apr 2, 2025

Conversation

diurnalist
Copy link
Contributor

@diurnalist diurnalist commented Mar 28, 2025

Description

with some grpc implementations the full .peer address is available for unix sockets, which includes the socket path. it seems that in versions of grpc prior to 1.53.0, the full path is returned by context.peer(). rather than change the dependency of the instrumentation, this updates it to more gracefully handle the case of the socket path being present or absent.

Fixes #3393

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Used repro steps in filed issue

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

diurnalist and others added 2 commits March 28, 2025 15:56
with some grpc implementations the full .peer address is available
for unix sockets, which includes the socket path. it seems that
in versions of grpc prior to 1.53.0, the full path is returned by
`context.peer()`. rather than change the dependency of the instrumentation,
this updates it to more gracefully handle the case of the socket path
being present or absent.

Fixes open-telemetry#3393
@diurnalist
Copy link
Contributor Author

I suspect grpc/grpc#31108 might have resulted in grpc not returning anything beyond unix: for the peer address in versions past 1.50.0

@xrmx
Copy link
Contributor

xrmx commented Mar 31, 2025

@diurnalist please add a changelog entry

@diurnalist diurnalist requested a review from a team as a code owner March 31, 2025 16:04
@diurnalist
Copy link
Contributor Author

@diurnalist please add a changelog entry

done, sorry I missed that!

@xrmx xrmx enabled auto-merge (squash) April 2, 2025 08:36
@xrmx xrmx merged commit fa499f5 into open-telemetry:main Apr 2, 2025
720 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gRPC instrumentation fails when server uses unix socket
2 participants