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

WIP: NETOBSERV-1637: OVS monitoring ebpf hook #286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

msherif1234
Copy link
Contributor

@msherif1234 msherif1234 commented Mar 4, 2024

Description

OVS monitoring eBPF hook feature

ebpf configs to enable ovs tracking from operator

      advanced:
        env:
          ENABLE_OVS_MONITORING: "true"
- bpftool perf show -p
[{
        "pid": 2854,
        "fd": 8,
        "prog_id": 143,
        "fd_type": "kprobe",
        "func": "psample_sample_packet",
        "offset": 0
    }
]
- bpftool map dump id 258
"key": {
            "eth_protocol": 2048,
            "direction": 0,
            "src_mac": [2,220,231,139,148,213
            ],
            "dst_mac": [10,88,10,128,2,12
            ],
            "src_ip": [0,0,0,0,0,0,0,0,0,0,255,255,10,128,2,2
            ],
            "dst_ip": [0,0,0,0,0,0,0,0,0,0,255,255,10,128,2,12
            ],
            "src_port": 56546,
            "dst_port": 8080,
            "transport_protocol": 6,
            "icmp_type": 0,
            "icmp_code": 0,
            "if_index": 2
        },
        "values": [{
                "cpu": 0,
                "value": {
                    "packets": 1,
                    "bytes": 74,
                    "start_mono_time_ts": 6218828496667,
                    "end_mono_time_ts": 6218828496667,
                    "flags": 2,
                    "errno": 0,
                    "dscp": 0,
                    "pkt_drops": {
                        "packets": 0,
                        "bytes": 0,
                        "latest_flags": 0,
                        "latest_state": 0,
                        "latest_drop_cause": 0
                    },
                    "dns_record": {
                        "id": 0,
                        "flags": 0,
                        "latency": 0,
                        "errno": 0
                    },
                    "flow_rtt": 0,
                     ovs_dp_keys": [[0,0,0,0,12,0,255,238
                        ],[0,0,0,0,0,0,0,0
                        ],[0,0,0,0,0,0,0,0
                        ],[0,0,0,0,0,0,0,0
                        ]

Dependencies

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 36.14%. Comparing base (1d85464) to head (02419f3).
Report is 11 commits behind head on main.

Files Patch % Lines
pkg/ebpf/tracer.go 0.00% 11 Missing ⚠️
pkg/agent/agent.go 0.00% 9 Missing ⚠️
pkg/ebpf/bpf_x86_bpfel.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #286      +/-   ##
==========================================
- Coverage   36.26%   36.14%   -0.13%     
==========================================
  Files          42       42              
  Lines        3794     3807      +13     
==========================================
  Hits         1376     1376              
- Misses       2340     2353      +13     
  Partials       78       78              
Flag Coverage Δ
unittests 36.14% <0.00%> (-0.13%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

Attention: Patch coverage is 16.15385% with 109 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@eedc708). Learn more about missing BASE report.

Files Patch % Lines
pkg/ebpf/tracer.go 0.00% 58 Missing ⚠️
pkg/agent/agent.go 3.03% 32 Missing ⚠️
pkg/flow/record.go 35.71% 7 Missing and 2 partials ⚠️
pkg/decode/decode_protobuf.go 0.00% 5 Missing and 1 partial ⚠️
pkg/flow/deduper.go 77.77% 1 Missing and 1 partial ⚠️
pkg/ebpf/bpf_x86_bpfel.go 0.00% 1 Missing ⚠️
pkg/ifaces/informer.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #286   +/-   ##
=======================================
  Coverage        ?   31.57%           
=======================================
  Files           ?       49           
  Lines           ?     3778           
  Branches        ?        0           
=======================================
  Hits            ?     1193           
  Misses          ?     2480           
  Partials        ?      105           
Flag Coverage Δ
unittests 31.57% <16.15%> (?)

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

Files Coverage Δ
pkg/agent/config.go 10.00% <ø> (ø)
pkg/exporter/grpc_proto.go 82.14% <100.00%> (ø)
pkg/exporter/kafka_proto.go 69.23% <100.00%> (ø)
pkg/flow/tracer_map.go 79.48% <100.00%> (ø)
pkg/metrics/metrics.go 96.00% <100.00%> (ø)
pkg/ebpf/bpf_x86_bpfel.go 0.00% <0.00%> (ø)
pkg/ifaces/informer.go 0.00% <0.00%> (ø)
pkg/flow/deduper.go 95.50% <77.77%> (ø)
pkg/decode/decode_protobuf.go 23.96% <0.00%> (ø)
pkg/flow/record.go 59.72% <35.71%> (ø)
... and 2 more

@msherif1234 msherif1234 force-pushed the ovs-monitoring branch 7 times, most recently from c805d52 to 490a098 Compare May 8, 2024 19:51
@msherif1234 msherif1234 changed the title WIP: initial implementation of OVS monitoring WIP: NETOBSERV-1634: initial implementation of OVS monitoring May 8, 2024
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented May 8, 2024

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

Description

OVS monitoring eBPF hook feature

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented May 8, 2024

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

Description

OVS monitoring eBPF hook feature

ebpf configs to enable ovs tracking from operator

     advanced:
       env:
         ENABLE_OVS_MONITORING: "true"

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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 openshift-eng/jira-lifecycle-plugin repository.

@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 May 8, 2024
Copy link

github-actions bot commented May 8, 2024

New image:
quay.io/netobserv/netobserv-ebpf-agent:bf271d2

It will expire after two weeks.

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

USER=netobserv VERSION=bf271d2 make set-agent-image

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented May 9, 2024

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

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

Description

OVS monitoring eBPF hook feature

ebpf configs to enable ovs tracking from operator

     advanced:
       env:
         ENABLE_OVS_MONITORING: "true"
pftool perf show -p
[{
       "pid": 2854,
       "fd": 8,
       "prog_id": 143,
       "fd_type": "kprobe",
       "func": "psample_sample_packet",
       "offset": 0
   }
]

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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 openshift-eng/jira-lifecycle-plugin repository.

@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 May 9, 2024
@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 May 9, 2024
Copy link

github-actions bot commented May 9, 2024

New image:
quay.io/netobserv/netobserv-ebpf-agent:ccad91e

It will expire after two weeks.

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

USER=netobserv VERSION=ccad91e make set-agent-image

@msherif1234
Copy link
Contributor Author

/retest

@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 16, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:e967b38

It will expire after two weeks.

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

USER=netobserv VERSION=e967b38 make set-agent-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 16, 2024
@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 16, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:4e956b7

It will expire after two weeks.

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

USER=netobserv VERSION=4e956b7 make set-agent-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 19, 2024
@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 19, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:4817ea2

It will expire after two weeks.

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

USER=netobserv VERSION=4817ea2 make set-agent-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 21, 2024
@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 21, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:6926102

It will expire after two weeks.

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

USER=netobserv VERSION=6926102 make set-agent-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 21, 2024
@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 22, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:b90cf94

It will expire after two weeks.

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

USER=netobserv VERSION=b90cf94 make set-agent-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 22, 2024
@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 22, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:5038ae3

It will expire after two weeks.

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

USER=netobserv VERSION=5038ae3 make set-agent-image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress jira/valid-reference ok-to-test To set manually when a PR is safe to test. Triggers image build on PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants