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

feat: Retina dataplane debug CLI #740

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

feat: Retina dataplane debug CLI #740

wants to merge 22 commits into from

Conversation

nddq
Copy link
Contributor

@nddq nddq commented Sep 12, 2024

Description

This PR introduces the skeleton for the dataplane debug CLI, as well as several commands to debug conntrack

Related Issue

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes made.

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@nddq nddq added the type/enhancement New feature or request label Sep 12, 2024
@nddq nddq self-assigned this Sep 12, 2024
@nddq nddq linked an issue Sep 13, 2024 that may be closed by this pull request
Copy link
Contributor

@anubhabMajumdar anubhabMajumdar left a comment

Choose a reason for hiding this comment

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

Can you add in the description the usage and how the output looks like?

Comment on lines +40 to +57
fmt.Println("eBPF map availability:")
for _, mt := range eBPFMapList {
err = features.HaveMapType(mt)
if err != nil && !errors.Is(err, ebpf.ErrNotSupported) {
return errors.Wrapf(err, "failed to check for map type %s", mt.String())
}
fmt.Printf("%s: %s\n", mt.String(), isSupported(err))
}

fmt.Println("--------------------------------------------------")
fmt.Println("eBPF program types availability:")
for _, pt := range eBPFProgramList {
err = features.HaveProgramType(pt)
if err != nil && !errors.Is(err, ebpf.ErrNotSupported) {
return errors.Wrapf(err, "failed to check for program type %s", pt.String())
}
fmt.Printf("%s: %s\n", pt.String(), isSupported(err))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, it's not important to list all map/prog types. We can just list all maps and programs, and that would be enough information. For specific maps (like conntrack), we may want to print entries, but listing by types is not that helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is more so for users to check which maps and programs can be initialize on their host, but yes i do plan to have a command that will list out maps/programs running

func init() {
Cmd.AddCommand(featuresCmd)
Cmd.AddCommand(qdiscCmd)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a status command, showcasing the important one-liners:

  • socket setup
  • agent running (maybe)
  • maps
  • programs
  • flow rate (?)
  • plugins

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you can already get flow rate by exec hubble status on the agent so it might be overkill?

@matmerr
Copy link
Member

matmerr commented Sep 25, 2024

an additional scenario might be scraping ourselves on /metrics to take a snapshot of what we're serving

effectively automate this task in our own tsg's

Copy link

This PR will be closed in 7 days due to inactivity.

@github-actions github-actions bot added the meta/waiting-for-author Blocked and waiting on the author label Oct 26, 2024
Copy link

github-actions bot commented Nov 2, 2024

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Nov 2, 2024
@github-actions github-actions bot deleted the nddq/feat/debugCLI branch November 2, 2024 00:21
@nddq nddq restored the nddq/feat/debugCLI branch November 4, 2024 21:28
@nddq nddq reopened this Nov 4, 2024
@nddq nddq removed the meta/waiting-for-author Blocked and waiting on the author label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

./retina debug
3 participants