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 for parsing port at log middleware #4348

Merged
merged 3 commits into from
Jun 23, 2021
Merged

Conversation

spaparaju
Copy link
Contributor

@spaparaju spaparaju commented Jun 16, 2021

This PR fixes issue#: 4320

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Added check for : prior to splitting the port from the hostURL.

Verification

Tested on standalone, Kube. environments and did not observe parsing errors in the log files.

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.
This pr worth a unit test. Would you mind adding one?

Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

Looks good SriKrishna :) i just have small style suggestions

pkg/logging/http.go Outdated Show resolved Hide resolved
pkg/logging/http.go Outdated Show resolved Hide resolved
@bwplotka
Copy link
Member

Nice!

Can we add more clear PR title? It does not tell much what exactly was changed to fix it.

@spaparaju spaparaju changed the title fix for https://github.com/thanos-io/thanos/issues/4320 Fix for parsing port at log middleware Jun 17, 2021
@spaparaju
Copy link
Contributor Author

Thanks for the fix.
This pr worth a unit test. Would you mind adding one?

Added a unit test to test with an URL that does not explicitly contain a port number.

@GiedriusS
Copy link
Member

@spaparaju please fix the DCO:

Commit sha: 073971d, Author: Srikrishna Paparaju, Committer: Srikrishna Paparaju; Expected "Srikrishna Paparaju [email protected]", but got "Srikrishna Paparaju [email protected]".

https://github.com/thanos-io/thanos/pull/4348/checks?check_run_id=2861409152

Signed-off-by: Srikrishna Paparaju <[email protected]>
Signed-off-by: Srikrishna Paparaju <[email protected]>
Signed-off-by: Srikrishna Paparaju <[email protected]>
@spaparaju
Copy link
Contributor Author

/retest

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM.

@ikonyeama
Copy link

ikonyeama commented Jan 9, 2022

Still seeing these errors in the logs after upgrading Thanos from 0.21.1 to 0.24.0
level=error ts=2022-01-08T07:52:08.191747835Z caller=http.go:48 component=rules protocol=http http.component=server msg="failed to parse host port for http log decision" err="address xyz.com: missing port in address". Am I missing something?

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.

6 participants