-
Notifications
You must be signed in to change notification settings - Fork 835
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(opentelemetry-instrumentation-http): handle null ports in options #2948
Conversation
Thanks @blumamir, do you think a changelog entry is required for this? |
Yes, you need to add an entry in |
Codecov Report
@@ Coverage Diff @@
## main #2948 +/- ##
==========================================
- Coverage 90.36% 90.14% -0.22%
==========================================
Files 68 68
Lines 1847 1847
Branches 394 394
==========================================
- Hits 1669 1665 -4
- Misses 178 182 +4
|
Thanks, will do and push change soon. |
2310b2b
to
4b21ec3
Compare
…stInfo See the issue for details Closes issue open-telemetry#2947
4b21ec3
to
b0026e1
Compare
New machine, forgot to set up GPG keys. That's it in with a verified commit. |
Amazing, LGTM Thanks for contributing this fix |
I looked again and found the following code in the function you fixed: if (options.port !== '') {
optionsParsed.port = Number(options.port);
} I haven't tested it myself, but I guess if |
Thanks. I see your point, although that check for port that's within the following block if (options instanceof url.URL) I can only assume that |
right 👍 thanks for the clarification |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % nit
experimental/packages/opentelemetry-instrumentation-http/src/utils.ts
Outdated
Show resolved
Hide resolved
experimental/packages/opentelemetry-instrumentation-http/src/utils.ts
Outdated
Show resolved
Hide resolved
experimental/packages/opentelemetry-instrumentation-http/src/utils.ts
Outdated
Show resolved
Hide resolved
Thank you so much for picking this up! I've been on holiday and AFK but I really appreciate the review comments being addressed 👍 |
Which problem is this PR solving?
Handles
null
port when getting request info from options wherehost
andport
are undefined or null.Fixes #2947
Short description of the changes
Asserts port is defined when appending to
origin
string returned.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Unit tests and local testing with the case presented in #2947
Checklist: