-
Notifications
You must be signed in to change notification settings - Fork 862
feat: implement quiet mode to filter verbose logs #7478
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
Conversation
Add QUIET_MODE environment variable (set to "true" or "1" to enable) that: - Filters logs with the "windmill_verbose" target via tracing_init - Increases frequency of periodic logs by 10x when enabled - Marks per-job worker logs as verbose so they are suppressed in quiet mode Key changes: - Add QUIET_MODE lazy_static and VERBOSE_TARGET constant to tracing_init.rs - Create create_targets_filter() helper that filters windmill_verbose target - Mark periodic "still running" and "memory snapshot" logs with VERBOSE_TARGET - Mark per-job "fetched job", "started handling", "job finished" logs as verbose - Increase memory snapshot interval from every 10 ticks to every 100 ticks in quiet mode - Increase "still running" log interval from every tick to every 10 ticks in quiet mode - Add quiet mode notification in job logs Closes #7477 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Deploying windmill with
|
| Latest commit: |
1c1c877
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a2a75fb8.windmill.pages.dev |
| Branch Preview URL: | https://claude-issue-7477-20260102-0.windmill.pages.dev |
|
Claude finished @claude[bot]'s task in 1m 51s —— View job Code Review: Quiet Mode ImplementationTasks
SummaryThis PR implements a quiet mode feature that filters verbose worker logs when enabled via the General ObservationsStrengths:
Issues Found:
Security & Performance
Testing InstructionsTo verify these changes through the application: Deploy a Windmill worker with the |
| Err(Error::NotFound("not yet initialized".to_string())); | ||
|
|
||
| loop { | ||
| tokio::select!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions "update the last_ping column every 5 seconds (or 50 seconds in quiet mode)" but the quiet mode change only affects log frequency, not the ping interval. The ping frequency is still controlled by the update_job_row logic on line 733 and is unchanged.
| tokio::select!( | |
| // update the last_ping column every 5 seconds (or 50 seconds in quiet mode) |
Consider updating to:
| tokio::select!( | |
| // Log memory snapshot and ping status (in quiet mode, logs emit 10x less frequently) |
|
|
||
| lazy_static::lazy_static! { | ||
| pub static ref JSON_FMT: bool = std::env::var("JSON_FMT").map(|x| x == "true").unwrap_or(false); | ||
| pub static ref QUIET_MODE: bool = std::env::var("QUIET").map(|x| x == "true" || x == "1").unwrap_or(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an existing QUIET_LOGS environment variable defined in windmill-common/src/lib.rs:171 that also controls log verbosity. Having both QUIET and QUIET_LOGS could confuse users.
Consider either:
- Reusing
QUIET_LOGSfor this feature - Documenting the difference clearly (e.g.,
QUIET_LOGSfor conditional code checks vsQUIETfor tracing filter) - Consolidating both into a single env var
| tracing::info!("job {job_id} on {worker_name} in {w_id} still running. mem: {current_mem}kB, peak mem: {mem_peak}kB"); | ||
| // In quiet mode, emit "still running" logs 10x less frequently | ||
| let still_running_interval = if *QUIET_MODE { 10 } else { 1 }; | ||
| if i % still_running_interval == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: With still_running_interval = 10, the condition i % 10 == 0 means the first "still running" log will appear at tick 10 (5 seconds) in quiet mode, whereas normally it appears at every tick.
At tick 1: 1 % 10 = 1 ≠ 0 → no log
At tick 10: 10 % 10 = 0 → log
This is likely the intended behavior, just confirming it's not accidental that the first few ticks are skipped.
Summary
QUIET_MODEenvironment variable (set to"true"or"1"to enable) that filters noise logswindmill_verbosetarget that gets filtered in quiet modeChanges
backend/windmill-common/src/tracing_init.rsQUIET_MODElazy_static env varVERBOSE_TARGETconstant ("windmill_verbose") for logs that should be suppressedcreate_targets_filter()helper that filters the verbose target when quiet mode is onbackend/windmill-worker/src/handle_child.rsVERBOSE_TARGET:backend/windmill-worker/src/worker.rsVERBOSE_TARGET:Test plan
QUIET_MODE=trueand verify verbose logs are suppressedQUIET_MODEand verify all logs appear normallyCloses #7477
🤖 Generated with Claude Code