Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Comments

Export flow stats to pinned eBPF maps#157

Merged
iluxa merged 3 commits intomasterfrom
feature-export-flows-stats
May 14, 2025
Merged

Export flow stats to pinned eBPF maps#157
iluxa merged 3 commits intomasterfrom
feature-export-flows-stats

Conversation

@iluxa
Copy link
Collaborator

@iluxa iluxa commented Apr 21, 2025

This PR implements a new feature to export flow statistics to pinned eBPF maps, while refactoring the packet capture support check and adding a dedicated flows reader.

Refactored plain packet capture support check in pkg/packet/packet.go via a new function.
Introduced a new flows package with flows reading functionality in pkg/flows/flows.go.

see also https://github.com/kubeshark/worker/pull/677

@iluxa iluxa requested a review from Copilot April 21, 2025 14:53
Copy link

Copilot AI left a 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 implements a new feature to export flow statistics to pinned eBPF maps, while refactoring the packet capture support check and adding a dedicated flows reader.

  • Refactored plain packet capture support check in pkg/packet/packet.go via a new function.
  • Introduced a new flows package with flows reading functionality in pkg/flows/flows.go.
  • Added new eBPF map definitions and updates in BPF files for both x86 and arm64, along with corresponding pinning logic in pkg/bpf/bpf.go.

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/packet/packet.go Refactored support check logic into a helper function.
pkg/flows/flows.go Added a new flows reader with flow aggregation functionality.
pkg/bpf/tracer_bpfel_x86.go Added new map definitions for flows stats and heap flow key.
pkg/bpf/tracer_bpfel_arm64.go Synchronized changes for new flows maps with x86 implementation.
pkg/bpf/bpf.go Updated pinning logic to include the new flows map.
internal/tai/tai.go Introduced a helper function SetTimestamp for TAI timestamp handling.
bpf/packet_sniffer.c Added flow key/value structs and updated the flows statistics tracking.
Files not reviewed (1)
  • go.mod: Language not supported

@iluxa iluxa self-assigned this Apr 21, 2025
@codecov
Copy link

codecov bot commented May 13, 2025

Codecov Report

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

Please upload report for BASE (master@8d1534b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/flows/flows.go 0.00% 85 Missing ⚠️
pkg/packet/packet.go 0.00% 26 Missing ⚠️
pkg/bpf/bpf.go 0.00% 8 Missing ⚠️
internal/tai/tai.go 0.00% 7 Missing ⚠️
pkg/kubernetes/target.go 0.00% 3 Missing ⚠️
pkg/bpf/tracer_bpfel_x86.go 0.00% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##             master    #157   +/-   ##
========================================
  Coverage          ?   0.00%           
========================================
  Files             ?      54           
  Lines             ?    5187           
  Branches          ?       0           
========================================
  Hits              ?       0           
  Misses            ?    5187           
  Partials          ?       0           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@iluxa iluxa merged commit 57fedb7 into master May 14, 2025
2 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant