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

New server flag #4469

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

New server flag #4469

wants to merge 18 commits into from

Conversation

ShohamBit
Copy link
Collaborator

@ShohamBit ShohamBit commented Jan 7, 2025

1. Explain what the PR does

  • change gRPC and HTTP flags to server
  • refactor tracee, tracee-ebpf, tracee-rules to align with the new server flag format
  • squash grpc-listen-addr, http-listen-addr to the same flag

2375a0c974 fix: server flag is not inflags package
221d066 remove grpc flag file
edb2fd1 fix: tracee-ebpf, tracee-rules dowsnt support new flag format
cc58199 change docs for server flag
898c970 add help for server flag
5533c81 added more test to server flag
6dff62f added error handling to server
1313a9a added return nol error for function
9ee45c9 changes init of grpc server
eddcaaa added simple tests for server flag
68f18b6 fix server algorithem
aa51af1 enhanced prepareServer for better readabilty
a645543 added simple implantation of server flag

2375a0c974 fix: server flag is not inflags package

The reason why `pkg/cmd/flags/server` was like this.because tracee rules uses
this code, and doesn't compile libbpfgo and isn't dependant on libbpf go,
if we import 'pkf/cmd/flags' directly libbpfgo becomes a dependency and we need to compile it with
tracee-rules.

because tracee-rules will be removed shortly I move server pkg to flags

221d066 remove grpc flag file

grpc is part of the server flag. removeal of unnecassary code

edb2fd1 fix: tracee-ebpf, tracee-rules dowsnt support new flag format

change tracee --grpc-listen-addr and --http-listen-addr flag to --server
flag

tracee-ebpf and tracee-rulse supported the old foramt, made them support
the new flag format

2. Explain how to test it

Run tracese on your local machine with the server flag according to the new design, as described in the help section and docs.

this is the new design for the server flags:

--server http.metrics=<true/false>
--server http.pprof=<true/false>
--server http.healthz=<true/false>
--server http.pyroscope=<true/false>
--server http.address=<address>
--server grpc.address=<address>

this is the new design for the server config file:

server:
  http:
    metrics: false   # Enable metrics endpoint
    pprof: false     # Enable pprof endpoints
    healthz: false   # Enable health check endpoint
    pyroscope: false # Enable Pyroscope agent
    address: ":3366" # Set HTTP server listening address (default ":3366" when not set)
  grpc:
    address: ""      # Set gRPC server listening address (default: disabled)

you can also run the test under /tracee/pkg/cmd/flags

3. Other comments

This Pr moves the server flag from its package to the flags that have some performance issues on tracee-rules
close #4473
close #4388

@ShohamBit
Copy link
Collaborator Author

@geyslan @rscampos @NDStrahilevitz @yanivagman Hey can you look at the performance and integration check and help me resolve them, I managed to perform the same fail factors in main #4487 #4486 #4485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement flag parsing for Server. Support the option for defaulte grpc unix listent
1 participant