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

Implement Command-Line Flags Parsing for Server and Logging #4448

Closed
20 tasks
ShohamBit opened this issue Dec 18, 2024 · 1 comment
Closed
20 tasks

Implement Command-Line Flags Parsing for Server and Logging #4448

ShohamBit opened this issue Dec 18, 2024 · 1 comment
Assignees

Comments

@ShohamBit
Copy link
Collaborator

Background
To provide a fully flexible configuration experience, we need to include command-line flags for server and logging settings. This allows users to easily enable or disable features, control logging verbosity, and manage diagnostic endpoints without editing the config file.

Tasks

Server Flags

  • --server http.metrics=<true/false>: Enable or disable the metrics endpoint.
  • --server http.pprof=<true/false>: Enable or disable pprof endpoints for performance profiling.
  • --server http.healthz=<true/false>: Enable or disable the health check endpoint.
  • --server http.pyroscope=<true/false>: Enable or disable the Pyroscope agent.
  • --server http.address=<address>: Set the HTTP server’s listening address.
  • --server grpc.address=<address>: Set the gRPC server’s listening address.

Logging Flags

  • --log level=<level>: Set the log level (debug, info, warn, error, fatal, panic).
  • --log file=<path>: Set the log file path (defaults to stdout if not specified).
  • --log aggregation.enabled=<true/false>: Enable or disable log aggregation.
  • --log aggregation.flush-interval=<interval>: Set how often logs are flushed (e.g., 5s, 1m, 1h).
  • --log filters.include.msg=<message> (repeatable): Only include logs containing this message.
  • --log filters.include.package=<package> (repeatable): Only include logs from this package.
  • --log filters.include.file=<file> (repeatable): Only include logs from this file.
  • --log filters.include.level=<level> (repeatable): Only include logs at or above this level.
  • --log filters.include.regex=<pattern> (repeatable): Only include logs matching this regex pattern.
  • --log filters.exclude.msg=<message> (repeatable): Exclude logs containing this message.
  • --log filters.exclude.package=<package> (repeatable): Exclude logs from this package.
  • --log filters.exclude.file=<file> (repeatable): Exclude logs from this file.
  • --log filters.exclude.level=<level> (repeatable): Exclude logs at or above this level.
  • --log filters.exclude.regex=<pattern> (repeatable): Exclude logs matching this regex pattern.

Acceptance Criteria

  • All server and logging flags are parsed correctly and produce no errors when used properly.
  • Invalid flag values produce clear, actionable error messages.
  • The parsed server and logging configurations integrate correctly with previously parsed settings for a complete, merged configuration.

Why This Matters
Having direct CLI control over server endpoints and logging helps operators quickly adjust settings for troubleshooting, diagnostics, and performance analysis. This reduces the need for editing and reloading config files and makes it easier to adapt the system to different runtime conditions.

@yanivagman
Copy link
Collaborator

Part of #4453

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

No branches or pull requests

2 participants