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

apply tshark ip filter and compression options to the tshark insatnce #452

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

mojtaba-esk
Copy link
Contributor

@mojtaba-esk mojtaba-esk commented Jun 21, 2024

Since the two options for filtering a particular IP address and enable file compression are added to tshark-uploader, this PR proposes a change to add them to the tshark instance in knuu so the users can configure it based on their needs.

Summary by CodeRabbit

  • New Features

    • Added file compression functionality before pushing files to S3.
    • Introduced an IP filter option for more specific data collection.
  • Improvements

    • Reduced default volume size for TsharkCollectorConfig from "10Gi" to "4Gi".
    • Updated tsharkCollectorImage to version pr-17 for improved performance and stability.
  • Configuration Updates

    • New environment variables for customization: COMPRESS_FILES and IP_FILTER.

@mojtaba-esk mojtaba-esk requested a review from a team June 21, 2024 12:32
@mojtaba-esk mojtaba-esk self-assigned this Jun 21, 2024
Copy link
Contributor

coderabbitai bot commented Jun 21, 2024

Walkthrough

Recent updates to the code include modifications to the TestTshark function in tshark_test.go to handle file compression and reduce volume size. Additionally, the TsharkCollectorConfig struct now supports IP filtering and file compression before pushing to S3. Environment variables were also updated to manage these new features, and the tsharkCollectorImage was upgraded from version pr-11 to pr-17.

Changes

File/Path Change Summary
e2e/tshark/tshark_test.go Updated filename for compressed extension, reduced VolumeSize, added CompressFiles field, removed cleanup logic
pkg/instance/instance.go Added IpFilter and CompressFiles fields to TsharkCollectorConfig struct
pkg/instance/tshark.go Updated tsharkCollectorImage version, added new environment variables COMPRESS_FILES and IP_FILTER

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TestTshark
    participant TsharkCollectorConfig

    User ->> TestTshark: Trigger Test
    TestTshark -->> TestTshark: Set filename with .tar.gz
    TestTshark -->> TsharkCollectorConfig: Update VolumeSize to 4Gi, Set CompressFiles to true
    TestTshark -x TsharkCollectorConfig: Removed CleanUp logic
    TestTshark ->> User: Test Completed Successfully

    User ->> TsharkCollectorConfig: Create Instance
    TsharkCollectorConfig -->> TsharkCollectorConfig: Add IpFilter & CompressFiles fields
    TsharkCollectorConfig ->> User: Instance Created
Loading

Poem

In the land where bytes do flow,
Compressed files now we stow,
With volumes sleek and filters neat,
Our code is now complete.
Upgraded images, shiny and new,
For data dreams, they do come true.
Here's to progress, hip-hip-hooray,
Watch our packets dance and play! 🐇🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@celestia-bot celestia-bot requested review from tty47, MSevey and smuu June 21, 2024 12:32
@mojtaba-esk mojtaba-esk enabled auto-merge June 21, 2024 12:32
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a00e9d5 and 4f6de7a.

Files selected for processing (3)
  • e2e/tshark/tshark_test.go (2 hunks)
  • pkg/instance/instance.go (1 hunks)
  • pkg/instance/tshark.go (3 hunks)
Additional comments not posted (6)
pkg/instance/tshark.go (3)

26-27: New environment variables for compression and IP filtering.

The introduction of COMPRESS_FILES and IP_FILTER as environment variables allows for dynamic configuration of these features at runtime. It's crucial to ensure that these variables are properly handled in all scenarios where the tshark collector is used.


65-66: Environment variable assignments for new features.

The assignment of the COMPRESS_FILES and IP_FILTER environment variables ensures that the tshark collector's behavior can be controlled based on the user's configuration. This is a good use of configuration to control functionality dynamically.


10-10: Updated tshark collector image version.

This change updates the tshark collector image to version pr-17. Ensure that this version supports all the newly introduced features and is fully compatible with the existing system.

e2e/tshark/tshark_test.go (2)

59-59: Updated filename to reflect compression.

The filename now includes a ".tar.gz" extension, indicating that the files will be compressed. This change is consistent with the new CompressFiles feature and should be tested to ensure that the compression is performed as expected.


Line range hint 66-75: Configuration of the tshark collector with new features.

The TsharkCollectorConfig is correctly updated to include new fields like CompressFiles and a reduced VolumeSize. It's important to verify that these settings are effective in a real environment, especially the impact of the reduced volume size on data capture capabilities.

pkg/instance/instance.go (1)

95-101: New fields added to TsharkCollectorConfig for enhanced functionality.

The addition of IpFilter and CompressFiles fields in the TsharkCollectorConfig struct aligns with the PR's objective to extend filtering and compression features to the tshark instance. These fields are well-documented, which is good for maintainability.

  • IpFilter: Ensures traffic can be filtered based on IP, enhancing targeted data capture.
  • CompressFiles: Allows for compression of pcap files before uploading to S3, potentially reducing storage and transfer costs.

Ensure that the corresponding logic to handle these configurations is implemented wherever the TsharkCollectorConfig is utilized.

@mojtaba-esk mojtaba-esk added this pull request to the merge queue Jun 21, 2024
Merged via the queue into main with commit dfeb130 Jun 21, 2024
18 checks passed
@mojtaba-esk mojtaba-esk deleted the mojtaba/apply-tshark-ip-filter-n-compression branch June 21, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants