fix: improve logging for truncated events and update string formatting#780
Merged
Conversation
Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
There was a problem hiding this comment.
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.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, includinggit.832008.xyz/jschwinger233/elibpcap(v1.0.0 → v1.0.2),github.com/rs/zerolog(v1.33.0 → v1.34.0), and severalgolang.org/xmodules. These updates improve compatibility and security. [1] [2]Bug Fixes:
unix.ByteSliceToStringcalls 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.goto notify when events are truncated, improving debugging and observability.