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: move log comment middleware #6899

Merged
merged 4 commits into from
Jan 23, 2025
Merged

fix: move log comment middleware #6899

merged 4 commits into from
Jan 23, 2025

Conversation

nityanandagohain
Copy link
Member

@nityanandagohain nityanandagohain commented Jan 22, 2025

Part of https://github.com/SigNoz/platform-pod/issues/406

log comment is now a part of logging middleware, which add the the values to the context.


Important

Refactored log comment functionality into Logging middleware, removing LogCommentEnricher from server setup.

  • Middleware Changes:
    • Moved log comment functionality from LogCommentEnricher to getLogCommentKVs in Logging middleware in logging.go.
    • Removed LogCommentEnricher middleware from createPrivateServer and createPublicServer in server.go in both ee/query-service/app and pkg/query-service/app.
  • Functionality:
    • getLogCommentKVs now enriches request context with log comment data in Logging.Wrap().
  • Code Removal:
    • Deleted LogCommentEnricher function from server.go in both ee/query-service/app and pkg/query-service/app.

This description was created by Ellipsis for 9aeeb08. It will automatically update as commits are pushed.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added the bug Something isn't working label Jan 22, 2025
@nityanandagohain nityanandagohain marked this pull request as ready for review January 22, 2025 16:56
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot 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 to me! Reviewed everything up to 30994c9 in 1 minute and 35 seconds

More details
  • Looked at 214 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/http/middleware/logging.go:87
  • Draft comment:
    Consider handling the error returned by url.Parse(referrer) to avoid potential nil pointer dereference issues.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR moves the LogCommentEnricher functionality into the logging middleware. This change is reflected in the removal of the LogCommentEnricher middleware from the server setup and its integration into the logging middleware. The code seems to be correctly refactored, but there is a potential issue with error handling in the getLogCommentKVs function.
2. pkg/http/middleware/logging.go:81
  • Draft comment:
    Do not add non-ClickHouse related functions to the ClickHouseReader interface. Use the DAO in the telemetry instance to access such information instead.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_YO8lxwDhjBHCkUby


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot 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 to me! Incremental review on 9aeeb08 in 16 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/http/middleware/logging.go:55
  • Draft comment:
    Consider renaming getLogCommentKVs to something more descriptive like extractLogCommentKVs to better convey its purpose.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The change from a standalone function to a method of the Logging struct is appropriate given the context of the PR. However, the method name should be more descriptive to indicate its purpose clearly.
2. pkg/http/middleware/logging.go:55
  • Draft comment:
    Avoid using inline styles in React components. Instead, use external stylesheets, CSS classes, or styled components. This comment applies to all instances of inline styles in this file.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code does not violate any of the specified rules. The changes made are consistent with the existing code structure and do not introduce any new issues.

Workflow ID: wflow_IgNuU0nSMiQj9489


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@nityanandagohain nityanandagohain merged commit 7f25674 into main Jan 23, 2025
17 of 18 checks passed
@nityanandagohain nityanandagohain deleted the issue_406_3 branch January 23, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants