-
Notifications
You must be signed in to change notification settings - Fork 109
rfac: outputAccesslog func to skip accesslog at conn establishment #1376
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
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 is an enhancement to update network connection logging behavior by skipping access logs at connection establishment. Key changes include replacing the TCP_CLOSTED constant with TCP_CLOSED, updating the LONG_CONN_METRIC_THRESHOLD from 5 seconds to 30 seconds, and modifying the condition in OutputAccesslog to use the report count for skipping logs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
pkg/controller/telemetry/metric_test.go | Updated test expectation to use TCP_CLOSED instead of TCP_CLOSTED |
pkg/controller/telemetry/metric.go | Replaced TCP_CLOSTED with TCP_CLOSED; adjusted LONG_CONN_METRIC_THRESHOLD and inline comments |
pkg/controller/telemetry/accesslog.go | Modified the log skipping condition from checking duration to verifying first report |
Comments suppressed due to low confidence (1)
pkg/controller/telemetry/accesslog.go:82
- The updated condition for skipping the access log now uses totalReports instead of connection duration; please verify that this change covers all intended scenarios for connection establishment.
if data.state == TCP_ESTABLISHED && conn_metrics.totalReports == 1 {
pkg/controller/telemetry/metric.go
Outdated
@@ -48,7 +48,7 @@ const ( | |||
|
|||
DEFAULT_UNKNOWN = "-" | |||
|
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.
[nitpick] The threshold change from 5 seconds to 30 seconds may require an update to corresponding inline comments or documentation to reflect the new behavior.
// Threshold for long-lived connections, updated from 5 seconds to 30 seconds. |
Copilot uses AI. Check for mistakes.
@hzxuzhonghu can u review, it is more better approach |
also i haved fixed the typo TCP_CLOSTED |
Codecov ReportAttention: Patch coverage is
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
pkg/controller/telemetry/metric.go
Outdated
@@ -48,7 +48,7 @@ const ( | |||
|
|||
DEFAULT_UNKNOWN = "-" | |||
|
|||
LONG_CONN_METRIC_THRESHOLD = uint64(5 * time.Second) | |||
LONG_CONN_METRIC_THRESHOLD = uint64(30 * time.Second) |
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.
Is there any basis for the threshold modification to 30s?
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.
i have changed it to 5
Signed-off-by: Yash Patel <[email protected]>
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-1.1 |
@hzxuzhonghu: new pull request created: #1382 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@hzxuzhonghu: new pull request could not be created: failed to create pull request against kmesh-net/kmesh#release-1.1 from head kmesh-bot:cherry-pick-1376-to-release-1.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for kmesh-bot:cherry-pick-1376-to-release-1.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"} In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
=/kind enhancement
What this PR does / why we need it:
outputAccesslog func to skip accesslog at conn establishment
Which issue(s) this PR fixes:
Fixes #1375
Special notes for your reviewer:
Does this PR introduce a user-facing change?: