-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: use common logging middleware #6865
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
1 similar comment
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Reviewed everything up to 57a1a62 in 1 minute and 29 seconds
More details
- Looked at
195
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/http/middleware/logging.go:44
- Draft comment:
The context is no longer being logged. If this was intentional, please ignore. Otherwise, consider addingzap.Any("context", req.Context())
to the fields. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a new logging middleware and removes the old one. However, the new middleware does not log the context, which was present in the old middleware. This might be an oversight.
2. pkg/http/middleware/logging.go:68
- Draft comment:
Consider handling the case where the response body is empty for status codes 400 or >=500, similar to the old middleware. - Reason this comment was not posted:
Confidence changes required:50%
The PR removes the old logging middleware and replaces it with a new one. However, the new middleware does not handle the case where the response body is empty for status codes 400 or >=500. This might be an oversight.
Workflow ID: wflow_yE2xeC6Oickatwq6
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on dd208e2 in 23 seconds
More details
- Looked at
26
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. ee/query-service/app/server.go:325
- Draft comment:
The PR description mentions a spelling mistake correction fromtprivatePort
toprivatePort
, but this change is not reflected here. Ensure that the correction is made where necessary. - Reason this comment was not posted:
Comment did not seem useful.
2. pkg/query-service/app/server.go:269
- Draft comment:
The PR description mentions a spelling mistake correction fromtprivatePort
toprivatePort
, but this change is not reflected here. Ensure that the correction is made where necessary. - Reason this comment was not posted:
Marked as duplicate.
3. ee/query-service/app/server.go:325
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other instances ofmiddleware.NewLogging(zap.L()).Wrap
as well. - Reason this comment was not posted:
Comment did not seem useful.
4. pkg/query-service/app/server.go:269
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other instances ofmiddleware.NewLogging(zap.L()).Wrap
as well. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_HDj56w93GNoJhF73
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
👍 Looks good to me! Incremental review on bf5fed0 in 38 seconds
More details
- Looked at
31
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. pkg/http/middleware/logging.go:49
- Draft comment:
ThestaticFields
are removed from theLogging
struct and not used in theWrap
method. If the intent is to support static fields, consider adding them back to the log fields. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The removal of staticFields appears intentional since it's removed from both the struct and its usage. The constructor still accepting staticFields is likely an oversight. This seems like a cleanup/refactor where unused functionality was removed. The comment suggests adding the fields back, but if they were intentionally removed, this suggestion isn't helpful.
The code could be inconsistent since NewLogging still accepts staticFields but doesn't use them. Maybe there are other parts of the codebase that expect this functionality.
While the constructor parameter is inconsistent, the removal of staticFields appears intentional. If other parts of the codebase needed this functionality, the build would fail when trying to use the removed fields.
The comment should be deleted as it suggests restoring intentionally removed functionality without strong evidence that it's needed.
2. pkg/http/middleware/logging.go:25
- Draft comment:
Consider re-adding thestaticFields
to ensure consistent logging across different parts of the application. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_EnmWxlze5RoTHYG2
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 08d5cae in 12 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pkg/http/middleware/logging.go:22
- Draft comment:
No issues found with the specified rules. - Reason this comment was not posted:
Confidence changes required:0%
The code does not violate any of the specified rules. It uses external logging and does not hardcode colors or use inline styles. The file structure is not component/index.tsx, and there are no non-ClickHouse related functions in ClickHouseReader interface.
Workflow ID: wflow_fTTEwItkFTDOlxAm
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Part of https://github.com/SigNoz/platform-pod/issues/406
tprivatePort
instead ofprivatePort
in QS.Important
Replaces custom logging middleware with a common one, fixes a typo in logging fields, and enhances the
Wrap
function for static fields inlogging.go
.loggingMiddleware
andloggingMiddlewarePrivate
withmiddleware.NewLogging(zap.L()).Wrap
inserver.go
.server.go
.tprivatePort
toprivatePort
in logging fields.Wrap
function inlogging.go
to handle static fields and improve error logging.Wrap
function inlogging.go
.This description was created by for 08d5cae. It will automatically update as commits are pushed.