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

NETOBSERV-1233: Remove L3 fields for ARP ethtype packets and update unit-test #471

Merged
merged 5 commits into from
Aug 21, 2023

Conversation

msherif1234
Copy link
Contributor

@msherif1234 msherif1234 commented Aug 10, 2023

  • remove l3 fields fom FLP storgae for layer2 EthTypes protocol like ARP
  • extend unit-test to test various protocols and L2 protocols
  • update conntrack to skip l2 flows

Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #471 (fa5ecbf) into main (5912edf) will decrease coverage by 0.06%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #471      +/-   ##
==========================================
- Coverage   66.08%   66.03%   -0.06%     
==========================================
  Files          94       94              
  Lines        6877     6921      +44     
==========================================
+ Hits         4545     4570      +25     
- Misses       2071     2092      +21     
+ Partials      261      259       -2     
Flag Coverage Δ
unittests 66.03% <100.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
pkg/config/generic_map.go 100.00% <100.00%> (ø)
pkg/pipeline/decode/decode_protobuf.go 29.78% <100.00%> (-0.73%) ⬇️
pkg/pipeline/extract/conntrack/conntrack.go 93.68% <100.00%> (+0.27%) ⬆️

@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 10, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/flowlogs-pipeline:4e8b12e

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=4e8b12e make set-flp-image

Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 10, 2023
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 10, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/flowlogs-pipeline:dcf47f6

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=dcf47f6 make set-flp-image

@@ -61,6 +61,11 @@ func (ct *conntrackImpl) Extract(flowLogs []config.GenericMap) []config.GenericM

var outputRecords []config.GenericMap
for _, fl := range flowLogs {
if !fl.IsValidProtocol() {
log.Debugf("skipping layer2 protocols flow log %v", fl)
ct.metrics.inputRecords.WithLabelValues("discarded").Inc()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ct.metrics.inputRecords.WithLabelValues("discarded").Inc()
ct.metrics.inputRecords.WithLabelValues("rejected").Inc()

Any reason not using the same metric as below ? Else maybe we should make the difference clear for the user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt rejected because of any error but in this case there is no error just l2 protocol that we aren't supporting but I am up for better suggestion ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a note in the README explaining the diffs then ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jpinsonneau I checked readme it doesn't really explain any of the metrics ? is there another place where this is already doc ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope @msherif1234 it's something we should add around the line I mentionned I guess

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have docs about the operational metrics in
https://github.com/netobserv/flowlogs-pipeline/blob/5912edfd278091cd07c693baf27bfbdc8f8408dd/docs/operational-metrics.md
but it is auto-generated and doesn't include the details about label values.

jpinsonneau
jpinsonneau previously approved these changes Aug 10, 2023
Copy link
Collaborator

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment, otherwise looks good ! thanks @msherif1234 !

@openshift-ci openshift-ci bot added the lgtm label Aug 10, 2023
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 10, 2023
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. and removed lgtm labels Aug 10, 2023
@github-actions
Copy link

New image:
quay.io/netobserv/flowlogs-pipeline:9a62d90

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=9a62d90 make set-flp-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 11, 2023
@msherif1234 msherif1234 changed the title Remove L3 fields for ARP ethtype packets and update unit-test NETOBSERV-1233: Remove L3 fields for ARP ethtype packets and update unit-test Aug 11, 2023
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Aug 11, 2023

@msherif1234: This pull request references NETOBSERV-1233 which is a valid jira issue.

In response to this:

  • remove l3 fields fom FLP storgae for layer2 EthTypes protocol like ARP
  • extend unit-test to test various protocols and L2 protocols
  • update conntrack to skip l2 flows

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.

jpinsonneau
jpinsonneau previously approved these changes Aug 11, 2023
Copy link
Collaborator

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @msherif1234

@github-actions
Copy link

New image:
quay.io/netobserv/flowlogs-pipeline:c26bbca

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=c26bbca make set-flp-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 14, 2023
return false
}

func (m GenericMap) FilterFLowLog() bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (m GenericMap) FilterFLowLog() bool {
func (m GenericMap) FilterFlowLog() bool {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think FilterFlowLog() should be a method conntrackImpl and get a flowLog as an argument. Sorry for not making it clear in my previous comment.

const duplicateFieldName = "Duplicate"
const (
duplicateFieldName = "Duplicate"
protoFieldName = "Proto"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is:
What if we get flow logs from a source that gives the protocol field a name different from Proto, for example Protocol?

jpinsonneau
jpinsonneau previously approved these changes Aug 17, 2023
@openshift-ci openshift-ci bot added the lgtm label Aug 17, 2023
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 17, 2023
@msherif1234
Copy link
Contributor Author

@Amoghrd can u pls check out this fix and add the required tags if changes are ok ?

@github-actions
Copy link

New image:
quay.io/netobserv/flowlogs-pipeline:6236dec

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=6236dec make set-flp-image

@Amoghrd
Copy link
Contributor

Amoghrd commented Aug 17, 2023

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved QE has approved this pull request label Aug 17, 2023
ronensc
ronensc previously approved these changes Aug 21, 2023
pkg/pipeline/extract/conntrack/conntrack.go Outdated Show resolved Hide resolved
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
@msherif1234 msherif1234 dismissed stale reviews from ronensc and jpinsonneau via fa5ecbf August 21, 2023 11:44
@openshift-ci openshift-ci bot removed the lgtm label Aug 21, 2023
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 21, 2023
@openshift-ci openshift-ci bot added the lgtm label Aug 21, 2023
@msherif1234
Copy link
Contributor Author

/approve

@openshift-ci
Copy link

openshift-ci bot commented Aug 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: msherif1234

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 914d470 into netobserv:main Aug 21, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants