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

opentelemetry-exporter-otlp: http_connection does not handle ipv6 host #1721

Open
acarella1 opened this issue Sep 4, 2024 · 5 comments · May be fixed by #1747
Open

opentelemetry-exporter-otlp: http_connection does not handle ipv6 host #1721

acarella1 opened this issue Sep 4, 2024 · 5 comments · May be fixed by #1747
Labels
bug Something isn't working keep

Comments

@acarella1
Copy link

The OT library uses host from URI which fails to unwrap ipv6 brackets properly. Fix is to update this to use hostname instead, which will return a plain ipv6 address which is what Net::HTTP expects as the first argument.

http = Net::HTTP.new(uri.host, uri.port)

Share details about your runtime

Operating system details: FROM ruby:3.3.5-bookworm
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.3.5"
RUBY_DESCRIPTION: "ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [aarch64-linux]"

Share a simplified reproduction if possible

failure.rb

require 'net/http'
uri = URI('http://[::1]:4318')
http = Net::HTTP.new(uri.host, uri.port)
http.start

(hard error) getaddrinfo: Name or service not known (Socket::ResolutionError)

success.rb

require 'net/http'
uri = URI('http://[::1]:4318')
http = Net::HTTP.new(uri.hostname, uri.port)
http.start

(would be a success if something were on the port) Connection refused - connect(2) for "::1" port 4318 (Errno::ECONNREFUSED)

@acarella1 acarella1 added the bug Something isn't working label Sep 4, 2024
@kaylareopelle
Copy link
Contributor

Hi @acarella1, thanks for reporting this bug! It seems like you have a good idea about what's needed to fix the problem. Would you be interested in submitting a PR?

@acarella1
Copy link
Author

Hi @kaylareopelle,
In my opinion Net::HTTP should tolerate this input, however it does not, even in the latest version of Ruby.
I will submit a PR in some time, thank you.

Copy link
Contributor

github-actions bot commented Oct 7, 2024

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

@github-actions github-actions bot added the stale label Oct 7, 2024
@kaylareopelle kaylareopelle added keep and removed stale labels Oct 7, 2024
@create2000
Copy link

Hello @kaylareopelle -- My name is Anthony Onah and I am an Outreachy Internship applicant. Can I be assigned this issue? If it's still open to being worked on.

@acarella1
Copy link
Author

Hi @create2000 I'll be taking care of this one in some time, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keep
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants