-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: improve logging for truncated events and update string formatting #780
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
Conversation
Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
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.
Pull Request Overview
This PR improves logging and code clarity by updating dependencies, removing redundant parentheses from string formatting, and adding a log message for truncated events.
- Upgraded several Go module dependencies to enhance compatibility and security.
- Simplified string formatting in event logging by removing unnecessary parentheses.
- Added a log message in the event processor to indicate when events are truncated.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
user/module/probe_bash.go | Removed redundant parentheses in unix.ByteSliceToString calls. |
user/event/event_postgres.go | Simplified string formatting by removing extra parentheses. |
user/event/event_mysqld.go | Streamlined string formatting by eliminating redundant parentheses. |
pkg/event_processor/processor_test.go | Removed an extra empty line in the test file. |
pkg/event_processor/iworker.go | Added a log message for truncated events, improving observability. |
go.mod | Updated dependency versions to improve compatibility and security. |
Failed to generate code suggestions for PR |
Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
fb62984
to
3635ebc
Compare
…rmatter settings Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…iple files Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…tency assets目录下的文件需要执行make后才能生成。 Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…ting Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
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.
Pull Request Overview
This PR improves logging for truncated events and updates string formatting while also upgrading several Go dependencies for compatibility and security.
- Bug fix: Removed redundant parentheses in string formatting error messages and standardized error messages to use lowercase.
- Dependency update: Upgraded several Go modules and updated Go version references in configuration files and build scripts.
- Code improvement: Enhanced logging by adding a log message for truncated events and replaced deprecated patterns with improved error wrapping.
Reviewed Changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/event_processor/http2_response.go | Updated error message wording and improved resource cleanup. |
pkg/event_processor/http2_request_test.go | Standardized test error messages and improved EOF checks. |
pkg/event_processor/http2_request.go | Similar error message and EOF check updates. |
pkg/event_processor/base_event.go | Replaced fmt.Sprintf with fmt.Fprintf for better error handling. |
go.mod | Updated Go version and dependency versions. |
functions.mk | Adjusted Go version check requirements. |
cli/http/server.go | Reordered imports and removed redundant return statements. |
cli/http/logger.go | Adjusted import order. |
cli/cobrautl/help.go | Replaced strings.Replace with strings.ReplaceAll for clearer template parsing. |
cli/cmd/upgrade.go | Improved error wrapping using %w. |
cli/cmd/tls.go, cli/cmd/gotls.go | Adjusted import order consistency. |
cli/cmd/root.go | Updated error message formatting and modified module Close() handling. |
cli/cmd/env_detection.go | Applied improved error wrapping. |
builder/init_env.sh | Updated GOBIN_ZIP variable to reflect new Go version. |
builder/Dockerfile | Changed Go download URL to new version. |
.golangci.yml | Added updated linter configurations. |
.github/workflows/* | Updated Go versions and linter settings in CI workflows. |
Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…ple files Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
This pull request includes updates to dependencies, bug fixes, and minor code improvements. The most important changes include upgrading several Go module dependencies, fixing redundant parentheses in string formatting, and adding a log message for truncated events.
Dependency Updates:
go.mod
, includinggithub.com/jschwinger233/elibpcap
(v1.0.0 → v1.0.2),github.com/rs/zerolog
(v1.33.0 → v1.34.0), and severalgolang.org/x
modules. These updates improve compatibility and security. [1] [2]Bug Fixes:
unix.ByteSliceToString
calls across multiple files (event_mysqld.go
,event_postgres.go
,probe_bash.go
) to simplify code and prevent potential issues. [1] [2] [3]Code Improvements:
pkg/event_processor/iworker.go
to notify when events are truncated, improving debugging and observability.